Class AbstractAuthorizationServlet
- 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.api.servlet.storage.CRServlet
-
- org.oa4mp.server.api.servlet.storage.AbstractAuthorizationServlet
-
- All Implemented Interfaces:
TransactionFilter
,edu.uiuc.ncsa.security.core.Logable
,edu.uiuc.ncsa.security.servlet.Presentable
,Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
- Direct Known Subclasses:
AbstractVerifierServlet
,OA2AuthorizationServer
public abstract class AbstractAuthorizationServlet extends CRServlet implements edu.uiuc.ncsa.security.servlet.Presentable
Created by Jeff Gaynor
on 1/14/14 at 11:50 AM- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractAuthorizationServlet.AuthorizedState
State object after authorization has worked.static class
AbstractAuthorizationServlet.MyHttpServletResponseWrapper
This class is needed to pass information between servlets, where one servlet calls another.static class
AbstractAuthorizationServlet.MyMyProxyLogon
static class
AbstractAuthorizationServlet.UserLoginException
-
Field Summary
Fields Modifier and Type Field Description static String
AUTHORIZATION_ACTION_KEY
static int
AUTHORIZATION_ACTION_OK
static String
AUTHORIZATION_ACTION_OK_VALUE
static int
AUTHORIZATION_ACTION_START
static String
AUTHORIZATION_PASSWORD_KEY
static String
AUTHORIZATION_USER_NAME_KEY
static String
AUTHORIZATION_USER_NAME_VALUE
static String
ERROR_PAGE
static String
INITIAL_PAGE
static String
OK_PAGE
static String
REMOTE_USER_INITIAL_PAGE
static String
RETRY_MESSAGE
-
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
-
-
Constructor Summary
Constructors Constructor Description AbstractAuthorizationServlet()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
checkUser(String username, String password)
abstract String
createCallback(ServiceTransaction transaction, Map<String,String> params)
This will take whatever the passed in callback from the client is and append any parameters needed.protected void
createRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ServiceTransaction trans)
protected void
doIt(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected void
doProxy(AbstractAuthorizationServlet.AuthorizedState state)
protected ServiceTransaction
getAndCheckTransaction(String token)
protected String
getInitialPage()
protected String
getOkPage()
protected String
getParam(javax.servlet.http.HttpServletRequest request, String key)
protected String
getRemoteUserInitialPage()
static int
getState(javax.servlet.http.HttpServletRequest request)
void
handleError(edu.uiuc.ncsa.security.servlet.PresentableState state, Throwable t)
void
prepare(edu.uiuc.ncsa.security.servlet.PresentableState state)
void
present(edu.uiuc.ncsa.security.servlet.PresentableState state)
protected void
setClientRequestAttributes(AbstractAuthorizationServlet.AuthorizedState aState)
protected abstract void
setupMPConnection(ServiceTransaction trans, String username, String password)
ServiceTransaction
verifyAndGet(IssuerResponse iResponse)
This is called after the response is received so that the system can get the approproate transaction.-
Methods inherited from class edu.uiuc.ncsa.myproxy.oa4mp.server.servlet.CRServlet
createMPConnection, createMPConnection, doCertRequest, doRealCertRequest, getAccessToken, getX509Certificates
-
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, doGet, 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
-
-
-
-
Field Detail
-
AUTHORIZATION_ACTION_KEY
public static final String AUTHORIZATION_ACTION_KEY
- See Also:
- Constant Field Values
-
AUTHORIZATION_USER_NAME_KEY
public static final String AUTHORIZATION_USER_NAME_KEY
- See Also:
- Constant Field Values
-
AUTHORIZATION_USER_NAME_VALUE
public static final String AUTHORIZATION_USER_NAME_VALUE
- See Also:
- Constant Field Values
-
AUTHORIZATION_PASSWORD_KEY
public static final String AUTHORIZATION_PASSWORD_KEY
- See Also:
- Constant Field Values
-
AUTHORIZATION_ACTION_OK_VALUE
public static final String AUTHORIZATION_ACTION_OK_VALUE
- See Also:
- Constant Field Values
-
AUTHORIZATION_ACTION_OK
public static final int AUTHORIZATION_ACTION_OK
- See Also:
- Constant Field Values
-
AUTHORIZATION_ACTION_START
public static final int AUTHORIZATION_ACTION_START
- See Also:
- Constant Field Values
-
RETRY_MESSAGE
public static final String RETRY_MESSAGE
- See Also:
- Constant Field Values
-
INITIAL_PAGE
public static String INITIAL_PAGE
-
REMOTE_USER_INITIAL_PAGE
public static String REMOTE_USER_INITIAL_PAGE
-
OK_PAGE
public static String OK_PAGE
-
ERROR_PAGE
public static String ERROR_PAGE
-
-
Method Detail
-
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
-
createCallback
public abstract String createCallback(ServiceTransaction transaction, Map<String,String> params)
This will take whatever the passed in callback from the client is and append any parameters needed. Generally these parameters are protocol specific.- Parameters:
transaction
-- Returns:
-
prepare
public void prepare(edu.uiuc.ncsa.security.servlet.PresentableState state) throws Throwable
- Specified by:
prepare
in interfaceedu.uiuc.ncsa.security.servlet.Presentable
- Throws:
Throwable
-
setClientRequestAttributes
protected void setClientRequestAttributes(AbstractAuthorizationServlet.AuthorizedState aState)
-
getInitialPage
protected String getInitialPage()
-
getRemoteUserInitialPage
protected String getRemoteUserInitialPage()
-
getOkPage
protected String getOkPage()
-
doProxy
protected void doProxy(AbstractAuthorizationServlet.AuthorizedState state) throws Throwable
- Throws:
Throwable
-
present
public void present(edu.uiuc.ncsa.security.servlet.PresentableState state) throws Throwable
- Specified by:
present
in interfaceedu.uiuc.ncsa.security.servlet.Presentable
- Throws:
Throwable
-
handleError
public void handleError(edu.uiuc.ncsa.security.servlet.PresentableState state, Throwable t) throws IOException, javax.servlet.ServletException
- Specified by:
handleError
in interfaceedu.uiuc.ncsa.security.servlet.Presentable
- Throws:
IOException
javax.servlet.ServletException
-
doIt
protected void doIt(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Throwable
- Specified by:
doIt
in classedu.uiuc.ncsa.security.servlet.AbstractServlet
- Throws:
Throwable
-
getState
public static int getState(javax.servlet.http.HttpServletRequest request)
-
getAndCheckTransaction
protected ServiceTransaction getAndCheckTransaction(String token) throws IOException
- Throws:
IOException
-
createRedirect
protected void createRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ServiceTransaction trans) throws Throwable
- Throws:
Throwable
-
checkUser
public void checkUser(String username, String password) throws GeneralSecurityException
- Throws:
GeneralSecurityException
-
setupMPConnection
protected abstract void setupMPConnection(ServiceTransaction trans, String username, String password) throws GeneralSecurityException
- Throws:
GeneralSecurityException
-
-