Skip to content

Microsoft Teams SSO - How to add new users to the database? #4673

Answered by gablabelle
gablabelle asked this question in Help
Discussion options

You must be logged in to vote

So in addition to my OAuth2 providers, I am now able to use Teams SSO (using the credentials provider) and persist user, account and session to the database through next-auth and the prisma adapter.

const adapter = PrismaAdapter(prisma);

export const authOptions: NextAuthOptions = {
  adapter,
  providers: [
    CredentialsProvider({
      id: 'teams-sso',
      name: 'Teams SSO',
      credentials: {
        clientSideToken: {
          label: 'Client side token',
          type: 'text',
        },
      },
      async authorize(credentials) {
        const { clientSideToken } = credentials || {};
        if (clientSideToken) {
          try {
            // Validate client side token
 …

Replies: 2 comments 11 replies

Comment options

You must be logged in to vote
1 reply
@gablabelle
Comment options

Answer selected by gablabelle
Comment options

You must be logged in to vote
10 replies
@rollsrobby
Comment options

@gablabelle
Comment options

@rollsrobby
Comment options

@gablabelle
Comment options

@rollsrobby
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants