Details
Description
Null pointer exception when user tries to create clientID without selecting scopes.
Steps:
1.Login to Oauth UI
2.Enter clientid and click Save without selecting scope
Actual result:
UI shows message, "There was problem processing your request..." and client id gets added.
(Attached screenshot)
Snippet Tomcat log:
Address: http://localhost:9933/aml-oauth-provider/rest/client-management/Nullpointer01
Encoding: UTF-8
Http-Method: PUT
Content-Type: application/json; charset=UTF-8
Headers:
Payload:
{"clientId":"Nullpointer01","clientSecret":"","scopes":null,"refreshTokens":[]}--------------------------------------
2016-01-11 14:42:13 WARN org.apache.cxf.phase.PhaseInterceptorChain:452 - tsa.amlproduct.qa@gmail.com REALM_qa2, ROLE_USER - Application
UserService has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:163)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:129)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:200)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
.
..
.
.
Caused by: java.lang.NullPointerException
at com.admaxlocal.oauth2.provider.dao.ClientIdDao.toCsv(ClientIdDao.java:37)
at com.admaxlocal.oauth2.provider.dao.ClientIdDao.createClientId(ClientIdDao.java:27)
at com.admaxlocal.oauth2.provider.services.cxf.ClientIdService.createClientId(ClientIdService.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:181)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:97)
... 72 more
Expected Result:
Client id without scope shouldn't add in UI.