azuremicrosoft-teamsmicrosoft-entra-idclerkazure-entra-id

How to use an access token to create a clerk session?


I have a nextJs app that uses clerk for authentication, i am currently using microsoft provider. I also want to make the app available in a teams app iframe, so i am passing the access token from the teams app to the nextjs with clerk.

The problem is in teams the redirect for authentication flow is not allowed. even if it does having the using to login in again in the Iframe is not user friendly. and since both teams and my provider on clerk (microsoft) are on the same tenant, i am thinking about passing the access token from teams and use that to start a session.

Is that possible in clerk ? please advice


Solution

  • as @Meghana-MSFT suggested

    Implementing tab SSO seems to be what i am looking for.

    Docs for reference : https://learn.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/authentication/tab-sso-overview