代码之家  ›  专栏  ›  技术社区  ›  gusto2

启用GroupExtractor时,wso2am-2.6.0无法生成令牌

  •  1
  • gusto2  · 技术社区  · 7 年前

    在组应用程序共享中使用wso2am-2.6.0

    启用应用程序组共享时

    <APIStore>
    <GroupingExtractor>org.wso2.carbon.apimgt.impl.DefaultGroupIDExtractorImpl</GroupingExtractor>
    

    无法从存储区生成令牌,出现以下异常

    TID: [-1234] [] [2018-11-27 12:56:11,039] ERROR {org.wso2.carbon.identity.oauth2.OAuth2Service} -  Error occurred while issuing the access token for Client ID : 4t4aXBQTmW55av0KgGVuIseqGvAa, User ID null, Scope : [default] and Grant Type : client_credentials {org.wso2.carbon.identity.oauth2.OAuth2Service}
    java.lang.NullPointerException
        at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.getApplicationByClientId(ApiMgtDAO.java:11516)
        at org.wso2.carbon.apimgt.impl.utils.APIUtil.getApplicationByClientId(APIUtil.java:7426)
        at org.wso2.carbon.apimgt.keymgt.issuers.APIMTokenIssuer.renewAccessTokenPerRequest(APIMTokenIssuer.java:157)
        at org.wso2.carbon.identity.oauth2.token.handlers.grant.AbstractAuthorizationGrantHandler.accessTokenNotRenewedPerRequest(AbstractAuthorizationGrantHandler.java:808)
        at org.wso2.carbon.identity.oauth2.token.handlers.grant.AbstractAuthorizationGrantHandler.issue(AbstractAuthorizationGrantHandler.java:129)
    

    将代码回溯到

    if (multiGroupAppSharingEnabled) {
      if (application.getGroupId().isEmpty()) {
         application.setGroupId(getGroupId(application.getId()));
      }
    }
    

    问题的直接原因是application.getGroupID()为空。以及在数据库中。

    我已经打开了一个问题 https://github.com/wso2/carbon-apimgt/issues/5874

    但是我希望有一种方法可以使用应用程序组共享

    1 回复  |  直到 7 年前
        1
  •  1
  •   Bee    7 年前

    这似乎在开发分支中得到了解决。

    https://github.com/wso2/carbon-apimgt/pull/5841/files

    编辑:看来修复不是我们需要的。添加新的修复程序。

    https://github.com/wso2/carbon-apimgt/pull/5875/files

    推荐文章