org.crsh.auth
Class SimpleAuthenticationPlugin

java.lang.Object
  extended by org.crsh.plugin.CRaSHPlugin<AuthenticationPlugin>
      extended by org.crsh.auth.SimpleAuthenticationPlugin
All Implemented Interfaces:
AuthenticationPlugin<String>

public class SimpleAuthenticationPlugin
extends CRaSHPlugin<AuthenticationPlugin>
implements AuthenticationPlugin<String>


Field Summary
private  String password
          .
static PropertyDescriptor<String> SIMPLE_PASSWORD
          The password.
static PropertyDescriptor<String> SIMPLE_USERNAME
          The username.
private  String username
          .
 
Fields inherited from class org.crsh.plugin.CRaSHPlugin
CONSTRUCTED, FAILED, INITIALIZED, INITIALIZING, log
 
Fields inherited from interface org.crsh.auth.AuthenticationPlugin
AUTH, NULL
 
Constructor Summary
SimpleAuthenticationPlugin()
           
 
Method Summary
 boolean authenticate(String username, String password)
          Returns true if the user is authentified by its username and credential.
protected  Iterable<PropertyDescriptor<?>> createConfigurationCapabilities()
          Returns a list of PropertyDescriptor this plugin requires for its configuration.
 Class<String> getCredentialType()
          Returns the credential type.
 AuthenticationPlugin getImplementation()
          Returns the implementation.
 String getName()
          Returns the authentication plugin name.
 void init()
          Implement this method to know about init life cycle callback.
 
Methods inherited from class org.crsh.plugin.CRaSHPlugin
destroy, getConfigurationCapabilities, getContext, getStatus, getType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SIMPLE_USERNAME

public static final PropertyDescriptor<String> SIMPLE_USERNAME
The username.


SIMPLE_PASSWORD

public static final PropertyDescriptor<String> SIMPLE_PASSWORD
The password.


username

private String username
.


password

private String password
.

Constructor Detail

SimpleAuthenticationPlugin

public SimpleAuthenticationPlugin()
Method Detail

createConfigurationCapabilities

protected Iterable<PropertyDescriptor<?>> createConfigurationCapabilities()
Description copied from class: CRaSHPlugin
Returns a list of PropertyDescriptor this plugin requires for its configuration.

Overrides:
createConfigurationCapabilities in class CRaSHPlugin<AuthenticationPlugin>
Returns:
the configuration capabilities

getCredentialType

public Class<String> getCredentialType()
Description copied from interface: AuthenticationPlugin
Returns the credential type.

Specified by:
getCredentialType in interface AuthenticationPlugin<String>
Returns:
the credential type

getImplementation

public AuthenticationPlugin getImplementation()
Description copied from class: CRaSHPlugin
Returns the implementation.

Specified by:
getImplementation in class CRaSHPlugin<AuthenticationPlugin>
Returns:
the implementation

init

public void init()
Description copied from class: CRaSHPlugin
Implement this method to know about init life cycle callback.

Overrides:
init in class CRaSHPlugin<AuthenticationPlugin>

getName

public String getName()
Description copied from interface: AuthenticationPlugin
Returns the authentication plugin name.

Specified by:
getName in interface AuthenticationPlugin<String>
Returns:
the plugin name

authenticate

public boolean authenticate(String username,
                            String password)
                     throws Exception
Description copied from interface: AuthenticationPlugin
Returns true if the user is authentified by its username and credential.

Specified by:
authenticate in interface AuthenticationPlugin<String>
Parameters:
username - the username
password - the credential
Returns:
true if authentication succeeded
Throws:
Exception - any exception that would prevent authentication to happen


Copyright © 2015 eXo Platform SAS. All Rights Reserved.