package org.keycloak.protocol.cas.installation; import org.keycloak.Config; import org.keycloak.models.ClientModel; import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; import org.keycloak.models.RealmModel; import org.keycloak.protocol.ClientInstallationProvider; import org.keycloak.protocol.cas.CASLoginProtocol; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.net.URI; public class KeycloakCASClientInstallation implements ClientInstallationProvider { @Override public Response generateInstallation(KeycloakSession session, RealmModel realm, ClientModel client, URI baseUri) { return Response.ok("{}", MediaType.TEXT_PLAIN_TYPE).build(); } @Override public String getProtocol() { return CASLoginProtocol.LOGIN_PROTOCOL; } @Override public String getDisplayType() { return "Keycloak CAS JSON"; } @Override public String getHelpText() { return "keycloak.json file used by the Keycloak CAS client adapter to configure clients. This must be saved to a keycloak.json file and put in your WEB-INF directory of your WAR file. You may also want to tweak this file after you download it."; } @Override public void close() { } @Override public ClientInstallationProvider create(KeycloakSession session) { return this; } @Override public void init(Config.Scope config) { } @Override public void postInit(KeycloakSessionFactory factory) { } @Override public String getId() { return "keycloak-cas-keycloak-json"; } @Override public boolean isDownloadOnly() { return false; } @Override public String getFilename() { return "keycloak.json"; } @Override public String getMediaType() { return MediaType.APPLICATION_JSON; } }