我通过以下链接使用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吗? 非常感谢。