org.crsh.auth
Class KeyAuthenticationPlugin

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

public class KeyAuthenticationPlugin
extends CRaSHPlugin<KeyAuthenticationPlugin>
implements AuthenticationPlugin<PublicKey>

Author:
Julien Viet

Field Summary
static PropertyDescriptor<String> AUTHORIZED_KEY_PATH
          The SSH authorized key path.
private  Set<PublicKey> authorizedKeys
          .
private static String[] TYPES
          .
 
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
KeyAuthenticationPlugin()
           
 
Method Summary
 boolean authenticate(String username, PublicKey credential)
          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<PublicKey> getCredentialType()
          Returns the credential type.
 KeyAuthenticationPlugin 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

TYPES

private static final String[] TYPES
.


AUTHORIZED_KEY_PATH

public static final PropertyDescriptor<String> AUTHORIZED_KEY_PATH
The SSH authorized key path.


authorizedKeys

private Set<PublicKey> authorizedKeys
.

Constructor Detail

KeyAuthenticationPlugin

public KeyAuthenticationPlugin()
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<KeyAuthenticationPlugin>
Returns:
the configuration capabilities

getName

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

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

getImplementation

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

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

getCredentialType

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

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

init

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

Overrides:
init in class CRaSHPlugin<KeyAuthenticationPlugin>

authenticate

public boolean authenticate(String username,
                            PublicKey credential)
                     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<PublicKey>
Parameters:
username - the username
credential - 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.