From 906d53ea7ed28325aa24d3479c2213116892c82f Mon Sep 17 00:00:00 2001 From: Matthias Piepkorn <mpiepk@gmail.com> Date: Sat, 08 Sep 2018 19:56:09 +0000 Subject: [PATCH] update to Keycloak 4.3.0.Final --- src/main/java/org/keycloak/protocol/cas/CASLoginProtocol.java | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/keycloak/protocol/cas/CASLoginProtocol.java b/src/main/java/org/keycloak/protocol/cas/CASLoginProtocol.java index cbcf1d0..a1afb9d 100644 --- a/src/main/java/org/keycloak/protocol/cas/CASLoginProtocol.java +++ b/src/main/java/org/keycloak/protocol/cas/CASLoginProtocol.java @@ -12,7 +12,6 @@ import org.keycloak.services.managers.ClientSessionCode; import org.keycloak.services.managers.ResourceAdminManager; import org.keycloak.sessions.AuthenticationSessionModel; -import org.keycloak.sessions.CommonClientSessionModel; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.Response; @@ -86,14 +85,16 @@ } @Override - public Response authenticated(UserSessionModel userSession, AuthenticatedClientSessionModel clientSession) { + public Response authenticated(UserSessionModel userSession, ClientSessionContext clientSessionCtx) { + AuthenticatedClientSessionModel clientSession = clientSessionCtx.getClientSession(); ClientSessionCode<AuthenticatedClientSessionModel> accessCode = new ClientSessionCode<>(session, realm, clientSession); String service = clientSession.getRedirectUri(); //TODO validate service - accessCode.setAction(CommonClientSessionModel.Action.CODE_TO_TOKEN.name()); + + String code = accessCode.getOrGenerateCode(); KeycloakUriBuilder uriBuilder = KeycloakUriBuilder.fromUri(service); - uriBuilder.queryParam(TICKET_RESPONSE_PARAM, SERVICE_TICKET_PREFIX + accessCode.getCode()); + uriBuilder.queryParam(TICKET_RESPONSE_PARAM, SERVICE_TICKET_PREFIX + code); URI redirectUri = uriBuilder.build(); -- Gitblit v1.9.1