mirror of https://github.com/jacekkow/keycloak-protocol-cas

Jacek Kowalski
2019-11-18 019db5713e105f989255b99171d4bcf793f7f5ec
Update to Keycloak 8.0.0

Change redirect/logout methods to match changes in Keycloack
5 files modified
14 ■■■■ changed files
pom.xml 2 ●●● patch | view | raw | blame | history
src/main/java/org/keycloak/protocol/cas/CASLoginProtocol.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/keycloak/protocol/cas/endpoints/AbstractValidateEndpoint.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/keycloak/protocol/cas/endpoints/AuthorizationEndpoint.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/keycloak/protocol/cas/endpoints/LogoutEndpoint.java 4 ●●●● patch | view | raw | blame | history
pom.xml
@@ -22,7 +22,7 @@
    <groupId>org.keycloak</groupId>
    <artifactId>keycloak-protocol-cas</artifactId>
    <version>7.0.1</version>
    <version>8.0.0</version>
    <name>Keycloak CAS Protocol</name>
    <description />
src/main/java/org/keycloak/protocol/cas/CASLoginProtocol.java
@@ -123,7 +123,7 @@
            sendSingleLogoutRequest(logoutUrl, serviceTicket);
        }
        ClientModel client = clientSession.getClient();
        new ResourceAdminManager(session).logoutClientSession(uriInfo.getRequestUri(), realm, client, clientSession);
        new ResourceAdminManager(session).logoutClientSession(realm, client, clientSession);
    }
    private void sendSingleLogoutRequest(String logoutUrl, String serviceTicket) {
src/main/java/org/keycloak/protocol/cas/endpoints/AbstractValidateEndpoint.java
@@ -63,7 +63,7 @@
        client = realm.getClients().stream()
                .filter(c -> CASLoginProtocol.LOGIN_PROTOCOL.equals(c.getProtocol()))
                .filter(c -> RedirectUtils.verifyRedirectUri(session.getContext().getUri(), service, realm, c) != null)
                .filter(c -> RedirectUtils.verifyRedirectUri(session, service, c) != null)
                .findFirst().orElse(null);
        if (client == null) {
            event.error(Errors.CLIENT_NOT_FOUND);
src/main/java/org/keycloak/protocol/cas/endpoints/AuthorizationEndpoint.java
@@ -64,7 +64,7 @@
        client = realm.getClients().stream()
                .filter(c -> CASLoginProtocol.LOGIN_PROTOCOL.equals(c.getProtocol()))
                .filter(c -> RedirectUtils.verifyRedirectUri(session.getContext().getUri(), service, realm, c) != null)
                .filter(c -> RedirectUtils.verifyRedirectUri(session, service, c) != null)
                .findFirst().orElse(null);
        if (client == null) {
            event.error(Errors.CLIENT_NOT_FOUND);
@@ -76,7 +76,7 @@
            throw new ErrorPageException(session, Response.Status.BAD_REQUEST, Messages.CLIENT_DISABLED);
        }
        redirectUri = RedirectUtils.verifyRedirectUri(session.getContext().getUri(), service, realm, client);
        redirectUri = RedirectUtils.verifyRedirectUri(session, service, client);
        event.client(client.getClientId());
        event.detail(Details.REDIRECT_URI, redirectUri);
src/main/java/org/keycloak/protocol/cas/endpoints/LogoutEndpoint.java
@@ -72,10 +72,10 @@
        client = realm.getClients().stream()
                .filter(c -> CASLoginProtocol.LOGIN_PROTOCOL.equals(c.getProtocol()))
                .filter(c -> RedirectUtils.verifyRedirectUri(session.getContext().getUri(), service, realm, c) != null)
                .filter(c -> RedirectUtils.verifyRedirectUri(session, service, c) != null)
                .findFirst().orElse(null);
        if (client != null) {
            redirectUri = RedirectUtils.verifyRedirectUri(session.getContext().getUri(), service, realm, client);
            redirectUri = RedirectUtils.verifyRedirectUri(session, service, client);
            session.getContext().setClient(client);
        }