AuthorizationGrant.parse with a map missing grant type throws weird exception

Issue #338 resolved
Henri Mikkonen created an issue

If the AuthorizationGrant.parse(final Map<String,List<String>> params) method is called with a map that doesn’t contain grant_type, quite weird exception is thrown.

        try {
            AuthorizationGrant.parse(new HashMap<>());
        } catch (Exception e) {
            e.printStackTrace();
        }

STDOUT:

java.lang.IllegalArgumentException: Illegal char(s) in description, see RFC 6749, section 5.2
    at com.nimbusds.oauth2.sdk.ErrorObject.<init>(ErrorObject.java:148)
    at com.nimbusds.oauth2.sdk.ErrorObject.appendDescription(ErrorObject.java:211)
    at com.nimbusds.oauth2.sdk.AuthorizationGrant.parse(AuthorizationGrant.java:113)

I’m using oauth2-oidc-sdk-8.33.jar

Comments (3)

  1. Log in to comment