Skip to content

Commit

Permalink
Update to Keycloak 21.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and jacekkow committed Feb 24, 2023
1 parent 9611602 commit 58cce9e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<groupId>org.keycloak</groupId>
<artifactId>keycloak-protocol-cas</artifactId>
<version>20.0.5</version>
<version>21.0.0</version>
<name>Keycloak CAS Protocol</name>
<description />

Expand All @@ -36,7 +36,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.outputTimestamp>1676969243</project.build.outputTimestamp>
<project.build.outputTimestamp>1677228457</project.build.outputTimestamp>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ protected void addDefaults(ClientModel client) {
}

@Override
public Object createProtocolEndpoint(RealmModel realm, EventBuilder event) {
return new CASLoginProtocolService(realm, event);
public Object createProtocolEndpoint(KeycloakSession session, EventBuilder event) {
return new CASLoginProtocolService(session, event);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@
import javax.ws.rs.core.*;

public class CASLoginProtocolService {
private KeycloakSession session;
private RealmModel realm;
private EventBuilder event;

@Context
private KeycloakSession session;

@Context
private HttpHeaders headers;

@Context
private HttpRequest request;

public CASLoginProtocolService(RealmModel realm, EventBuilder event) {
this.realm = realm;
public CASLoginProtocolService(KeycloakSession session, EventBuilder event) {
this.session = session;
this.realm = session.getContext().getRealm();
this.event = event;
}

Expand All @@ -35,7 +34,7 @@ public static UriBuilder serviceBaseUrl(UriBuilder baseUriBuilder) {

@Path("login")
public Object login() {
AuthorizationEndpoint endpoint = new AuthorizationEndpoint(realm, event);
AuthorizationEndpoint endpoint = new AuthorizationEndpoint(session, event);
ResteasyProviderFactory.getInstance().injectProperties(endpoint);
return endpoint;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.keycloak.events.EventBuilder;
import org.keycloak.events.EventType;
import org.keycloak.models.ClientModel;
import org.keycloak.models.RealmModel;
import org.keycloak.models.KeycloakSession;
import org.keycloak.protocol.AuthorizationEndpointBase;
import org.keycloak.protocol.cas.CASLoginProtocol;
import org.keycloak.protocol.oidc.utils.RedirectUtils;
Expand All @@ -26,8 +26,8 @@ public class AuthorizationEndpoint extends AuthorizationEndpointBase {
private AuthenticationSessionModel authenticationSession;
private String redirectUri;

public AuthorizationEndpoint(RealmModel realm, EventBuilder event) {
super(realm, event);
public AuthorizationEndpoint(KeycloakSession session, EventBuilder event) {
super(session, event);
event.event(EventType.LOGIN);
}

Expand All @@ -53,7 +53,7 @@ public Response build() {
updateAuthenticationSession();

// So back button doesn't work
CacheControlUtil.noBackButtonCacheControlHeader();
CacheControlUtil.noBackButtonCacheControlHeader(session);

if (renew) {
authenticationSession.setClientNote(CASLoginProtocol.RENEW_PARAM, "true");
Expand Down

0 comments on commit 58cce9e

Please sign in to comment.