<dependencies>
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-json-service-registry</artifactId>
<version>${cas.version}</version>
</dependency>
</dependencies>
{
"@class" : "org.apereo.cas.services.RegexRegisteredService",
"serviceId" : "http://localhost:8090/greet",
"name" : "greet",
"id" : 1,
"evaluationOrder" : 1
}
{
"@class" : "org.apereo.cas.services.RegexRegisteredService",
"serviceId" : "http://localhost:8090/user",
"name" : "user",
"id" : 2,
"evaluationOrder" : 2
}
package com.learn.cas.proxyticket;
import org.jasig.cas.client.authentication.AttributePrincipal;
import org.springframework.security.cas.authentication.CasAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class GreetingsController {
@GetMapping("/greet")
public String greetWithProxyTicket(Authentication authentication) {
String proxyTicket = null;
if (authentication != null && authentication instanceof CasAuthenticationToken {
AttributePrincipal principal = ((CasAuthenticationToken) authentication).getAssertion().getPrincipal();
if (principal != null) {
proxyTicket = principal.getProxyTicketFor("http://localhost:8090/user");
}
}
return proxyTicket;
}
}
-- Ray Bon Programmer analyst Development Services, University Systems 2507218831 | CLE 019 | rb...@uvic.ca
read https://apereo.github.io/cas/5.2.x/installation/Configuring-Proxy-Authentication.html
The service must also be authorized to receive the PGT as an attribute for the given attribute release policy of choice.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"@class" : "org.apereo.cas.services.RegexRegisteredService",
"serviceId" : "^https://.+",
"name" : "test",
"id" : 1,
"evaluationOrder" : 0,
"attributeReleasePolicy" : {
"@class" : "org.apereo.cas.services.ReturnAllowedAttributeReleasePolicy",
"authorizedToReleaseProxyGrantingTicket" : true
},
--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/dc0cd2d2-5eb4-4d85-af80-71ea06696044%40apereo.org.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.