Class AbstractPayloadHandler
- java.lang.Object
-
- org.oa4mp.server.loader.oauth2.claims.AbstractPayloadHandler
-
- All Implemented Interfaces:
Serializable,org.oa4mp.delegation.server.jwt.PayloadHandler,org.oa4mp.delegation.server.OA2Scopes
- Direct Known Subclasses:
AbstractAccessTokenHandler,BasicRefreshTokenHandler,IDTokenHandler
public abstract class AbstractPayloadHandler extends Object implements org.oa4mp.delegation.server.jwt.PayloadHandler, org.oa4mp.delegation.server.OA2Scopes
Created by Jeff Gaynor
on 4/21/20 at 5:00 PM- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected OA2Clientclientprotected OA2SEoa2seprotected net.sf.json.JSONObjectpayloadprotected javax.servlet.http.HttpServletRequestrequestprotected OA2ServiceTransactiontransaction
-
Constructor Summary
Constructors Constructor Description AbstractPayloadHandler(PayloadHandlerConfigImpl payloadHandlerConfig)Create the instance for the authorization phase, while there is anHttpServletRequestwith possible headers that need to be processed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoServerVariables(net.sf.json.JSONObject targetClaims, net.sf.json.JSONObject userMetaData)Used by access tokens and refresh tokens.protected voiddoSubstitution(String key, net.sf.json.JSONObject targetClaims, net.sf.json.JSONObject x)Do template substitutions for subject, audience, resource and issuer.net.sf.json.JSONObjectexecute(org.oa4mp.delegation.server.server.claims.ClaimSource source, net.sf.json.JSONObject claims)net.sf.json.JSONObjectgetExtendedAttributes()Gets the extended attributes from the current transaction.PayloadHandlerConfigImplgetPhCfg()intgetResponseCode()TXRecordgetTXRecord()voidhandleResponse(edu.uiuc.ncsa.security.util.scripting.ScriptRunResponse resp)booleanhasScript()booleanhasTXRecord()protected booleanisEmpty(String x)protected StringlistToString(List list)A utility to take a list and convert it to a blank delimited string.voidrefresh()voidsaveState(String execPhase)voidsetExtendedAttributes(net.sf.json.JSONObject extendedAttributes)voidsetPayload(net.sf.json.JSONObject payload)voidsetPhCfg(org.oa4mp.delegation.server.jwt.PayloadHandlerConfig phCfg)voidsetResponseCode(int responseCode)
-
-
-
Field Detail
-
transaction
protected OA2ServiceTransaction transaction
-
oa2se
protected OA2SE oa2se
-
request
protected javax.servlet.http.HttpServletRequest request
-
client
protected OA2Client client
-
payload
protected net.sf.json.JSONObject payload
-
-
Constructor Detail
-
AbstractPayloadHandler
public AbstractPayloadHandler(PayloadHandlerConfigImpl payloadHandlerConfig)
Create the instance for the authorization phase, while there is anHttpServletRequestwith possible headers that need to be processed.- Parameters:
payloadHandlerConfig-
-
-
Method Detail
-
getPhCfg
public PayloadHandlerConfigImpl getPhCfg()
- Specified by:
getPhCfgin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
hasTXRecord
public boolean hasTXRecord()
-
getTXRecord
public TXRecord getTXRecord()
-
setExtendedAttributes
public void setExtendedAttributes(net.sf.json.JSONObject extendedAttributes)
-
getExtendedAttributes
public net.sf.json.JSONObject getExtendedAttributes()
Gets the extended attributes from the current transaction. SeeOA2ServiceTransaction.getExtendedAttributes()for more.- Specified by:
getExtendedAttributesin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Returns:
-
isEmpty
protected boolean isEmpty(String x)
-
execute
public net.sf.json.JSONObject execute(org.oa4mp.delegation.server.server.claims.ClaimSource source, net.sf.json.JSONObject claims) throws Throwable- Specified by:
executein interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Throws:
Throwable
-
refresh
public void refresh() throws Throwable- Specified by:
refreshin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Throws:
Throwable
-
setPhCfg
public void setPhCfg(org.oa4mp.delegation.server.jwt.PayloadHandlerConfig phCfg)
- Specified by:
setPhCfgin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
setResponseCode
public void setResponseCode(int responseCode)
- Specified by:
setResponseCodein interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
getResponseCode
public int getResponseCode()
- Specified by:
getResponseCodein interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
handleResponse
public void handleResponse(edu.uiuc.ncsa.security.util.scripting.ScriptRunResponse resp) throws Throwable- Specified by:
handleResponsein interfaceorg.oa4mp.delegation.server.jwt.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:
-
hasScript
public boolean hasScript()
- Specified by:
hasScriptin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
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
- Specified by:
saveStatein interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Throws:
Throwable
-
setPayload
public void setPayload(net.sf.json.JSONObject payload)
- Specified by:
setPayloadin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
-