-
I'm trying to implement a Microsoft login option and failing miserably... The use case is to authenticate users and be able to save their work in their OneDrive I am using a vanilla provider : const oneDriveProvider = Providers.AzureADB2C({
id: "msgraph",
name: "OneDrive",
clientId: process.env.MS_CLIENT_ID,
clientSecret: process.env.MS_CLIENT_SECRET,
scope: [
'offline_access',
'User.Read',
'Files.ReadWrite.AppFolder'
].join(' ')
}) my app looks like it's setup properly on azure, nothing fancy about it, I only did three things:
when I try to login, I am getting the following error :
Any advice ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This error message wasn't the relevant one, it only was a consequence of authentication failing because of a different issue. My app wasn't properly set up with Azure and Microsoft sent an error message back to our callback endpoint. I only noticed this by looking at Chrome's network debug. I have no idea where we can catch this error message in NextAuth, if somebody knows how, I wouldn't mind catching and logging these. PS: for the curious, my actual problem was that I did not set the "audience" properly to use the 'common' endpoints. In the manifest, I had |
Beta Was this translation helpful? Give feedback.
This error message wasn't the relevant one, it only was a consequence of authentication failing because of a different issue.
My app wasn't properly set up with Azure and Microsoft sent an error message back to our callback endpoint. I only noticed this by looking at Chrome's network debug. I have no idea where we can catch this error message in NextAuth, if somebody knows how, I wouldn't mind catching and logging these.
PS: for the curious, my actual problem was that I did not set the "audience" properly to use the 'common' endpoints. In the manifest, I had
"signInAudience": "PersonalMicrosoftAccount",
when I should have had"signInAudience": "AzureADandPersonalMicrosoftAccount",