public class BasicCredentialProvider extends AbstractCredentialProvider implements BlockingCredentialProvider, Contextualizable
Modifier and Type | Field and Description |
---|---|
protected static String |
__PARAM_REALM
Name of the parameter holding the authentication realm
|
private Context |
_context |
protected String |
_realm
The realm
|
private static String |
BASIC_AUTHENTICATION_KEY |
Constructor and Description |
---|
BasicCredentialProvider() |
Modifier and Type | Method and Description |
---|---|
private List<UserPopulation> |
_getPopulations(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.
|
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
protected static final String __PARAM_REALM
private static final String BASIC_AUTHENTICATION_KEY
public BasicCredentialProvider()
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 blockingGrantAnonymousRequest()
BlockingCredentialProvider
blockingGrantAnonymousRequest
in interface BlockingCredentialProvider
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 occursprivate List<UserPopulation> _getPopulations(Request request)
public 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 blockingUserAllowed(UserIdentity userIdentity)
BlockingCredentialProvider
blockingUserAllowed
in interface BlockingCredentialProvider
userIdentity
- The user correctly connectedpublic boolean requiresNewWindow()
BlockingCredentialProvider
requiresNewWindow
in interface BlockingCredentialProvider