org.olat.login
Class LoginModule

java.lang.Object
  extended by org.olat.login.LoginModule
All Implemented Interfaces:
OLATModule

public class LoginModule
extends java.lang.Object
implements OLATModule

Initial Date: 04.08.2004

Author:
Mike Stock

Constructor Summary
LoginModule()
           
 
Method Summary
static boolean allowLoginUsingEmail()
           
static void clearFailedLoginAttempts(java.lang.String login)
          Clear all failed login attempts for a given login.
 void destroy()
          Caled during Servlet.destroy()
static java.lang.Integer getAttackPreventionTimeoutMin()
           
static AuthenticationProvider getAuthenticationProvider(java.lang.String provider)
           
static java.util.Collection getAuthenticationProviders()
           
static java.lang.String getDefaultProviderName()
           
 void init(com.anthonyeden.lib.config.Configuration moduleConfig)
          Called by ConfigurationManager during statrup.
static boolean isGuestLoginLinksEnabled()
           
static boolean isLoginBlocked(java.lang.String login)
          Tells wether a login is blocked to prevent brute force attacks or not.
static boolean registerFailedLoginAttempt(java.lang.String login)
          Must be called upon each login attempt.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginModule

public LoginModule()
Method Detail

init

public void init(com.anthonyeden.lib.config.Configuration moduleConfig)
Description copied from interface: OLATModule
Called by ConfigurationManager during statrup. Module is called in the order it is registered in olat_config.xml. On any critical errors, throw StartupException. Any other errors, just throw Exceptions. OLATContext will already be initialized at this stage.

Specified by:
init in interface OLATModule
See Also:
OLATModule.init(com.anthonyeden.lib.config.Configuration)

destroy

public void destroy()
Description copied from interface: OLATModule
Caled during Servlet.destroy()

Specified by:
destroy in interface OLATModule
See Also:
OLATModule.destroy()

getDefaultProviderName

public static java.lang.String getDefaultProviderName()
Returns:
The configured default login provider.

getAuthenticationProvider

public static AuthenticationProvider getAuthenticationProvider(java.lang.String provider)
Parameters:
provider -
Returns:
AuthenticationProvider implementation.

getAuthenticationProviders

public static java.util.Collection getAuthenticationProviders()
Returns:
Collection of available AuthenticationProviders

registerFailedLoginAttempt

public static final boolean registerFailedLoginAttempt(java.lang.String login)
Must be called upon each login attempt. Returns true if number of login attempts has reached the set limit.

Parameters:
login -
Returns:
True if further logins will be prevented (i.e. max attempts reached).

clearFailedLoginAttempts

public static final void clearFailedLoginAttempts(java.lang.String login)
Clear all failed login attempts for a given login.

Parameters:
login -

isLoginBlocked

public static final boolean isLoginBlocked(java.lang.String login)
Tells wether a login is blocked to prevent brute force attacks or not.

Parameters:
login -
Returns:
True if login is blocked by attack prevention mechanism

isGuestLoginLinksEnabled

public static final boolean isGuestLoginLinksEnabled()
Returns:
True if guest login kinks must be shown on login screen, false otherwhise

getAttackPreventionTimeoutMin

public static java.lang.Integer getAttackPreventionTimeoutMin()
Returns:
Number of minutes a login gets blocked after too many attempts.

allowLoginUsingEmail

public static boolean allowLoginUsingEmail()
Returns:
True if login with email is allowed (set in olat_config.xml)