diff --git a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/web/DelegatingAuthenticationConverter.java b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/web/DelegatingAuthenticationConverter.java index 44500b914..2e1cae5d4 100644 --- a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/web/DelegatingAuthenticationConverter.java +++ b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/web/DelegatingAuthenticationConverter.java @@ -15,6 +15,7 @@ */ package org.springframework.security.oauth2.server.authorization.web; +import org.springframework.lang.Nullable; import org.springframework.security.core.Authentication; import org.springframework.security.web.authentication.AuthenticationConverter; import org.springframework.util.Assert; @@ -50,6 +51,7 @@ public DelegatingAuthenticationConverter(List converter this.converters = Collections.unmodifiableList(new LinkedList<>(converters)); } + @Nullable @Override public Authentication convert(HttpServletRequest request) { Assert.notNull(request, "request cannot be null"); diff --git a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/web/DelegatingAuthorizationGrantAuthenticationConverter.java b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/web/DelegatingAuthorizationGrantAuthenticationConverter.java index ddd70f3ef..bdf5d6ee2 100644 --- a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/web/DelegatingAuthorizationGrantAuthenticationConverter.java +++ b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/web/DelegatingAuthorizationGrantAuthenticationConverter.java @@ -16,6 +16,7 @@ package org.springframework.security.oauth2.server.authorization.web; import org.springframework.core.convert.converter.Converter; +import org.springframework.lang.Nullable; import org.springframework.security.core.Authentication; import org.springframework.security.oauth2.core.AuthorizationGrantType; import org.springframework.security.oauth2.core.endpoint.OAuth2ParameterNames; @@ -48,6 +49,7 @@ public DelegatingAuthorizationGrantAuthenticationConverter( this.converters = Collections.unmodifiableMap(new HashMap<>(converters)); } + @Nullable @Override public Authentication convert(HttpServletRequest request) { Assert.notNull(request, "request cannot be null");