如何使用cas服务器生成jwt作为服务凭单?

时间:2018-08-21 06:07:51

标签: java jwt cas jasig

我通过以下链接使用cas服务器生成jwt作为服务凭单。 https://apereo.github.io/cas/5.3.x/installation/Configure-ServiceTicket-JWT.html

添加依赖项:

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

像这样注册客户

{
  "@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" ] ]
    }
  }
}

在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

但是它不起作用。 我想知道是否有人通过cas服务器生成了jwt吗? 非常感谢。

0 个答案:

没有答案