/** * Processes the IdentityMessageContext and retrieved the using {@code sessionDataKey} parameter and sets the * AuthenticationResult to message context if found in AuthenticationResultCache * * @param context IdentityMessageContext * @param identityRequest Current IdentityRequest object * @return AuthenticationResult */ protected AuthenticationResult processResponseFromFrameworkLogin(IdentityMessageContext context, IdentityRequest identityRequest) { String sessionDataKey = identityRequest.getParameter(InboundConstants.RequestProcessor.CONTEXT_KEY); AuthenticationResultCacheEntry entry = FrameworkUtils.getAuthenticationResultFromCache(sessionDataKey); AuthenticationResult authnResult = null; if(entry != null) { authnResult = entry.getResult(); } else { throw FrameworkRuntimeException.error("Cannot find AuthenticationResult from the cache"); } FrameworkUtils.removeAuthenticationResultFromCache(sessionDataKey); if (authnResult.isAuthenticated()) { context.addParameter(InboundConstants.RequestProcessor.AUTHENTICATION_RESULT, authnResult); } return authnResult; } }
/** * Processes the IdentityMessageContext and retrieved the using {@code sessionDataKey} parameter and sets the * AuthenticationResult to message context if found in AuthenticationResultCache * * @param context IdentityMessageContext * @param identityRequest Current IdentityRequest object * @return AuthenticationResult */ protected AuthenticationResult processResponseFromFrameworkLogin(IdentityMessageContext context, IdentityRequest identityRequest) { String sessionDataKey = identityRequest.getParameter(InboundConstants.RequestProcessor.CONTEXT_KEY); AuthenticationResultCacheEntry entry = FrameworkUtils.getAuthenticationResultFromCache(sessionDataKey); AuthenticationResult authnResult = null; if(entry != null) { authnResult = entry.getResult(); } else { throw FrameworkRuntimeException.error("Cannot find AuthenticationResult from the cache"); } FrameworkUtils.removeAuthenticationResultFromCache(sessionDataKey); if (authnResult.isAuthenticated()) { context.addParameter(InboundConstants.RequestProcessor.AUTHENTICATION_RESULT, authnResult); } return authnResult; } }
/** * Processes the IdentityMessageContext and retrieved the using {@code sessionDataKey} parameter and sets the * AuthenticationResult to message context if found in AuthenticationResultCache * * @param context IdentityMessageContext * @param identityRequest Current IdentityRequest object * @return AuthenticationResult */ protected AuthenticationResult processResponseFromFrameworkLogin(IdentityMessageContext context, IdentityRequest identityRequest) { String sessionDataKey = identityRequest.getParameter(InboundConstants.RequestProcessor.CONTEXT_KEY); AuthenticationResultCacheEntry entry = FrameworkUtils.getAuthenticationResultFromCache(sessionDataKey); AuthenticationResult authnResult = null; if(entry != null) { authnResult = entry.getResult(); } else { throw FrameworkRuntimeException.error("Cannot find AuthenticationResult from the cache"); } FrameworkUtils.removeAuthenticationResultFromCache(sessionDataKey); if (authnResult.isAuthenticated()) { context.addParameter(InboundConstants.RequestProcessor.AUTHENTICATION_RESULT, authnResult); } return authnResult; } }