Empty/missing scope in authorization request produces uncaught exception

Description

If the plain OAuth2 authorization request doesn’t contain any scope value, the following exception is produced right after user authentication:

java.lang.NullPointerException: Cannot invoke "java.util.Collection.iterator()" because "c" is null

It seems to be caused by the fact that the default requested scope function (DefaultRequestedScopeLookupFunction) assumes scope value always to exist in the request. That is the case with OIDC authentication request (which are required by default), but not with the OAuth2 authorization requests.

Environment

None

Activity

Henri MikkonenMay 27, 2024 at 4:58 PM

Fixed the function and improved testing

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Created May 27, 2024 at 4:45 PM
Updated July 5, 2024 at 1:25 PM
Resolved May 27, 2024 at 4:58 PM

Flag notifications