Skip to content
This repository was archived by the owner on Feb 28, 2020. It is now read-only.
This repository was archived by the owner on Feb 28, 2020. It is now read-only.

null pointer exception with a bad code on Authorization code token granter #17

@xorkk

Description

@xorkk

Hello,
There is a null pointer exception, when we call getOAuth2Authentication from AuthorizationCodeTokenGranter with a bad code.

when the call arrive to this.authorizationCodeServices.consumeAuthorizationCode(authorizationCode);
-> OAuth2Authentication auth = this.remove(code);
-> GormAuthorizationCodeService -> remove(code)
-> def gormAuthorizationCode = AuthorizationCode.findWhere((codePropertyName): code) -> null
-> def serializedAuthentication = gormAuthorizationCode?."$authenticationPropertyName"
authentication = oauth2AuthenticationSerializer.deserialize(serializedAuthentication)

Null pointer exception, So we cannot have a correct error code for this ...
I suggest to check if the gormAuthorizationCode exists before deserializing, and put a correct error message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions