commit | author | age
|
7f7e0c
|
1 |
package org.keycloak.protocol.cas; |
MP |
2 |
|
fdb9f6
|
3 |
import jakarta.ws.rs.Path; |
JK |
4 |
import jakarta.ws.rs.core.UriBuilder; |
755fd7
|
5 |
|
7f7e0c
|
6 |
import org.keycloak.events.EventBuilder; |
MP |
7 |
import org.keycloak.models.KeycloakSession; |
|
8 |
import org.keycloak.models.RealmModel; |
74023a
|
9 |
import org.keycloak.protocol.cas.endpoints.*; |
7f7e0c
|
10 |
import org.keycloak.services.resources.RealmsResource; |
MP |
11 |
|
|
12 |
public class CASLoginProtocolService { |
58cce9
|
13 |
private KeycloakSession session; |
7f7e0c
|
14 |
private RealmModel realm; |
MP |
15 |
private EventBuilder event; |
|
16 |
|
58cce9
|
17 |
public CASLoginProtocolService(KeycloakSession session, EventBuilder event) { |
G |
18 |
this.session = session; |
|
19 |
this.realm = session.getContext().getRealm(); |
7f7e0c
|
20 |
this.event = event; |
MP |
21 |
} |
|
22 |
|
|
23 |
public static UriBuilder serviceBaseUrl(UriBuilder baseUriBuilder) { |
|
24 |
return baseUriBuilder.path(RealmsResource.class).path("{realm}/protocol/" + CASLoginProtocol.LOGIN_PROTOCOL); |
|
25 |
} |
|
26 |
|
|
27 |
@Path("login") |
|
28 |
public Object login() { |
697561
|
29 |
return new AuthorizationEndpoint(session, event); |
7f7e0c
|
30 |
} |
MP |
31 |
|
|
32 |
@Path("logout") |
|
33 |
public Object logout() { |
697561
|
34 |
return new LogoutEndpoint(session, realm); |
7f7e0c
|
35 |
} |
MP |
36 |
|
|
37 |
@Path("validate") |
|
38 |
public Object validate() { |
697561
|
39 |
return new ValidateEndpoint(session, realm, event); |
7f7e0c
|
40 |
} |
MP |
41 |
|
74023a
|
42 |
@Path("samlValidate") |
EH |
43 |
public Object validateSaml11() { |
697561
|
44 |
return new SamlValidateEndpoint(session, realm, event); |
74023a
|
45 |
} |
EH |
46 |
|
7f7e0c
|
47 |
@Path("serviceValidate") |
MP |
48 |
public Object serviceValidate() { |
697561
|
49 |
return new ServiceValidateEndpoint(session, realm, event); |
7f7e0c
|
50 |
} |
MP |
51 |
|
|
52 |
@Path("proxyValidate") |
|
53 |
public Object proxyValidate() { |
755fd7
|
54 |
return new ProxyValidateEndpoint(session, realm, event); |
7f7e0c
|
55 |
} |
MP |
56 |
|
|
57 |
@Path("proxy") |
|
58 |
public Object proxy() { |
755fd7
|
59 |
return new ProxyEndpoint(session, realm, event); |
7f7e0c
|
60 |
} |
MP |
61 |
|
|
62 |
@Path("p3/serviceValidate") |
|
63 |
public Object p3ServiceValidate() { |
|
64 |
return serviceValidate(); |
|
65 |
} |
|
66 |
|
|
67 |
@Path("p3/proxyValidate") |
|
68 |
public Object p3ProxyValidate() { |
|
69 |
return proxyValidate(); |
|
70 |
} |
|
71 |
} |