Merge pull request 'The UMA refresh token flow is skipped by the specific setting (constant in the class) and a new token is requested if the old is expired.' (#7) from mauro.mugnaini/threadlocal-vars-cleaner:master into master
This commit is contained in:
commit
62a6375372
|
@ -48,6 +48,7 @@ public class SmartGearsPortalValve extends ValveBase {
|
|||
private final static String DEFAULT_ROLE = "OrganizationMember";
|
||||
private final static String LIFERAY_POLLER_CONTEXT = "poller/receive";
|
||||
|
||||
private static boolean REFRESH_UMA_TOKEN = false;
|
||||
private static String LOGOUT_URI = "/c/portal/logout";
|
||||
private static boolean FORCE_LOGOUT_ON_INVALID_OIDC = true;
|
||||
private static boolean FORCE_LOGOUT_ON_MISSING_OIDC = true;
|
||||
|
@ -125,6 +126,7 @@ public class SmartGearsPortalValve extends ValveBase {
|
|||
_log.trace("Current UMA token is OK {}", umaToken.getTokenEssentials());
|
||||
} else {
|
||||
if (umaToken != null && umaToken.getAud().contains(urlEncodedScope) && umaToken.isExpired()) {
|
||||
if (REFRESH_UMA_TOKEN) {
|
||||
_log.debug("Suitable UMA token found but is expired, trying to refresh it {}",
|
||||
umaToken.getTokenEssentials());
|
||||
|
||||
|
@ -156,6 +158,18 @@ public class SmartGearsPortalValve extends ValveBase {
|
|||
} else {
|
||||
_log.error("Refreshing UMA token on server " + umaToken.getTokenEssentials(), e);
|
||||
}
|
||||
umaToken = null;
|
||||
_log.debug(
|
||||
"Removing inactive UMA token from cache proxy if present for user {} and session {}",
|
||||
user.getScreenName(), sessionId);
|
||||
|
||||
JWTCacheProxy.getInstance().removeUMAToken(user, sessionId);
|
||||
}
|
||||
} else {
|
||||
_log.debug("Suitable UMA token found but it is expired."
|
||||
+ "It will be replaced with new one according to settings {}",
|
||||
umaToken.getTokenEssentials());
|
||||
|
||||
umaToken = null;
|
||||
_log.debug("Removing inactive UMA token from cache proxy if present for user {} and session {}",
|
||||
user.getScreenName(), sessionId);
|
||||
|
|
Loading…
Reference in New Issue