if (authenticationContext.isResultCacheable() && resultCachingPredicate != null) { authenticationContext.setResultCacheable(resultCachingPredicate.apply(profileRequestContext)); log.info("{} Predicate indicates authentication result {} be cacheable in a session", getLogPrefix(), authenticationContext.isResultCacheable() ? "will" : "will not");
/** * Create a new session and populate the SessionContext. * * @param authenticationContext current authentication context * @throws SessionException if an error occurs creating the session */ private void createIdPSession(@Nonnull final AuthenticationContext authenticationContext) throws SessionException { log.debug("{} Creating new session for principal {}", getLogPrefix(), subjectCtx.getPrincipalName()); sessionCtx.setIdPSession(sessionManager.createSession(subjectCtx.getPrincipalName())); if (authenticationContext.isResultCacheable()) { sessionCtx.getIdPSession().addAuthenticationResult(authenticationContext.getAuthenticationResult()); } } }
if (authenticationContext.isResultCacheable() && resultCachingPredicate != null) { authenticationContext.setResultCacheable(resultCachingPredicate.apply(profileRequestContext)); log.info("{} Predicate indicates authentication result {} be cacheable in a session", getLogPrefix(), authenticationContext.isResultCacheable() ? "will" : "will not");
/** * Update an existing session. * * <p>If the result is the product of an attempted flow, then it's added to the session. * If reused, its last activity time is updated.</p> * * @param authenticationContext current authentication context * @param session session to update * @throws SessionException if an error occurs updating the session */ private void updateIdPSession(@Nonnull final AuthenticationContext authenticationContext, @Nonnull final IdPSession session) throws SessionException { if (authenticationContext.getAttemptedFlow() != null) { if (authenticationContext.isResultCacheable()) { log.debug("{} Adding new AuthenticationResult for flow {} to existing session {}", getLogPrefix(), authenticationContext.getAuthenticationResult().getAuthenticationFlowId(), session.getId()); session.addAuthenticationResult(authenticationContext.getAuthenticationResult()); } } else { log.debug("{} Updating activity time on reused AuthenticationResult for flow {} in existing session {}", getLogPrefix(), authenticationContext.getAuthenticationResult().getAuthenticationFlowId(), session.getId()); session.updateAuthenticationResultActivity(authenticationContext.getAuthenticationResult()); } }