Class CRServlet
- 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
-
- All Implemented Interfaces:
TransactionFilter
,edu.uiuc.ncsa.security.core.Logable
,Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
- Direct Known Subclasses:
AbstractAuthorizationServlet
,ACS2
,AuthorizedServlet
public abstract class CRServlet extends MyProxyDelegationServlet
This is the super class of the servlet that is supposed to retrieve a cert. This happens at different times in different protocols. This will retrieve the cert and assumes that there is anMyProxyConnectable
that has been found and is cached. This will close the connection at the end of the request. If the client should get a limited proxy, that will be done here as well.
Finally, if the DN from the cert is to be returned as the username in the final call to the service, that will be set here.Created by Jeff Gaynor
on 2/6/14 at 11:30 AM- See Also:
- Serialized Form
-
-
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
-
-
Constructor Summary
Constructors Constructor Description CRServlet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected MyProxyConnectable
createMPConnection(edu.uiuc.ncsa.security.core.Identifier identifier, String userName, String password, long lifetime)
Returns a working MyProxy connection or it fails.protected MyProxyConnectable
createMPConnection(edu.uiuc.ncsa.security.core.Identifier identifier, String userName, String password, long lifetime, String loa)
protected void
doCertRequest(ServiceTransaction trans, String statusString)
protected abstract void
doRealCertRequest(ServiceTransaction trans, String statusString)
Indirection call.protected abstract AccessToken
getAccessToken(javax.servlet.http.HttpServletRequest request)
There are various requirements for transmitting the access token, so specific methods have to be used.protected LinkedList<X509Certificate>
getX509Certificates(ServiceTransaction transaction, edu.uiuc.ncsa.security.util.crypto.MyPKCS10CertRequest localCertRequest, String statusString)
Loops through the facade looking for the active connection and calls it.-
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, verifyAndGet
-
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, 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
-
doRealCertRequest
protected abstract void doRealCertRequest(ServiceTransaction trans, String statusString) throws Throwable
Indirection call. If your extension to this class needs to do any prep work before callingdoCertRequest(edu.uiuc.ncsa.oa4mp.delegation.server.ServiceTransaction, String)
put it here. And this should contain the actual call to that method. This is called in the authorization leg and the getCert call. You should point this at thedoCertRequest(ServiceTransaction, String)
method here which does all the dirty work of tracking down the connection and getting the cert. So, depending on your protocol you will have only one of two places where this is fully implemented.- Throws:
Throwable
-
getAccessToken
protected abstract AccessToken getAccessToken(javax.servlet.http.HttpServletRequest request)
There are various requirements for transmitting the access token, so specific methods have to be used.- Parameters:
request
-- Returns:
-
doCertRequest
protected void doCertRequest(ServiceTransaction trans, String statusString) throws Throwable
- Throws:
Throwable
-
getX509Certificates
protected LinkedList<X509Certificate> getX509Certificates(ServiceTransaction transaction, edu.uiuc.ncsa.security.util.crypto.MyPKCS10CertRequest localCertRequest, String statusString)
Loops through the facade looking for the active connection and calls it.- Parameters:
transaction
-localCertRequest
-statusString
-- Returns:
-
createMPConnection
protected MyProxyConnectable createMPConnection(edu.uiuc.ncsa.security.core.Identifier identifier, String userName, String password, long lifetime) throws GeneralSecurityException
Returns a working MyProxy connection or it fails.- Parameters:
identifier
-userName
-password
-- Returns:
- Throws:
GeneralSecurityException
-
createMPConnection
protected MyProxyConnectable createMPConnection(edu.uiuc.ncsa.security.core.Identifier identifier, String userName, String password, long lifetime, String loa) throws GeneralSecurityException
- Throws:
GeneralSecurityException
-
-