Created
November 22, 2018 09:45
-
-
Save hamnis/547c550a532be7e8235aa653725b2ba2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void authenticationFinished(AuthenticationSessionModel authSession, BrokeredIdentityContext context) { | |
String prompt = authSession.getClientNote(OIDCLoginProtocol.PROMPT_PARAM); | |
if (OIDCLoginProtocol.PROMPT_VALUE_LOGIN.equals(prompt)) { | |
UserSessionModel usm = session.sessions().getUserSessionByBrokerSessionId(authSession.getRealm(), context.getBrokerSessionId()); | |
if (!AuthenticationManager.isSessionValid(authSession.getRealm(), usm)) { | |
logger.debugf("User session '%s' is not valid, maybe creating a new one", context.getBrokerSessionId()); | |
EventBuilder event = new EventBuilder(authSession.getRealm(), session, session.getContext().getConnection()); | |
event.event(EventType.IDENTITY_PROVIDER_LOGIN); | |
ClientSessionContext ctx = AuthenticationProcessor.attachSession(authSession, usm, session, authSession.getRealm(), session.getContext().getConnection(), event); | |
usm = ctx.getClientSession().getUserSession(); | |
} | |
usm.setLastSessionRefresh(Time.currentTime()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment