Class JWTRunner
- java.lang.Object
-
- org.oa4mp.delegation.server.jwt.JWTRunner
-
public class JWTRunner extends Object
This will create a JWT. The contract is generally that it has (multiple)PayloadHandler
s which process a given token. These are run at various times during execution based on the phase and flow states. For various historical reasons, the JWT is referred to as "claims" and it would take far too much tracking down in the code to change it.Created by Jeff Gaynor
on 2/15/20 at 7:38 AM
-
-
Constructor Summary
Constructors Constructor Description JWTRunner(OIDCServiceTransactionInterface transaction, edu.uiuc.ncsa.security.util.scripting.ScriptRuntimeEngine scriptRuntimeEngine)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addHandler(PayloadHandler handler)
void
doAuthClaims()
void
doRefreshClaims()
protected void
doScript(String phase)
void
doTokenClaims()
protected void
doTokenClaims(boolean isRefresh)
void
doTokenExchange()
void
doUserInfo()
AccessTokenHandlerInterface
getAccessTokenHandler()
protected void
getFromSources(FlowStates flowStates, String execPhase, boolean checkAuthClaims)
Deprecated.This should go away at some point since it has to loop over handler and basically ignores how the system works.IDTokenHandlerInterface
getIdTokenHandlerInterface()
RefreshTokenHandlerInterface
getRefreshTokenHandler()
edu.uiuc.ncsa.security.util.scripting.ScriptRuntimeEngine
getScriptRuntimeEngine()
protected void
handleSREResponse(OIDCServiceTransactionInterface transaction, edu.uiuc.ncsa.security.util.scripting.ScriptRunResponse scriptRunResponse)
Process the script, but the claim sources are not updated because we are not interested in the claim sources, e.g.boolean
hasATHandler()
boolean
hasIDTokenHandler()
boolean
hasRTHandler()
void
initializeHandlers()
protected void
newDoScript(String phase)
protected edu.uiuc.ncsa.security.util.scripting.ScriptRunRequest
newSRR(OIDCServiceTransactionInterface transaction, String phase)
creates newScriptRunRequest
with the basic information from the transaction.void
setAccessTokenHandler(AccessTokenHandlerInterface accessTokenHandler)
void
setIdTokenHandlerInterface(IDTokenHandlerInterface idTokenHandlerInterface)
void
setRefreshTokenHandler(RefreshTokenHandlerInterface refreshTokenHandler)
-
-
-
Constructor Detail
-
JWTRunner
public JWTRunner(OIDCServiceTransactionInterface transaction, edu.uiuc.ncsa.security.util.scripting.ScriptRuntimeEngine scriptRuntimeEngine)
-
-
Method Detail
-
getAccessTokenHandler
public AccessTokenHandlerInterface getAccessTokenHandler()
-
setAccessTokenHandler
public void setAccessTokenHandler(AccessTokenHandlerInterface accessTokenHandler)
-
getIdTokenHandlerInterface
public IDTokenHandlerInterface getIdTokenHandlerInterface()
-
setIdTokenHandlerInterface
public void setIdTokenHandlerInterface(IDTokenHandlerInterface idTokenHandlerInterface)
-
hasIDTokenHandler
public boolean hasIDTokenHandler()
-
hasATHandler
public boolean hasATHandler()
-
setRefreshTokenHandler
public void setRefreshTokenHandler(RefreshTokenHandlerInterface refreshTokenHandler)
-
getRefreshTokenHandler
public RefreshTokenHandlerInterface getRefreshTokenHandler()
-
hasRTHandler
public boolean hasRTHandler()
-
addHandler
public void addHandler(PayloadHandler handler)
-
getFromSources
protected void getFromSources(FlowStates flowStates, String execPhase, boolean checkAuthClaims) throws Throwable
Deprecated.This should go away at some point since it has to loop over handler and basically ignores how the system works.Get the claims sources for the ID token. This is needed only if the handler will attempt to get claims at some point.- Parameters:
flowStates
-checkAuthClaims
-- Throws:
Throwable
-
getScriptRuntimeEngine
public edu.uiuc.ncsa.security.util.scripting.ScriptRuntimeEngine getScriptRuntimeEngine()
-
newSRR
protected edu.uiuc.ncsa.security.util.scripting.ScriptRunRequest newSRR(OIDCServiceTransactionInterface transaction, String phase)
creates newScriptRunRequest
with the basic information from the transaction. Anything specific to the handler needs to be added in thePayloadHandler.addRequestState(ScriptRunRequest)
. This sends along the current claims, scopes flow states and claim sources then harvests them in toto from the response.- Returns:
-
handleSREResponse
protected void handleSREResponse(OIDCServiceTransactionInterface transaction, edu.uiuc.ncsa.security.util.scripting.ScriptRunResponse scriptRunResponse) throws IOException
Process the script, but the claim sources are not updated because we are not interested in the claim sources, e.g. if this is called after all claims sources have been processed and the script just massages the claims or flow states.- Parameters:
scriptRunResponse
-- Throws:
IOException
-
-