spring oauth2 null pointer on concurrent request -
we have oauth server setup using spring oauth2 (version 1.0.4). on trying retrieve access token client credentials grant type null pointer error when multiple concurrent requests made.
including snippet of stack trace:
java.lang.nullpointerexception org.springframework.security.oauth2.provider.token.defaultauthenticationkeygenerator.extractkey(defaultauthenticationkeygenerator.java:43) org.springframework.security.oauth2.provider.token.jdbctokenstore.getaccesstoken(jdbctokenstore.java:121) org.springframework.security.oauth2.provider.token.defaulttokenservices.createaccesstoken(defaulttokenservices.java:75) com.marketo.identity.data.impl.identitydefaulttokenservices.createaccesstoken(identitydefaulttokenservices.java:45) org.springframework.security.oauth2.provider.token.abstracttokengranter.getaccesstoken(abstracttokengranter.java:68) org.springframework.security.oauth2.provider.token.abstracttokengranter.grant(abstracttokengranter.java:60) org.springframework.security.oauth2.provider.client.clientcredentialstokengranter.grant(clientcredentialstokengranter.java:41) org.springframework.security.oauth2.provider.compositetokengranter.grant(compositetokengranter.java:38) org.springframework.security.oauth2.provider.endpoint.tokenendpoint.getaccesstoken(tokenendpoint.java:100) sun.reflect.generatedmethodaccessor167.invoke(unknown source) sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) java.lang.reflect.method.invoke(method.java:601) the request :
http://oauth-server-name/oauth/token?client_id={client_id}&client_secret={client_secret}&grant_type=client_credentials again issue not occur when single request made(or low number of concurrent requests made). kind of race condition ?
here's example looking (in xml):
<tx:advice id="tokenadvice"> <tx:attributes> <tx:method name="*" isolation="repeatable_read" /> </tx:attributes> </tx:advice> <aop:config> <aop:pointcut id="tokenservicesexecutions" expression="execution(* org.springframework.security.oauth2.provider.token.authorizationservertokenservices.*(..))" /> <aop:advisor advice-ref="tokenadvice" pointcut-ref="tokenservicesexecutions"/> </aop:config>
Comments
Post a Comment