The Microsoft Authentcation is very complex in my eyes. There are so many flows and stuff going!
So what I'm doing currently is
- Get a token for a specific scope using the Authorization code flow. I'm using the following scope:
https://admin.services.crm.dynamics.com//user_impersonation
(as far as I know I can only request a token for a single scope/audience) - The token works fine. I can access the dynamics admin center with the bearer token I received.
What I'm trying to do now is the following:
- I'm trying to access the Microsoft Graph endpoint to read information about the users AAD.
- I cannot use the existing token from above, as this one only has the
user_importation
scope forhttps://admin.services.crm.dynamics.com/
- I have to request another token with the scope
user.read
That's where I'm stuck. How can I use the existing access_token to request an additional scope?
I can use the oauth2/v2.0/token
endpoint in combination with the refresh token to request a token for another scope (user.read
). This works fine, but I don't want to use the refresh token for this, but instead use the access_token. Is this even possible and makes sense?