Microsoft Teams SSO - How to add new users to the database? #4673
-
Hello, I'm trying to hook up a Microsoft Teams app I'm building with next-auth. The way SSO works in Teams it that:
So I implemented my flow using the Credentials provider but instead of passing
But from what I understand from this discussion is that the Credentials flow will not register new users and automatically add them to the database #2282 (comment)
So my question is what would the simpliest way for me to add the new user to the database? Is there a method I can hook in? Or maybe I should use another Provider? Any suggestion or exemples available? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
Beta Was this translation helpful? Give feedback.
-
@gablabelle thanks for sharing. do you have the full code? I'm facing the same issue and looking for away to authenticate... |
Beta Was this translation helpful? Give feedback.
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.