Class AbstractPayloadHandler

    • Field Detail

      • oa2se

        protected OA2SE oa2se
      • claims

        protected net.sf.json.JSONObject claims
      • request

        protected javax.servlet.http.HttpServletRequest request
    • Constructor Detail

      • AbstractPayloadHandler

        public AbstractPayloadHandler​(PayloadHandlerConfigImpl payloadHandlerConfig)
        Create the instance for the authorization phase, while there is an HttpServletRequest with possible headers that need to be processed.
        Parameters:
        payloadHandlerConfig -
    • Method Detail

      • getClaims

        public net.sf.json.JSONObject getClaims()
        Description copied from interface: PayloadHandler
        Get the claims (the actual payload).
        Specified by:
        getClaims in interface PayloadHandler
        Returns:
      • setClaims

        public void setClaims​(net.sf.json.JSONObject claims)
      • setExtendedAttributes

        public void setExtendedAttributes​(net.sf.json.JSONObject extendedAttributes)
      • isEmpty

        protected boolean isEmpty​(String x)
      • execute

        public net.sf.json.JSONObject execute​(ClaimSource source,
                                              net.sf.json.JSONObject claims)
                                       throws Throwable
        Description copied from interface: PayloadHandler
        Runs this specific claim source against the internal state of this class. Note that the contract is that it returns the updated claims and if there are no new claims, it should just return its claims argument.
        Specified by:
        execute in interface PayloadHandler
        Returns:
        Throws:
        Throwable
      • refresh

        public void refresh()
                     throws Throwable
        Description copied from interface: PayloadHandler
        If the claims need to be updated (e.g. for a refresh and the timestamps need adjusting) this method needs to be called. It's contract is to reget all of the claims.
        Specified by:
        refresh in interface PayloadHandler
        Throws:
        Throwable
      • getToken

        public String getToken​(edu.uiuc.ncsa.security.util.jwk.JSONWebKey key)
        Description copied from interface: PayloadHandler
        Returns the payload from this handler encoded with a key, if applicable.
        Specified by:
        getToken in interface PayloadHandler
        Returns:
      • handleResponse

        public void handleResponse​(edu.uiuc.ncsa.security.util.scripting.ScriptRunResponse resp)
                            throws Throwable
        Description copied from interface: PayloadHandler
        This takes the response from a script and unmarshalls the resources
        Specified by:
        handleResponse in interface PayloadHandler
        Throws:
        Throwable
      • listToString

        protected String listToString​(List list)
        A utility to take a list and convert it to a blank delimited string. This is returned by any number of handlers. Note that objects
        Parameters:
        list -
        Returns:
      • doServerVariables

        protected void doServerVariables​(net.sf.json.JSONObject targetClaims)
        Used by access tokens and refresh tokens. This allows for certain substitutions for various server variables.
        Parameters:
        targetClaims -
      • doSubstitution

        protected void doSubstitution​(String key,
                                      net.sf.json.JSONObject targetClaims,
                                      net.sf.json.JSONObject x)
        Do template substitutions for subject, audience, resource and issuer.
        Parameters:
        key -
        targetClaims -
        x -