000013409 - AXM: NullPointerException in Hook with InternalRuntimeAPI

Document created by RSA Customer Support Employee on Jun 14, 2016Last modified by RSA Customer Support Employee on Apr 21, 2017
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000013409
Applies ToRSA ClearTrust 5.5.x Server Side Hooks
RSA Access Manager 6.0 Server SPI (Server Hook)
RSA ClearTrust 5.5.x Property Provider API
RSA Access Manager 6.0 Property Provider API
IssueAXM: Implementing the Property Provider interface in a hook in order to access the PPI's InternalRuntimaAPI object

On accessing the InternalRuntimeAPI from a Server Side Hook, which implements the interface PropertyProvider, a NullPointerException is thrown routinely about one third of the time (which is only visible under debug logging):

    at sirrus.authserver.property.impl.PropertyCallbackImpl.getContext(PropertyCallbackImpl.java:198)
    at sirrus.authserver.runtime.impl.InternalRuntimeAPIImpl.getRequestMap(InternalRuntimeAPIImpl.java:421)
    at sirrus.authserver.runtime.impl.InternalRuntimeAPIImpl.createToken(InternalRuntimeAPIImpl.java:130)

CauseThe root cause is the absence of a ThreadLocal RequestContext object.  Every request that the authorization server processes normally has a RequestContext, which contains the user map, the request map, and sometimes the resource map.  This is a concurrency issue between the Property Provider API and the Server Side Hook API, where the thread executing the hook is not the same thread invoking the property provider.
ResolutionThis is a known scenario that is not supported due to this concurrency issue.  To access the Runtime API from a server side hook, create and maintain an external connection to the authorization server in the hook.
Legacy Article IDa37040