public class CASCredentialProvider extends AbstractCredentialProvider implements NonBlockingCredentialProvider, BlockingCredentialProvider, Contextualizable
UsersManagerAuthentication
Modifier and Type | Field and Description |
---|---|
private static String |
__PARAM_ACCEPT_ANY_PROXY
Parameter name for "accept any proxy"
|
private static String |
__PARAM_AUTHORIZED_PROXY_CHAINS
Parameter name for authorized proxy chains
|
private static String |
__PARAM_GATEWAY_ENABLED
Parameter name for the gateway mode
|
private static String |
__PARAM_REQUEST_PROXY_TICKETS
Parameter name for "request proxy tickets"
|
private boolean |
_acceptAnyProxy
Should the application accept any proxy
|
private String |
_authorizedProxyChains
Authorized proxy chains, which is
a newline-delimited list of acceptable proxy chains.
|
private Context |
_context |
private boolean |
_gatewayModeEnabled
Should the cas gateway mode be used
|
private boolean |
_requestProxyTickets
Should the application request proxy tickets
|
protected String |
_serverUrl
Cas server URL with context (https://cas-server ou https://cas-server/cas)
|
static String |
PARAM_SERVER_URL
Parameter name for server url
|
Constructor and Description |
---|
CASCredentialProvider() |
Modifier and Type | Method and Description |
---|---|
protected String |
_getLogin(Request request)
Get the connected user login from the request or session.
|
private String |
_getLoginFromFilter(boolean gateway,
Redirector redirector) |
private String |
_getProxyCallbackRelativeUrl(Request request) |
private Integer |
_getRunningCpIndex(Request request) |
UserIdentity |
blockingGetUserIdentity(Redirector redirector)
Method called by AuthenticateAction each time a request need
authentication.
|
boolean |
blockingGrantAnonymousRequest()
Method called by AuthenticateAction before asking for credentials.
|
boolean |
blockingIsStillConnected(UserIdentity userIdentity,
Redirector redirector)
Validates that the user specify is still connected
|
void |
blockingUserAllowed(UserIdentity userIdentity)
Method called by AuthenticateAction after authentication process succeeded
|
void |
blockingUserNotAllowed(Redirector redirector)
Method called by AuthenticateAction each a user could not get
authenticated.
|
void |
contextualize(Context context) |
void |
init(String id,
String cpModelId,
Map<String,Object> paramValues,
String label)
Initialize the credential provider with given parameters' values.
|
UserIdentity |
nonBlockingGetUserIdentity(Redirector redirector)
Method called by AuthenticateAction each time a request need
authentication.
|
boolean |
nonBlockingGrantAnonymousRequest()
Method called by AuthenticateAction before asking for credentials.
|
boolean |
nonBlockingIsStillConnected(UserIdentity userIdentity,
Redirector redirector)
Validates that the user specify is still connected
|
void |
nonBlockingUserAllowed(UserIdentity userIdentity)
Method called by AuthenticateAction after authentication process succeeded
|
void |
nonBlockingUserNotAllowed(Redirector redirector)
Method called by AuthenticateAction each a user could not get
authenticated.
|
boolean |
requiresNewWindow()
Does this blocking credential provider requires a new window to process.
|
equals, getCredentialProviderModelId, getId, getLabel, getParameterValues, hashCode
getLogger, setLogger
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getCredentialProviderModelId, getId, getLabel, getParameterValues, getUserIdentity, grantAnonymousRequest, isStillConnected, userAllowed, userNotAllowed
public static final String PARAM_SERVER_URL
private static final String __PARAM_REQUEST_PROXY_TICKETS
private static final String __PARAM_ACCEPT_ANY_PROXY
private static final String __PARAM_AUTHORIZED_PROXY_CHAINS
private static final String __PARAM_GATEWAY_ENABLED
protected String _serverUrl
private boolean _requestProxyTickets
private boolean _acceptAnyProxy
private String _authorizedProxyChains
private boolean _gatewayModeEnabled
public CASCredentialProvider()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void init(String id, String cpModelId, Map<String,Object> paramValues, String label)
CredentialProvider
init
in interface CredentialProvider
init
in class AbstractCredentialProvider
id
- The unique identifiercpModelId
- The id of credential provider extension pointparamValues
- The parameters' valueslabel
- The specific label of this instance. Can be nullpublic boolean blockingIsStillConnected(UserIdentity userIdentity, Redirector redirector) throws Exception
BlockingCredentialProvider
blockingIsStillConnected
in interface BlockingCredentialProvider
userIdentity
- the user previously correctly identified with this credential providerredirector
- The cocoon redirectorException
- If an error occurredpublic boolean nonBlockingIsStillConnected(UserIdentity userIdentity, Redirector redirector) throws Exception
NonBlockingCredentialProvider
nonBlockingIsStillConnected
in interface NonBlockingCredentialProvider
userIdentity
- the user previously correctly identified with this credential providerredirector
- The cocoon redirectorException
- If an error occurredprivate String _getLoginFromFilter(boolean gateway, Redirector redirector) throws Exception
Exception
private String _getProxyCallbackRelativeUrl(Request request)
private Integer _getRunningCpIndex(Request request)
public boolean blockingGrantAnonymousRequest()
BlockingCredentialProvider
blockingGrantAnonymousRequest
in interface BlockingCredentialProvider
public boolean nonBlockingGrantAnonymousRequest()
NonBlockingCredentialProvider
nonBlockingGrantAnonymousRequest
in interface NonBlockingCredentialProvider
public UserIdentity blockingGetUserIdentity(Redirector redirector) throws Exception
BlockingCredentialProvider
blockingGetUserIdentity
in interface BlockingCredentialProvider
redirector
- the cocoon redirector.UserIdentity
corresponding to the user (with or without population specified), or null if user could not get authenticated.Exception
- if something wrong occurspublic UserIdentity nonBlockingGetUserIdentity(Redirector redirector) throws Exception
NonBlockingCredentialProvider
nonBlockingGetUserIdentity
in interface NonBlockingCredentialProvider
redirector
- the cocoon redirector.UserIdentity
corresponding to the user (with or without population specified), or null if user could not get authenticated.Exception
- if something wrong occurspublic void blockingUserNotAllowed(Redirector redirector) throws Exception
BlockingCredentialProvider
blockingUserNotAllowed
in interface BlockingCredentialProvider
redirector
- the cocoon Redirector that can be used for redirecting response.Exception
- if something wrong occurspublic void nonBlockingUserNotAllowed(Redirector redirector) throws Exception
NonBlockingCredentialProvider
nonBlockingUserNotAllowed
in interface NonBlockingCredentialProvider
redirector
- the cocoon Redirector that can be used for redirecting response.Exception
- if something wrong occurspublic void blockingUserAllowed(UserIdentity userIdentity)
BlockingCredentialProvider
blockingUserAllowed
in interface BlockingCredentialProvider
userIdentity
- The user correctly connectedpublic void nonBlockingUserAllowed(UserIdentity userIdentity)
NonBlockingCredentialProvider
nonBlockingUserAllowed
in interface NonBlockingCredentialProvider
userIdentity
- The user correctly connectedpublic boolean requiresNewWindow()
BlockingCredentialProvider
requiresNewWindow
in interface BlockingCredentialProvider