Missing null-check in IdentityOauthEventHandler
leads to 500 error when removing a scope-less application authorised API resource
#21395
Milestone
Describe the issue:
Can't delete a scope-less application authorized API resource in the Console application due to a 500 error.
How to reproduce:
Expected behavior:
Users should be able to remove an Authorized API Resource definition even if it doesn't have any defined scope. Either:
IdentityOauthEventHandler::handleEvent
does a null-check before callingAuthorizedAPI::getScopes
at [1];AuthorizedAPI::getScopes
[2] to return an empty list ifscopes
isnull
;else
branch in -AuthorizedAPIDAOImpl::getAuthorizedAPI
[3] to set an empty list on theAuthorizedAPI#scopes
field.Environment information:
[1] https://github.com/wso2-extensions/identity-inbound-auth-oauth/blob/v7.0.26/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/listener/IdentityOauthEventHandler.java#L284-L286
[2] https://github.com/wso2/carbon-identity-framework/blob/v7.0.78/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/AuthorizedAPI.java#L99-L102
[3] https://github.com/wso2/carbon-identity-framework/blob/v7.0.78/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/dao/impl/AuthorizedAPIDAOImpl.java#L232-L237
The text was updated successfully, but these errors were encountered: