Class AbstractAccessTokenHandler

  • All Implemented Interfaces:
    Serializable, org.oa4mp.delegation.server.jwt.AccessTokenHandlerInterface, org.oa4mp.delegation.server.jwt.IDTokenHandlerInterface, org.oa4mp.delegation.server.jwt.PayloadHandler, org.oa4mp.delegation.server.OA2Scopes
    Direct Known Subclasses:
    DefaultAccessTokenHandler, RFC9068ATHandler, ScitokenHandler, WLCGTokenHandler

    public class AbstractAccessTokenHandler
    extends AbstractPayloadHandler
    implements org.oa4mp.delegation.server.jwt.AccessTokenHandlerInterface, org.oa4mp.delegation.server.jwt.IDTokenHandlerInterface
    Only create an access token handler if you need some special handling, otherwise the default simple token will be used.

    Created by Jeff Gaynor
    on 7/21/20 at 2:50 PM

    See Also:
    Serialized Form
    • Constructor Detail

    • Method Detail

      • getPayload

        public net.sf.json.JSONObject getPayload()
        The underlying JSONObject that contains the claims that go in to this access token. Note that the getUserMetaData() call will retrieve the user metadata and is not the same as the access token contents!
        Specified by:
        getPayload in interface org.oa4mp.delegation.server.jwt.AccessTokenHandlerInterface
        Specified by:
        getPayload in interface org.oa4mp.delegation.server.jwt.PayloadHandler
        Returns:
      • getUserMetaData

        public net.sf.json.JSONObject getUserMetaData()
        generally for this class you will need to inject the user meta data.
        Specified by:
        getUserMetaData in interface org.oa4mp.delegation.server.jwt.AccessTokenHandlerInterface
        Specified by:
        getUserMetaData in interface org.oa4mp.delegation.server.jwt.IDTokenHandlerInterface
        Returns:
      • setUserMetaData

        public void setUserMetaData​(net.sf.json.JSONObject userMetaData)
        Specified by:
        setUserMetaData in interface org.oa4mp.delegation.server.jwt.IDTokenHandlerInterface
      • init

        public void init()
                  throws Throwable
        Specified by:
        init in interface org.oa4mp.delegation.server.jwt.PayloadHandler
        Throws:
        Throwable
      • addRequestState

        public void addRequestState​(edu.uiuc.ncsa.security.util.scripting.ScriptRunRequest req)
                             throws Throwable
        Specified by:
        addRequestState in interface org.oa4mp.delegation.server.jwt.PayloadHandler
        Throws:
        Throwable
      • handleResponse

        public void handleResponse​(edu.uiuc.ncsa.security.util.scripting.ScriptRunResponse resp)
                            throws Throwable
        Specified by:
        handleResponse in interface org.oa4mp.delegation.server.jwt.PayloadHandler
        Overrides:
        handleResponse in class AbstractPayloadHandler
        Throws:
        Throwable
      • checkClaims

        public void checkClaims()
                         throws Throwable
        Specified by:
        checkClaims in interface org.oa4mp.delegation.server.jwt.PayloadHandler
        Throws:
        Throwable
      • resolveTemplates

        public String resolveTemplates​(boolean isQuery)
        Templates are of the format
             [{"aud":audience,
             [{"op":X0, "path":P0},
              {"op":X1, "path":P1},...}]
             ]
         
      • getSources

        public List<org.oa4mp.delegation.server.server.claims.ClaimSource> getSources()
                                                                               throws Throwable
        Specified by:
        getSources in interface org.oa4mp.delegation.server.jwt.PayloadHandler
        Throws:
        Throwable
      • finish

        public void finish​(boolean doTemplates,
                           boolean isQuery)
                    throws Throwable
        Throws:
        Throwable
      • finish

        public void finish​(String execPhase)
                    throws Throwable
        Specified by:
        finish in interface org.oa4mp.delegation.server.jwt.PayloadHandler
        Throws:
        Throwable
      • getSignedPayload

        public AccessTokenImpl getSignedPayload​(edu.uiuc.ncsa.security.util.jwk.JSONWebKey key)
        Specified by:
        getSignedPayload in interface org.oa4mp.delegation.server.jwt.PayloadHandler
      • getSignedPayload

        public AccessTokenImpl getSignedPayload​(edu.uiuc.ncsa.security.util.jwk.JSONWebKey key,
                                                String headerType)
        Specified by:
        getSignedPayload in interface org.oa4mp.delegation.server.jwt.PayloadHandler
      • setAccountingInformation

        public void setAccountingInformation()
        Specified by:
        setAccountingInformation in interface org.oa4mp.delegation.server.jwt.PayloadHandler
      • refreshAccountingInformation

        public void refreshAccountingInformation()
        Specified by:
        refreshAccountingInformation in interface org.oa4mp.delegation.server.jwt.PayloadHandler
      • getAccessToken

        public AccessToken getAccessToken()
        Specified by:
        getAccessToken in interface org.oa4mp.delegation.server.jwt.AccessTokenHandlerInterface
      • setAccessToken

        public void setAccessToken​(AccessToken accessToken)
        Specified by:
        setAccessToken in interface org.oa4mp.delegation.server.jwt.AccessTokenHandlerInterface