How can I use cas server to generate a jwt as a service ticket?

116 views
Skip to first unread message

leo

unread,
Aug 21, 2018, 2:19:19 AM8/21/18
to CAS Community

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.

Reply all
Reply to author
Forward
0 new messages