使用http://jwtenizr.sh/生成 jwt 微配置文件配置。添加 microprofile-config.properties 文件与 quarkus 完美配合,但在尝试使用 openliberty 时出现以下错误:
CWWKS5523E: MicroProfile JWT 功能无法验证请求,因为无法从请求中包含的令牌创建有效的 JWT。CWWKS6029E: 无法验证 JSON Web 令牌 (JWT),因为找不到签名密钥。配置的签名算法 [RS256] 需要密钥来验证令牌。
我的 server.xml 如下:
<?xml version="1.0" encoding="UTF-8"?>
<server description="${project.artifactId}">
<featureManager>
<feature>mpJwt-1.1</feature>
<feature>jaxrs-2.1</feature>
<feature>cdi-2.0</feature>
<feature>mpConfig-1.3</feature>
<feature>mpOpenAPI-1.0</feature>
<feature>appSecurity-2.0</feature>
</featureManager>
<httpEndpoint id="defaultHttpEndpoint"
httpPort="${httpPort}" httpsPort="${httpsPort}" />
<application location="${project.build.finalName}.war" />
<logging traceSpecification="${log.name}.*=${log.level}" />
</server>
微配置文件-config.properties
mp.jwt.verify.issuer=airhacks
mp.jwt.verify.publickey=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgNSR7iZWlwOvJFyDFsva5XxUmRkBl3EjUn1OlV+jBj3LngKXBIujwAGCXYw+wr9JGJglmaOITqHtrow4j0T1wVGQF4cgN1o+FtcYyeDVsk+Ji3T3PaIIedgfzn1ufQUyWoeJAeROxmMOydImJeSe1o8VEP/ulvBAqq9IlJ2fw1Q521IE4geG5LywTSY/SdFo5zSs7sewNbZYKAguODEBQJNI85xe64mBwBKN2CKxVrwzq6plaVVBlityIcJLvh/pEXaBdnrEUXSfy4+Bf4jCIAUEV0O3GAR27fU5+tWdoHW0PIjjZ5W86D55JH+YWYOGQ06e+irLgHKxVNTIvpjE2QIDAQAB
我需要添加密钥库吗?如果是这样,为什么需要这样做?