Replies: 1 comment
-
Hello, Sir, I am currently using Microsoft Entra Id external to authentication and manage my customers. By default, Microsoft Entra Id external uses Microsoft API, did you get a solution in regards to setting up Azure AD B2C provider with Microsoft Graph API |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Provider type
Azure Active Directory B2C
Environment
System:
OS: macOS 12.3.1
CPU: (4) x64 Intel(R) Core(TM) i5-8210Y CPU @ 1.60GHz
Memory: 747.95 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 16.9.1 - /usr/local/bin/node
Yarn: 1.22.11 - /usr/local/bin/yarn
npm: 7.21.1 - /usr/local/bin/npm
Browsers:
Chrome: 106.0.5249.91
Firefox: 98.0.2
Safari: 15.4
npmPackages:
next: 12.2.2 => 12.2.2
next-auth: ^4.10.3 => 4.12.2
react: 18.2.0 => 18.2.0
Reproduction URL
https://github.com/nextauthjs/next-auth-example
Describe the issue
I'm using the Azure AD B2C provider and have followed the docs to set everything up. Within the Configuration (Advanced) section of the docs, I've followed the steps to setup an Azure AD api app to communicate with the Microsoft Graph API (to send email on our user's behalf). After setting this up, when a user signs up, an
access_token
(jwt) is added to myaccounts
db table. Here it is decoded:The problem is, there is no example of how to setup the Microsoft Graph JS Client with next-auth. For example, according to Microsoft, to create a Microsoft Graph API client, you must do the following:
However, using the
idp_access_token
in the decodedaccessToken
on myaccounts
db table (above) doesn't seem to work. I'm assuming I'm doing this correctly, which means this may be a bug of some sort?My auth options:
How to reproduce
Follow the Azure AD b2c docs and use my code above
Expected behavior
I should be able to use the
access_token
on theaccounts
table to access to Microsoft Graph API on behalf of the user. At the very least there should be some documentation about how to properly set this up.Beta Was this translation helpful? Give feedback.
All reactions