From 32b331f118f1c399f7f8d2405a3861f9f85222ca Mon Sep 17 00:00:00 2001 From: afabiani Date: Sat, 30 Mar 2024 12:16:16 +0100 Subject: [PATCH] - Fix test cases --- .../security/oauth2/OAuth2GeoStoreAuthenticationFilter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/rest/impl/src/main/java/it/geosolutions/geostore/services/rest/security/oauth2/OAuth2GeoStoreAuthenticationFilter.java b/src/modules/rest/impl/src/main/java/it/geosolutions/geostore/services/rest/security/oauth2/OAuth2GeoStoreAuthenticationFilter.java index 6e22cc49..a7c91408 100644 --- a/src/modules/rest/impl/src/main/java/it/geosolutions/geostore/services/rest/security/oauth2/OAuth2GeoStoreAuthenticationFilter.java +++ b/src/modules/rest/impl/src/main/java/it/geosolutions/geostore/services/rest/security/oauth2/OAuth2GeoStoreAuthenticationFilter.java @@ -188,7 +188,8 @@ private Authentication authenticateAndUpdateCache(HttpServletRequest request, Ht token = accessTokenDetails.getValue(); RequestContextHolder.getRequestAttributes().setAttribute( ACCESS_TOKEN_PARAM, accessTokenDetails.getValue(), 0); - if (accessTokenDetails.getRefreshToken().getValue() != null) { + if (accessTokenDetails != null && accessTokenDetails.getRefreshToken() != null && + accessTokenDetails.getRefreshToken().getValue() != null) { RequestContextHolder.getRequestAttributes().setAttribute( REFRESH_TOKEN_PARAM, accessTokenDetails.getRefreshToken().getValue(), 0); }