Skip to content

Commit

Permalink
#129 Client session note service ticket fix
Browse files Browse the repository at this point in the history
  • Loading branch information
malinowskij authored and jacekkow committed Oct 30, 2024
1 parent 9728128 commit 32997b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/keycloak/protocol/cas/CASLoginProtocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class CASLoginProtocol implements LoginProtocol {
public static final String PROXY_GRANTING_TICKET_IOU_PREFIX = "PGTIOU-";
public static final String PROXY_GRANTING_TICKET_PREFIX = "PGT-";
public static final String PROXY_TICKET_PREFIX = "PT-";
public static final String SESSION_SERVICE_TICKET = "service_ticket";
public static final String SESSION_TICKET = "service_ticket";

public static final String LOGOUT_REDIRECT_URI = "CAS_LOGOUT_REDIRECT_URI";

Expand Down Expand Up @@ -142,7 +142,7 @@ public Response sendError(ClientModel clientModel, ClientData clientData, Error
@Override
public Response backchannelLogout(UserSessionModel userSession, AuthenticatedClientSessionModel clientSession) {
String logoutUrl = clientSession.getRedirectUri();
String serviceTicket = clientSession.getNote(CASLoginProtocol.SESSION_SERVICE_TICKET);
String serviceTicket = clientSession.getNote(CASLoginProtocol.SESSION_TICKET);
//check if session is fully authenticated (i.e. serviceValidate has been called)
if (serviceTicket != null && !serviceTicket.isEmpty()) {
sendSingleLogoutRequest(logoutUrl, serviceTicket);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ protected void checkTicket(String ticket, String prefix, boolean requireReauth)
throw new CASValidationException(CASErrorCode.INVALID_TICKET, "Code is expired", Response.Status.BAD_REQUEST);
}

clientSession.setNote(prefix, ticket);
clientSession.setNote(CASLoginProtocol.SESSION_TICKET, ticket);

if (requireReauth && AuthenticationManager.isSSOAuthentication(clientSession)) {
event.error(Errors.SESSION_EXPIRED);
Expand Down

0 comments on commit 32997b7

Please sign in to comment.