- edited description
Parsing response from code authentication: Scope returned as array parsing exception.
I might be doing something wrong, but I am trying to authenticate with a provider that returnes the scope as follows.
,"scope":["openid"],"token_type":"bearer"}
Which gives the following error.
com.nimbusds.oauth2.sdk.ParseException: Unexpected type of JSON object member with key scope
I am currently using the following function.
TokenResponse tr = OIDCTokenResponseParser.parse(response);
As the client can take multiple scopes when creating the initial request, I would assume that the response should also be able to handle multiple scopes?
If further code or information is wanted, then I can provide that.
Comments (4)
-
reporter -
reporter - edited description
-
Ouch. You’re not doing anything wrong. The provider returns the
scope
as a JSON array, which is not the standard format for this situation.The
scope
must be a single space separated string, just like in the authZ request parameter. You may want to share the OAuth 2.0 RFC with the provider’s maintainers:https://datatracker.ietf.org/doc/html/rfc6749#section-3.3
In the meantime, you may tweak the
HTTPResponse
body to get it in the correct format. Then it will parse okay. -
- changed status to invalid
Non-standard token response.
- Log in to comment