-
Notifications
You must be signed in to change notification settings - Fork 89
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
Adding some better diagnostics for len(scopes) == 0 #403
Conversation
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
// TODO(someone): we could look deeper at the message to determine if | ||
// it's a scope error, but this is a good start. | ||
/* | ||
{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)...} | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TODO(someone): we could look deeper at the message to determine if | |
// it's a scope error, but this is a good start. | |
/* | |
{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)...} | |
*/ |
with /.default suffixed to the resource identifier (application ID URI)...} | ||
*/ | ||
if len(a.Scopes) == 0 { | ||
return fmt.Errorf("token request had an empty authority.AuthParams.Scopes, which is invalid") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AuthParams
is internal, the public API is a scopes []string
parameter
return fmt.Errorf("token request had an empty authority.AuthParams.Scopes, which is invalid") | |
return fmt.Errorf("a token request requires at least one scope") |
For issue:
#304