Class AbstractAccessTokenHandler
- java.lang.Object
-
- org.oa4mp.server.loader.oauth2.claims.AbstractPayloadHandler
-
- org.oa4mp.server.loader.oauth2.claims.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
-
-
Field Summary
Fields Modifier and Type Field Description static StringAT_BASIC_HANDLER_TYPEstatic StringAT_DEFAULT_HANDLER_TYPE-
Fields inherited from class org.oa4mp.server.loader.oauth2.claims.AbstractPayloadHandler
client, oa2se, payload, request, transaction
-
-
Constructor Summary
Constructors Constructor Description AbstractAccessTokenHandler(PayloadHandlerConfigImpl payloadHandlerConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRequestState(edu.uiuc.ncsa.security.util.scripting.ScriptRunRequest req)voidcheckClaims()voidfinish(boolean doTemplates, boolean isQuery)voidfinish(String execPhase)AccessTokengetAccessToken()protected AccessTokenConfiggetATConfig()Convenience to peel off theAccessTokenConfigfrom the handler config and return it.net.sf.json.JSONObjectgetPayload()The underlyingJSONObjectthat contains the claims that go in to this access token.AccessTokenImplgetSignedPayload(edu.uiuc.ncsa.security.util.jwk.JSONWebKey key)AccessTokenImplgetSignedPayload(edu.uiuc.ncsa.security.util.jwk.JSONWebKey key, String headerType)List<org.oa4mp.delegation.server.server.claims.ClaimSource>getSources()net.sf.json.JSONObjectgetUserMetaData()generally for this class you will need to inject the user meta data.voidhandleResponse(edu.uiuc.ncsa.security.util.scripting.ScriptRunResponse resp)voidinit()voidrefreshAccountingInformation()StringresolveTemplates(boolean isQuery)Templates are of the formatvoidsaveState(String execPhase)voidsetAccessToken(AccessToken accessToken)voidsetAccountingInformation()voidsetUserMetaData(net.sf.json.JSONObject userMetaData)-
Methods inherited from class org.oa4mp.server.loader.oauth2.claims.AbstractPayloadHandler
doServerVariables, doSubstitution, execute, getExtendedAttributes, getPhCfg, getResponseCode, getTXRecord, hasScript, hasTXRecord, isEmpty, listToString, refresh, setExtendedAttributes, setPayload, setPhCfg, setResponseCode
-
-
-
-
Field Detail
-
AT_DEFAULT_HANDLER_TYPE
public static final String AT_DEFAULT_HANDLER_TYPE
- See Also:
- Constant Field Values
-
AT_BASIC_HANDLER_TYPE
public static final String AT_BASIC_HANDLER_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractAccessTokenHandler
public AbstractAccessTokenHandler(PayloadHandlerConfigImpl payloadHandlerConfig)
-
-
Method Detail
-
getPayload
public net.sf.json.JSONObject getPayload()
The underlyingJSONObjectthat contains the claims that go in to this access token. Note that thegetUserMetaData()call will retrieve the user metadata and is not the same as the access token contents!- Specified by:
getPayloadin interfaceorg.oa4mp.delegation.server.jwt.AccessTokenHandlerInterface- Specified by:
getPayloadin interfaceorg.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:
getUserMetaDatain interfaceorg.oa4mp.delegation.server.jwt.AccessTokenHandlerInterface- Specified by:
getUserMetaDatain interfaceorg.oa4mp.delegation.server.jwt.IDTokenHandlerInterface- Returns:
-
setUserMetaData
public void setUserMetaData(net.sf.json.JSONObject userMetaData)
- Specified by:
setUserMetaDatain interfaceorg.oa4mp.delegation.server.jwt.IDTokenHandlerInterface
-
init
public void init() throws Throwable- Specified by:
initin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Throws:
Throwable
-
addRequestState
public void addRequestState(edu.uiuc.ncsa.security.util.scripting.ScriptRunRequest req) throws Throwable- Specified by:
addRequestStatein interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Throws:
Throwable
-
handleResponse
public void handleResponse(edu.uiuc.ncsa.security.util.scripting.ScriptRunResponse resp) throws Throwable- Specified by:
handleResponsein interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Overrides:
handleResponsein classAbstractPayloadHandler- Throws:
Throwable
-
checkClaims
public void checkClaims() throws Throwable- Specified by:
checkClaimsin interfaceorg.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},...}] ]
-
getATConfig
protected AccessTokenConfig getATConfig()
Convenience to peel off theAccessTokenConfigfrom the handler config and return it.- Returns:
-
getSources
public List<org.oa4mp.delegation.server.server.claims.ClaimSource> getSources() throws Throwable
- Specified by:
getSourcesin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Throws:
Throwable
-
finish
public void finish(String execPhase) throws Throwable
- Specified by:
finishin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Throws:
Throwable
-
getSignedPayload
public AccessTokenImpl getSignedPayload(edu.uiuc.ncsa.security.util.jwk.JSONWebKey key)
- Specified by:
getSignedPayloadin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
getSignedPayload
public AccessTokenImpl getSignedPayload(edu.uiuc.ncsa.security.util.jwk.JSONWebKey key, String headerType)
- Specified by:
getSignedPayloadin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
saveState
public void saveState(String execPhase) throws Throwable
- Specified by:
saveStatein interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Overrides:
saveStatein classAbstractPayloadHandler- Throws:
Throwable
-
setAccountingInformation
public void setAccountingInformation()
- Specified by:
setAccountingInformationin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
refreshAccountingInformation
public void refreshAccountingInformation()
- Specified by:
refreshAccountingInformationin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
getAccessToken
public AccessToken getAccessToken()
- Specified by:
getAccessTokenin interfaceorg.oa4mp.delegation.server.jwt.AccessTokenHandlerInterface
-
setAccessToken
public void setAccessToken(AccessToken accessToken)
- Specified by:
setAccessTokenin interfaceorg.oa4mp.delegation.server.jwt.AccessTokenHandlerInterface
-
-