【问题标题】:WSO2IS 5.10 custom JWT token issuer not listed in Service Provider configurationWSO2IS 5.10 自定义 JWT 令牌颁发者未在服务提供者配置中列出
【发布时间】:2021-11-27 13:45:26
【问题描述】:

WSO2IS 5.7 中,我曾经使用自定义 JWT 令牌颁发者,方法是将其 jar 文件部署到 wso2is_home/repository/components/lib,然后在 identity.xml 文件中更改 OAuth 部分 IdentityOAuthTokenGenerator 元素与我的自定义令牌发行者的类:

<OAuth>
  ...
  <!--<IdentityOAuthTokenGenerator>org.wso2.carbon.identity.oauth2.token.JWTTokenIssuer</IdentityOAuthTokenGenerator>-->
  <IdentityOAuthTokenGenerator>it.smartcity.wso2.jwt_generator.CustomTokenIssuer</IdentityOAuthTokenGenerator>
  ...
</OAuth>

重新启动服务器。然后就可以在Service Provider配置中看到了:

使用 WSO2IS 5.10,除了将 jar 放入 components/lib 文件夹外,我只编辑了 deployment.toml 文件,添加以下内容:

[oauth.extensions]
token_generator = "it.smartcity.wso2.jwt_generator.CustomTokenIssuer"

如此处所述https://is.docs.wso2.com/en/latest/learn/extension-points-for-oauth/#oauth-token-generator 但它不起作用。

我在服务提供商屏幕中看不到我的令牌颁发者。

我还有什么需要做的吗?

【问题讨论】:

    标签: jwt wso2 token wso2is


    【解决方案1】:

    您可以在 5.10.0 中通过以下方式添加自定义令牌颁发者,而不是 token_generator。

    [[oauth.extensions.token_types]]
    name = "CustomTokenIssuer"
    issuer = "it.smartcity.wso2.jwt_generator.CustomTokenIssuer"
    persist_access_token_alias = true
    

    参考:https://github.com/wso2/docs-is/issues/1140

    【讨论】:

    • 看来[oauth.extensions] token_generator 部分根本不需要。然后我问自己需要什么……
    猜你喜欢
    • 2018-08-30
    • 2017-04-26
    • 1970-01-01
    • 2021-10-23
    • 1970-01-01
    • 2017-04-25
    • 2016-04-26
    • 2015-09-12
    • 1970-01-01
    相关资源
    最近更新 更多