Class TokenManagerServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- edu.uiuc.ncsa.security.servlet.AbstractServlet
-
- org.oa4mp.server.api.servlet.storage.EnvServlet
-
- org.oa4mp.server.api.servlet.storage.MyProxyDelegationServlet
-
- org.oa4mp.server.loader.oauth2.servlet.BearerTokenServlet
-
- org.oa4mp.server.loader.oauth2.servlet.TokenManagerServlet
-
- All Implemented Interfaces:
TransactionFilter
,RFC7662Constants
,edu.uiuc.ncsa.security.core.Logable
,Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
- Direct Known Subclasses:
ActiveTokenServlet
,RFC7009
,RFC7662
public abstract class TokenManagerServlet extends BearerTokenServlet implements RFC7662Constants
Superclass forRFC7009
andRFC7662
plus perhaps any others.Created by Jeff Gaynor
on 2/17/20 at 2:21 PM- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TokenManagerServlet.State
-
Field Summary
-
Fields inherited from class edu.uiuc.ncsa.myproxy.oa4mp.server.servlet.MyProxyDelegationServlet
caThread, kpt, lastAccessedThread, myproxyConnectionCache, myproxyConnectionCleanup, transactionCleanup
-
Fields inherited from class edu.uiuc.ncsa.myproxy.oa4mp.server.servlet.EnvServlet
ERROR_NOTIFICATION_BODY_KEY, ERROR_NOTIFICATION_SUBJECT_KEY, notificationListeners, storeUpdatesDone
-
Fields inherited from class edu.uiuc.ncsa.security.servlet.AbstractServlet
environment, initialization, PING_PARAMETER
-
Fields inherited from interface edu.uiuc.ncsa.oa4mp.delegation.oa2.server.RFC7662Constants
ACTIVE, TOKEN, TOKEN_TYPE, TOKEN_TYPE_HINT, TYPE_ACCESS_TOKEN, TYPE_REFRESH_TOKEN, USERNAME
-
-
Constructor Summary
Constructors Constructor Description TokenManagerServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TokenManagerServlet.State
checkBasic(javax.servlet.http.HttpServletRequest req)
This will process a request with basic authorization, peel off the supplied token and resolve it.protected TokenManagerServlet.State
checkBearer(javax.servlet.http.HttpServletRequest req)
Checks the case that the request uses a bearer token.void
doGet(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
protected int
getTokenType(String token)
protected OA2ServiceTransaction
getTransFromToken(String token)
ServiceTransaction
verifyAndGet(IssuerResponse iResponse)
This is called after the response is received so that the system can get the approproate transaction.protected OA2Client
verifyClient(javax.servlet.http.HttpServletRequest req, String headerAuthz)
Used if the request has basic auth.protected void
writeOK(javax.servlet.http.HttpServletResponse httpServletResponse, net.sf.json.JSONObject resp)
-
Methods inherited from class edu.uiuc.ncsa.myproxy.oa4mp.oauth2.servlet.BearerTokenServlet
findTransaction
-
Methods inherited from class edu.uiuc.ncsa.myproxy.oa4mp.server.servlet.MyProxyDelegationServlet
checkClientApproval, createDebugger, destroy, getAGI, getATI, getClient, getClient, getClient, getFirstParameters, getGrantIDFromRequest, getMPConnection, getMPConnection, getMyproxyConnectionCache, getMyproxyServices, getServiceEnvironment, getTransaction, getTransactionByGrantID, getTransactionStore, hasMPConnection, hasMPConnection, isEmpty, loadProperties2, newTransaction, postprocess, preprocess, realStoreUpdates, say, shutdownCleanup, storeUpdates
-
Methods inherited from class edu.uiuc.ncsa.myproxy.oa4mp.server.servlet.EnvServlet
addNotificationListener, loadEnvironment, processStoreCheck, removeNotificationListener
-
Methods inherited from class edu.uiuc.ncsa.security.servlet.AbstractServlet
checkContentType, CONST, debug, doIt, doPing, doPost, error, error, getConfigurationLoader, getEnvironment, getExceptionHandler, getFirstParameterValue, getInitialization, getMyLogger, handleException, info, init, isDebugOn, printAllParameters, printAllParameters, resetState, setConfigurationLoader, setDebugOn, setEnvironment, setExceptionHandler, setInitialization, warn
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
Method Detail
-
verifyClient
protected OA2Client verifyClient(javax.servlet.http.HttpServletRequest req, String headerAuthz) throws UnsupportedEncodingException
Used if the request has basic auth.- Parameters:
req
-headerAuthz
-- Returns:
- Throws:
UnsupportedEncodingException
-
checkBasic
protected TokenManagerServlet.State checkBasic(javax.servlet.http.HttpServletRequest req) throws Throwable
This will process a request with basic authorization, peel off the supplied token and resolve it. It will then find the transaction or token exchange (TX) record for the given token.- Parameters:
req
-- Returns:
- Throws:
Throwable
-
checkBearer
protected TokenManagerServlet.State checkBearer(javax.servlet.http.HttpServletRequest req) throws Throwable
Checks the case that the request uses a bearer token. Same contract ascheckBasic(HttpServletRequest)
- Parameters:
req
-- Returns:
- Throws:
Throwable
-
verifyAndGet
public ServiceTransaction verifyAndGet(IssuerResponse iResponse) throws IOException
Description copied from class:MyProxyDelegationServlet
This is called after the response is received so that the system can get the approproate transaction. Checks for the validity of the transaction should be done here too.- Specified by:
verifyAndGet
in classMyProxyDelegationServlet
- Returns:
- Throws:
IOException
-
doGet
public void doGet(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws javax.servlet.ServletException, IOException
- Overrides:
doGet
in classedu.uiuc.ncsa.security.servlet.AbstractServlet
- Throws:
javax.servlet.ServletException
IOException
-
getTokenType
protected int getTokenType(String token)
-
writeOK
protected void writeOK(javax.servlet.http.HttpServletResponse httpServletResponse, net.sf.json.JSONObject resp) throws IOException
- Throws:
IOException
-
getTransFromToken
protected OA2ServiceTransaction getTransFromToken(String token)
-
-