I have a few users added to my Azure AD account, I would like to get the roles and user information on these users by calling an Azure API from Postman in the form of claims. I tried calling the following URL with the parameters as :
https://login.microsoftonline.com/myTenantId/oauth2/token
Body: grant_type : password, client_id : client id, client secret : client secret
I receive the access_token in the encoded format in the response, When I decode it on https://jwt.io/ I see the decoded data, but there's no user roles in the access_token.
I would like to get the user information and the roles in the form of claims in same response.
What approach would I need to take on this ?
https://graph.microsoft.com/v1.0/users/user-id-here?$expand=memberOf
it might work. That'd return you the user info + groups and directory roles they are in. Expands have some limits though so you might need to call memberOf separately if a user has a lot of groups (or if the expand doesn't work). – juunas