[keycloak-dev] NPE while getting token through Direct Access Grant

Stian Thorgersen sthorger at redhat.com
Fri Oct 16 04:08:10 EDT 2015


Does it work if you disable "Revoke Refresh Token" in token settings? When
that is off (default setting) there's no changes to the code.

On 15 October 2015 at 21:20, Kamal Jagadevan <j.kamal at ymail.com> wrote:

> Hi Guys!!
>
> I took latest master to verify the fix that Stian delivered to prevent
> usage of same refresh token.
> My test code tries getting the access token + Refresh token through direct
> access grant but fails due to NullPointer exception.
> Meanwhile I can continue to debug further, but wanted to share the
> observation to you guys... Will post further if I get any more details...
>
> Environment details - I have user federation configured to LDAP and tried
> to login with a user in ldap.
>
>
> Caused by: java.lang.NullPointerException
>         at
> org.keycloak.models.cache.infinispan.DefaultCacheUserProvider.removeUser(DefaultCacheUserProvider.java:272)
>         at
> org.keycloak.models.UserFederationManager.deleteInvalidUser(UserFederationManager.java:113)
>         at
> org.keycloak.models.UserFederationManager.validateAndProxyUser(UserFederationManager.java:135)
>         at
> org.keycloak.models.UserFederationManager.getUserById(UserFederationManager.java:163)
>         at
> org.keycloak.models.sessions.infinispan.ClientSessionAdapter.getAuthenticatedUser(ClientSessionAdapter.java:265)
>         at
> org.keycloak.authentication.DefaultAuthenticationFlow.processFlow(DefaultAuthenticationFlow.java:116)
>         at
> org.keycloak.authentication.AuthenticationProcessor.authenticateOnly(AuthenticationProcessor.java:724)
>         at
> org.keycloak.protocol.oidc.endpoints.TokenEndpoint.buildResourceOwnerPasswordCredentialsGrant(TokenEndpoint.java:357)
>         at
> org.keycloak.protocol.oidc.endpoints.TokenEndpoint.build(TokenEndpoint.java:110)
>         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:606)
>         at
> org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137)
>         at
> org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:296)
>         at
> org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:250)
>         at
> org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:140)
>         at
> org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:109)
>         at
> org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:135)
>         at
> org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:103)
>         at
> org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
>
>
> _______________________________________________
> keycloak-dev mailing list
> keycloak-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-dev/attachments/20151016/49cbf7d8/attachment.html 


More information about the keycloak-dev mailing list