Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return a friendlier error when no scopes are specified #304

Closed
chlowell opened this issue Apr 13, 2022 · 2 comments
Closed

Return a friendlier error when no scopes are specified #304

chlowell opened this issue Apr 13, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@chlowell
Copy link
Collaborator

Token acquisition methods require a []string of scopes but don't require it to contain values. If it's empty, the method will request a token for default scopes "openid offline_access profile" and return an error from AAD like

{error":"invalid_scope","error_description":"AADSTS1002012: The provided value for scope
openid offline_access profile is not valid. Client credential flows must have a scope value 
with /.default suffixed to the resource identifier (application ID URI)...}

Is there a scenario in which requesting these default scopes gets a useful token? If not, please consider returning a friendlier error to callers who don't specify a scope.

@element-of-surprise
Copy link
Contributor

#403

@element-of-surprise
Copy link
Contributor

Change merged, closing this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants