Class AbstractPayloadHandler

    • Field Detail

      • oa2se

        protected OA2SE oa2se
      • request

        protected javax.servlet.http.HttpServletRequest request
      • payload

        protected net.sf.json.JSONObject payload
    • 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

      • hasTXRecord

        public boolean hasTXRecord()
      • getTXRecord

        public TXRecord getTXRecord()
      • 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
      • 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,
                                         net.sf.json.JSONObject userMetaData)
        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 -
      • saveState

        public void saveState​(String execPhase)
                       throws Throwable
        Description copied from interface: PayloadHandler
        Called at the end of each block, this lets the handler save its state. Note that for OA4MP, the state is saved in the transaction which is saved once after the handlers run. Only put actual save code in here if needed, since it is apt to get called a lot.
        Specified by:
        saveState in interface PayloadHandler
        Throws:
        Throwable
      • setPayload

        public void setPayload​(net.sf.json.JSONObject payload)
        Specified by:
        setPayload in interface PayloadHandler