microsoft-authentication-library-for-js
microsoft-authentication-library-for-js copied to clipboard
provide method for admin consent request
Please follow the issue template below. Failure to do so will result in a delay in answering your question.
Library
- [x ]
[email protected]or@azure/[email protected] - [x ]
@azure/[email protected] - [ x]
@azure/[email protected] - [x ]
@azure/[email protected] - [x ]
@azure/[email protected]
Description
Please describe the functionality or improvement you would like to see added.
A common task with multi-tenant applications is to obtain admin consent for certain delegated permissions:
// Line breaks are for legibility only.
GET https://login.microsoftonline.com/{tenant}/v2.0/adminconsent?
client_id=6731de76-14a6-49ae-97bc-6eba6914391e
&state=12345
&redirect_uri=http://localhost/myapp/permissions
&scope=
https://graph.microsoft.com/calendars.read
https://graph.microsoft.com/mail.send
Since the task is repetitive and constructing the request url manually is error prone, it would be helpful for users if the library were to offer a method for this.
How are we supposed to get admin-consent with MSAL? I am struggling to find any docs
@cvburgess could you please check out the samples here.
This is the approach i took: manually concatantaing the URL based on piecing together the docs around the web... but this seems crazy to me knowing MSAL has a fn for making the URL and it just does not support this at all.
Is there a reason MSAL only makes some URLs and not URLs that require admin consent?
Is there a reason MSAL only makes some URLs and not URLs that require admin consent?
Frankly, there hasn't been a large demand, and we have other features that were higher priority. That said, this is a feature we would like to add at some point, which is why I requested @derisen open this feature request to track it.
Awesome, well if i can help i gladly will.
The code i wrote on our end it working without issue thus far, so it should be pretty simple!
the adminconsent endpoint doesnt seem to return a code for acquireTokenByCode even though that param is set. Does that enpoint not support it?
cc @salman90
@jasonnutter we also need this, what is the best place in the lib for this to land, is there already a GenerateUrlForLogin some where? Then I’ll submit a PR soon.
@svrooij We'll be discussing this feature request internally to determine if/where/how we will support it and follow up.
any update for admin consent requests?