Skip to content

What scope to use to acquire token for resource R with permission P? For example, MS Defender API? #572

Answered by rayluo
dt-flo asked this question in Q&A
Discussion options

You must be logged in to vote

The resource parameter is for an older version of token endpoint. MSAL libraries all use scope.

Generally speaking, a scope can be concatenated by resource R and permission P, so you use R/P. For example, MS Defender API's resource is https://api.securitycenter.microsoft.com and a permission is Machine.Read. I tried https://api.securitycenter.microsoft.com/Machine.Read with MSAL Python and it at least yielded a meaningful error ("need admin approval") which is probably due to my existing test app was not set up for consuming Defender API. Regardless, you can try that scope and see if it can carry you further.

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by rayluo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #570 on June 06, 2023 01:43.