|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cenqua.fisheye.user.plugin.AbstractFishEyeAuthenticator com.cenqua.fisheye.user.plugin.ExampleFishEyeAuthenticator
public class ExampleFishEyeAuthenticator
An example authenticator.
This authenticator reads its data from its Properties
configuration.
Usernames/passwords are found using properties of the form user.USERNAME=PASSWORD
By default, access is allowed to any repository. Access can be restricted
to a set of users using a property of the form
repos.REPNAME=USERNAME1,USERNAME2,...,USERNAMEn
To use this example, you would need something like the following in your config.xml:
<security allow-anon="false"> <custom classname="com.cenqua.fisheye.user.plugin.ExampleFishEyeAuthenticator" auto-add="true" positive-cache-ttl="5mins"> <properties> user.jane=j4n3 user.fred=fr3d repos.rep1=jane,fred repos.rep2=fred repos.rep3=jane </properties> </custom></security>
Nested Class Summary | |
---|---|
static class |
ExampleFishEyeAuthenticator.ExampleAuthToken
|
Constructor Summary | |
---|---|
ExampleFishEyeAuthenticator()
|
Method Summary | |
---|---|
AuthToken |
checkPassword(java.lang.String username,
java.lang.String password)
Called to check a user's password. |
void |
close()
Called when this authenticator will no longer be used. |
boolean |
hasPermissionToAccess(AuthToken tok,
java.lang.String repname,
java.lang.String constraint)
Check if a user has permission to access the given repository. |
void |
init(java.util.Properties cfg)
Called to configure this authenticator. |
AuthToken |
recreateAuth(java.lang.String username)
Used to re-create a token for a user that was previously authenticated. |
Methods inherited from class com.cenqua.fisheye.user.plugin.AbstractFishEyeAuthenticator |
---|
checkRequest, isRequestUserStillValid |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExampleFishEyeAuthenticator()
Method Detail |
---|
public void init(java.util.Properties cfg) throws java.lang.Exception
FishEyeAuthenticator
cfg
- the configuration properties, as specified
in the <properties> element in the <custom> config.
(non-null)
java.lang.Exception
- an error occurred during configuration.public void close()
FishEyeAuthenticator
public AuthToken checkPassword(java.lang.String username, java.lang.String password)
FishEyeAuthenticator
You should not make any assumptions about the arguments. For example, they could be the empty string, or null.
username
- given username (may be null)password
- given password (may be null)
public AuthToken recreateAuth(java.lang.String username)
FishEyeAuthenticator
public boolean hasPermissionToAccess(AuthToken tok, java.lang.String repname, java.lang.String constraint)
FishEyeAuthenticator
This method is notcalled when users are not logged in (anonymous users).
If a custom constraint has been specified in config.xml, then that value is passed as
constraint
. This is taken from the <security><custom constraint="">
setting in either <repository> or <repository-defaults>.
A constraint could be used (for example) to specify a group that a user must belong to in order to access a repository.
tok
- an authentication token as returned by FishEyeAuthenticator.checkPassword(java.lang.String, java.lang.String)
or FishEyeAuthenticator.recreateAuth(java.lang.String)
(not null)repname
- the symbolic name of the repository (not null)constraint
- a constraint as specified in config.xml (or null if not specified).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |