Un authorized text shown on page got redirected to my application after granting admin consent to new tenant

Viewed 24

I have two tenants t1 and t2. On t1 when admin of t2 logs in it asks for admin consent at this URL:

https://login.microsoftonline.com/{tenant}/v2.0/adminconsent?client_id=6731de76-14a6-49ae-97bc-6eba6914391e&scope=https://graph.microsoft.com/Calendars.Readhttps://graph.microsoft.com/Mail.Send&redirect_uri=http://localhost/myapp/permissions

Admin login is successful then permission are granted and under ENTERPRISE APPLICATION of t2 , t1 app is being created.

When user is redirected back to my application page on below URL its says Unauthorized!!!

http://localhost/myapp/permissions?admin_consent=True&tenant=fa00d692-e9c7-4460-a743-29f2956fd429&scope=https://graph.microsoft.com/Calendars.Read https://graph.microsoft.com/Mail.Send

If I remove scopes from this Url then it hits my single page without un authorized error and works fine.

0 Answers
Related