Skip to content

How to use custom Azure AD scopes? #3006

Answered by itsthekeming
itsthekeming asked this question in Help
Discussion options

You must be logged in to vote

So after many months of looking at this on and off, I think I came to a solution that works for my use case.

Using the on-behalf-flow, we added an endpoint to our API that fetches the user info itself. I can't recall the implementation of that endpoint at the moment, but it calls the Graph API. We can then configure our authentication to only use our custom scope for our API, and call the endpoint we created as our userInfo endpoint.

I got a prototype working with remix and remix-auth, so I'm not sure the exact details of how to get it to work with next-auth, but this solved our issue. Happy to try and answer any further questions people have about this potential solution.

Replies: 7 comments 9 replies

Comment options

You must be logged in to vote
4 replies
@itsthekeming
Comment options

@manoj-mukherjee-maersk
Comment options

@aliblack89
Comment options

@itsthekeming
Comment options

Comment options

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

Comment options

You must be logged in to vote
0 replies
Comment options

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

Answer selected by itsthekeming
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@egreb
Comment options

@dmitryzelenkin
Comment options

@manoj-mukherjee-maersk
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
10 participants