DEV Community

Discussion on: Integrate Azure AD with Firebase and call MS Graph in a Node.js app

Collapse
 
christosmatskas profile image
Christos Matskas

If a user is assigned roles, then these will be part of the ID Token. You will need to create some mapping in the Firebase DB but to be honest I don't think you need this as the roles will always be part of the ID Token. Any reason why you need to persist them?

Collapse
 
shahzad6077 profile image
Muhammad Shahzad Ali

Yes we are getting the roles in ID Token but only when user sign-in otherwise ID Token isn't included in authstatuschanged or I'm missing something?

Thread Thread
 
proskurindima profile image
proskurindima

Hi!
Did you manage to solve this problem?
We ran into exactly the same problem today and haven't been able to find a solution yet.

Thread Thread
 
christosmatskas profile image
Christos Matskas

I think the problem here is with Firebase and not Azure AD... You can certainly reach out to our dev support team to get some assistance aka.ms/425Show/help

Thread Thread
 
shahzad6077 profile image
Muhammad Shahzad Ali

Thanks @christosmatskas for the response. Yeah you right the problem is with the Firebase. I didn't find a reliable solution yet. you can get the user app role with the MS graph API using OAuth token.

stackoverflow.com/questions/635008...
docs.microsoft.com/en-us/graph/api...
https://docs.microsoft.com/en-us/graph/api/group-list-approleassignments?view=graph-rest-1.0&tabs=http

If anyone found a reliable solution share with us :) Thanks!