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

wso2am-2.6.0 unable to generate token when GroupExtractor is enabled

使用 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

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

这似乎已在开发分支中修复。

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

编辑:似乎修复不是我们在这里需要的。添加了新修复程序。

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