vote
favorite 
<https://stackoverflow.com/questions/51942557/how-can-i-use-cas-server-to-generate-a-jwt-as-a-service-ticket#>

I use the cas server to generate a jwt as a service ticket by following the 
link below.
https://apereo.github.io/cas/5.3.x/installation/Configure-ServiceTicket-JWT.html

Add dependency :

<dependency>
     <groupId>org.apereo.cas</groupId>
     <artifactId>cas-server-support-token-tickets</artifactId>
     <version>${cas.version}</version>
</dependency>

Register Clients like that:

{
  "@class" : "org.apereo.cas.services.RegexRegisteredService",
  "serviceId" : "^https://.*";,
  "name" : "Sample",
  "id" : 10,
  "properties" : {
    "@class" : "java.util.HashMap",
    "jwtAsServiceTicket" : {
      "@class" : "org.apereo.cas.services.DefaultRegisteredServiceProperty",
      "values" : [ "java.util.HashSet", [ "true" ] ]
    }
  }
}

Add configuration in application.properties

cas.authn.token.crypto.encryptionEnabled=true
cas.authn.token.crypto.signingEnabled=true
cas.authn.token.crypto.signing.key=
cas.authn.token.crypto.signing.keySize=512
cas.authn.token.crypto.encryption.key=
cas.authn.token.crypto.encryption.keySize=256
cas.authn.token.crypto.alg=AES
cas.authn.token.crypto.enabled=false

However it doesn't work. I wonder if someone has generated jwt by cas 
server? Thanks a lot.

-- 
- 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/9be011dd-6eea-4bed-930e-01b215c263c0%40apereo.org.

Reply via email to