product-is icon indicating copy to clipboard operation
product-is copied to clipboard

NPE when deleting an authorized API without scopes

Open ThaminduR opened this issue 1 year ago • 3 comments

Describe the issue:

$subject

How to reproduce:

  1. Authorize an API without scopes to an application
  2. Delete the authorized API
  3. An error will be displayed and server error will be logged in the terminal

ThaminduR avatar Feb 21 '24 16:02 ThaminduR

This is reproducing in IS 7 - RC7

User should now allow to save the API authorization without a scope.

[2024-03-01 12:09:24,383] [3a86ca1b-f151-46d5-9224-441c3d6d604a] ERROR {org.wso2.carbon.identity.api.dispatcher.core.DefaultExceptionMapper} - Server encountered an error while serving the request. java.lang.NullPointerException at org.wso2.carbon.identity.oauth.listener.IdentityOauthEventHandler.handleEvent(IdentityOauthEventHandler.java:284) at org.wso2.carbon.identity.event.services.IdentityEventServiceImpl.handleEvent(IdentityEventServiceImpl.java:56) at org.wso2.carbon.identity.application.mgt.publisher.ApplicationAuthorizedAPIManagementEventPublisherProxy.doPublishEvent(ApplicationAuthorizedAPIManagementEventPublisherProxy.java:122) at org.wso2.carbon.identity.application.mgt.publisher.ApplicationAuthorizedAPIManagementEventPublisherProxy.publishPreDeleteAuthorizedAPIForApplication(ApplicationAuthorizedAPIManagementEventPublisherProxy.java:92) at org.wso2.carbon.identity.application.mgt.AuthorizedAPIManagementServiceImpl.deleteAuthorizedAPI(AuthorizedAPIManagementServiceImpl.java:89) at org.wso2.carbon.identity.api.server.application.management.v1.core.ServerApplicationManagementService.deleteAuthorizedAPI(ServerApplicationManagementService.java:1435) at org.wso2.carbon.identity.api.server.application.management.v1.impl.ApplicationsApiServiceImpl.deleteAuthorizedAPI(ApplicationsApiServiceImpl.java:149) at org.wso2.carbon.identity.api.server.application.management.v1.ApplicationsApi.deleteAuthorizedAPI(ApplicationsApi.java:242) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104)

indeewari avatar Mar 01 '24 06:03 indeewari

I can see this error when we delete the scope attached to the API resource (which is already added to an application). Can we fix this soon with proper error message rather than a null pointer ?

pathberiya avatar May 07 '24 16:05 pathberiya

Hi @pathberiya, Is it IS 7 version you see this error ?

indeewari avatar May 08 '24 05:05 indeewari