我正在使用 vertx 生成带有客户端凭据的 OAuth2 令牌,这是代码片段
<artifactId>vertx-auth-oauth2</artifactId>
<version>3.9.1</version>
OAuth2ClientOptions credentials = new OAuth2ClientOptions() .setClientID(clientId) .setClientSecret(clientSecret) .setFlow(OAuth2FlowType.CLIENT) .setTokenPath("oauth/token URL");
OAuth2Auth oAuth2Auth = OAuth2Auth.create(Vertx.vertx(),credentials);
JsonObject tokenConfig = new JsonObject();
oAuth2Auth.authenticate(tokenConfig, res ->
{
if (res.failed()) {
log.info("Access Token Error;" + res.cause().getMessage());
} else {
User token = res.result();
log.info("token:" + token);
}
}
);
错误: 访问令牌错误;io/vertx/ext/jwt/NoSuchKeyIdException Stack Future{cause=io/vertx/ext/jwt/NoSuchKeyIdException}