commit | author | age
|
7f7e0c
|
1 |
package org.keycloak.protocol.cas.installation; |
MP |
2 |
|
|
3 |
import org.keycloak.Config; |
|
4 |
import org.keycloak.models.ClientModel; |
|
5 |
import org.keycloak.models.KeycloakSession; |
|
6 |
import org.keycloak.models.KeycloakSessionFactory; |
|
7 |
import org.keycloak.models.RealmModel; |
|
8 |
import org.keycloak.protocol.ClientInstallationProvider; |
|
9 |
import org.keycloak.protocol.cas.CASLoginProtocol; |
|
10 |
|
|
11 |
import javax.ws.rs.core.MediaType; |
|
12 |
import javax.ws.rs.core.Response; |
|
13 |
import java.net.URI; |
|
14 |
|
|
15 |
public class KeycloakCASClientInstallation implements ClientInstallationProvider { |
|
16 |
|
|
17 |
@Override |
|
18 |
public Response generateInstallation(KeycloakSession session, RealmModel realm, ClientModel client, URI baseUri) { |
|
19 |
return Response.ok("{}", MediaType.TEXT_PLAIN_TYPE).build(); |
|
20 |
} |
|
21 |
|
|
22 |
@Override |
|
23 |
public String getProtocol() { |
|
24 |
return CASLoginProtocol.LOGIN_PROTOCOL; |
|
25 |
} |
|
26 |
|
|
27 |
@Override |
|
28 |
public String getDisplayType() { |
|
29 |
return "Keycloak CAS JSON"; |
|
30 |
} |
|
31 |
|
|
32 |
@Override |
|
33 |
public String getHelpText() { |
|
34 |
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."; |
|
35 |
} |
|
36 |
|
|
37 |
@Override |
|
38 |
public void close() { |
|
39 |
|
|
40 |
} |
|
41 |
|
|
42 |
@Override |
|
43 |
public ClientInstallationProvider create(KeycloakSession session) { |
|
44 |
return this; |
|
45 |
} |
|
46 |
|
|
47 |
@Override |
|
48 |
public void init(Config.Scope config) { |
|
49 |
|
|
50 |
} |
|
51 |
|
|
52 |
@Override |
|
53 |
public void postInit(KeycloakSessionFactory factory) { |
|
54 |
|
|
55 |
} |
|
56 |
|
|
57 |
@Override |
|
58 |
public String getId() { |
|
59 |
return "keycloak-cas-keycloak-json"; |
|
60 |
} |
|
61 |
|
|
62 |
@Override |
|
63 |
public boolean isDownloadOnly() { |
|
64 |
return false; |
|
65 |
} |
|
66 |
|
|
67 |
@Override |
|
68 |
public String getFilename() { |
|
69 |
return "keycloak.json"; |
|
70 |
} |
|
71 |
|
|
72 |
@Override |
|
73 |
public String getMediaType() { |
|
74 |
return MediaType.APPLICATION_JSON; |
|
75 |
} |
|
76 |
|
|
77 |
} |