Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jans-auth-server): wrong Client Authn Method at token endpoint throws NPE #3503

Closed
nynymike opened this issue Jan 3, 2023 · 3 comments · Fixed by #3598
Closed

fix(jans-auth-server): wrong Client Authn Method at token endpoint throws NPE #3503

nynymike opened this issue Jan 3, 2023 · 3 comments · Fixed by #3598
Assignees
Labels
comp-jans-auth-server Component affected by issue or PR kind-bug Issue or PR is a bug in existing functionality
Milestone

Comments

@nynymike
Copy link
Contributor

nynymike commented Jan 3, 2023

image

If your client uses a different authn method at the token endpoint, this very unfriendly message is thrown by Auth Server.

@yuriyz yuriyz unassigned moabu Jan 3, 2023
@yuriyz yuriyz added comp-jans-auth-server Component affected by issue or PR kind-bug Issue or PR is a bug in existing functionality labels Jan 3, 2023
@yuriyz yuriyz added this to the 1.0.6 milestone Jan 3, 2023
@yuriyz yuriyz changed the title Wrong Client Authn Method at token endpoint throws NPE fix(jans-auth-server): wrong Client Authn Method at token endpoint throws NPE Jan 3, 2023
@yuriyz
Copy link
Contributor

yuriyz commented Jan 4, 2023

It can be related (or not)

Caused by: java.lang.NullPointerException
	at io.jans.as.server.service.AuthorizeService.permissionGranted(AuthorizeService.java:166) ~[classes/:?]
	at io.jans.as.server.service.AuthorizeService$Proxy$_$$_WeldClientProxy.permissionGranted(Unknown Source) ~[classes/:?]
	at io.jans.as.server.authorize.ws.rs.AuthorizeAction.permissionGranted(AuthorizeAction.java:809) ~[classes/:?]
	at io.jans.as.server.authorize.ws.rs.AuthorizeAction.permissionGranted(AuthorizeAction.java:804) ~[classes/:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.apache.el.parser.AstValue.invoke(AstValue.java:252) ~[org.mortbay.jasper.apache-el-10.0.14.jar:10.0.14]
	at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:266) ~[org.mortbay.jasper.apache-el-10.0.14.jar:10.0.14]
	at org.jboss.weld.module.web.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40) ~[weld-web-4.0.3.Final.jar:4.0.3.Final]
	at org.jboss.weld.module.web.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) ~[weld-web-4.0.3.Final.jar:4.0.3.Final]
	at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:70) ~[jakarta.faces-3.0.2.jar:3.0.2]
	at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:67) ~[jakarta.faces-3.0.2.jar:3.0.2]
	at com.sun.faces.application.ActionListenerImpl.getNavigationOutcome(ActionListenerImpl.java:75) ~[jakarta.faces-3.0.2.jar:3.0.2]
	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:64) ~[jakarta.faces-3.0.2.jar:3.0.2]
	at jakarta.faces.component.UICommand.broadcast(UICommand.java:213) ~[jakarta.faces-3.0.2.jar:3.0.2]
	at jakarta.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:852) ~[jakarta.faces-3.0.2.jar:3.0.2]
	at jakarta.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1329) ~[jakarta.faces-3.0.2.jar:3.0.2]
	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:56) ~[jakarta.faces-3.0.2.jar:3.0.2]
	... 44 more

@yuriyz
Copy link
Contributor

yuriyz commented Jan 4, 2023

@manojs1978 can you share NPE which you get for wrong client authn method ? Is it then one I posted above or something different ?

@manojs1978
Copy link
Contributor

hi @yuriyz ,
i checked logs it is same error in my log file as well,
please find log zip attached we well

Caused by: java.lang.NullPointerException
at io.jans.as.server.service.AuthorizeService.permissionGranted(AuthorizeService.java:166) ~[classes/:?]
at io.jans.as.server.service.AuthorizeService$Proxy$_$$_WeldClientProxy.permissionGranted(Unknown Source) ~[classes/:?]
at io.jans.as.server.authorize.ws.rs.AuthorizeAction.permissionGranted(AuthorizeAction.java:809) ~[classes/:?]
at io.jans.as.server.authorize.ws.rs.AuthorizeAction.permissionGranted(AuthorizeAction.java:804) ~[classes/:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.apache.el.parser.AstValue.invoke(AstValue.java:252) ~[org.mortbay.jasper.apache-el-10.0.14.jar:10.0.14]
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:266) ~[org.mortbay.jasper.apache-el-10.0.14.jar:10.0.14]
at org.jboss.weld.module.web.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40) ~[weld-web-4.0.3.Final.jar:4.0.3.Final]
at org.jboss.weld.module.web.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) ~[weld-web-4.0.3.Final.jar:4.0.3.Final]
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:70) ~[jakarta.faces-3.0.2.jar:3.0.2]
at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:67) ~[jakarta.faces-3.0.2.jar:3.0.2]
at com.sun.faces.application.ActionListenerImpl.getNavigationOutcome(ActionListenerImpl.java:75) ~[jakarta.faces-3.0.2.jar:3.0.2]
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:64) ~[jakarta.faces-3.0.2.jar:3.0.2]
at jakarta.faces.component.UICommand.broadcast(UICommand.java:213) ~[jakarta.faces-3.0.2.jar:3.0.2]
at jakarta.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:852) ~[jakarta.faces-3.0.2.jar:3.0.2]
at jakarta.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1329) ~[jakarta.faces-3.0.2.jar:3.0.2]
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:56) ~[jakarta.faces-3.0.2.jar:3.0.2]
... 49 more
2023-01-04 08:22:09,458 ERROR [qtp952562199-15] b693654d-3bf4-4dca-a5f3-363a684f2599 [io.jans.as.server.exception.GlobalExceptionHandler] (GlobalExceptionHandler.java:75) - #{authorizeAction.permissionGranted}: java.lang.NullPointerException
jakarta.faces.FacesException: #{authorizeAction.permissionGranted}: java.lang.NullPointerException
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:64) ~[jakarta.faces-3.0.2.jar:3.0.2]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:72) ~[jakarta.faces-3.0.2.jar:3.0.2]
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:159) ~[jakarta.faces-3.0.2.jar:3.0.2]
at jakarta.faces.webapp.FacesServlet.executeLifecyle(FacesServlet.java:681) ~[jakarta.faces-3.0.2.jar:3.0.2]
at jakarta.faces.webapp.FacesServlet.service(FacesServlet.java:437) ~[jakarta.faces-3.0.2.jar:3.0.2]
at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1419) ~[?:?]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764) ~[?:?]
at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1665) ~[?:?]
at io.jans.as.server.audit.debug.ServletLoggingFilter.doFilter(ServletLoggingFilter.java:71) ~[classes/:?]

authlogs.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-jans-auth-server Component affected by issue or PR kind-bug Issue or PR is a bug in existing functionality
Projects
None yet
4 participants