wso2 / product-apim

Welcome to the WSO2 API Manager source code! For info on working with the WSO2 API Manager repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
853 stars 787 forks source link

[APIM-4.0.0] Error after subscribing to an API with shared scopes of another tenant #11708

Open sashansamarajeewa opened 3 years ago

sashansamarajeewa commented 3 years ago

Description:

An error is observed when trying to generate keys after subscribing to an API with shared scopes of another tenant.

Steps to reproduce:

  1. Add the following configuration in the deployment.toml file and restart the server.
    [apim.devportal]
    enable_cross_tenant_subscriptions = true
  2. Login to publisher portal as carbon.super tenant admin
  3. Create a shared scope
  4. Create an API
  5. Assign the created scope to an api resource of the API
  6. Select "Available to all the tenants" under Subscriptions and publish the API
  7. Login to developer portal, select carbon.super tenant domain and login as the tenant admin of another tenant
  8. Create an application
  9. Subscribe to the created API
  10. Try to generate the keys
[2021-09-16 09:34:30,311] ERROR - GlobalThrowableMapper An unknown exception has been captured by the global exception mapper.
java.lang.NullPointerException: null
at org.wso2.carbon.apimgt.rest.api.store.v1.mappings.ApplicationMappingUtil.getScopeInfoDTO(ApplicationMappingUtil.java:247) ~[classes/:?]
at org.wso2.carbon.apimgt.rest.api.store.v1.impl.ApplicationsApiServiceImpl.applicationsApplicationIdGet(ApplicationsApiServiceImpl.java:395) ~[classes/:?]
at org.wso2.carbon.apimgt.rest.api.store.v1.ApplicationsApi.applicationsApplicationIdGet(ApplicationsApi.java:148) ~[classes/:?]
.........................................

Affected Product Version:

APIM 4.0.0

ritheshkarra commented 5 months ago

@sashansamarajeewa ,I'm facing a similar issue in one of my personal development projects. Can you please share the solution if it's available?

Note: I have seen the limitation note, "Cross-tenant subscription is not applicable for APIs with any resource scopes (API/Shared scopes)."