org.eclipse.emf.emfstore.internal.server.accesscontrol
Class LoginService

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.server.accesscontrol.LoginService

public class LoginService
extends Object

Service for logging users out and in. The user verification step is customizable via an extension point.

Author:
emueller

Constructor Summary
LoginService(ESAuthenticationControlType authenticationControlType, ESSessions sessions, ESOrgUnitProvider orgUnitProvider, ESOrgUnitResolver orgUnitResolver)
          Constructor.
 
Method Summary
 ESAuthenticationInformation logIn(String username, String password, ESClientVersionInfo clientVersionInfo)
          Login the given user with the provided password and client version.
 void logout(ESSessionId sessionId)
          Logout the given session.
 boolean verifyUser(String username, String password, ESClientVersionInfo clientVersionInfo)
          Checks whether the given credentials are valid without logging the client in.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginService

public LoginService(ESAuthenticationControlType authenticationControlType,
                    ESSessions sessions,
                    ESOrgUnitProvider orgUnitProvider,
                    ESOrgUnitResolver orgUnitResolver)
Constructor.

Parameters:
authenticationControlType - the desired type authentication control type
sessions - a ESSessions map that will be updated in case an user successfully logins
orgUnitProvider - an ESOrgUnitProvider that provides access to all organizational units known by EMFStore. This may be consumed by an ESUserVerifier but boesn't necessarily needs to happen. It's absolutely fine if ESUserVerifier ignore the provider.
orgUnitResolver - an ESOrgUnitResolver for resolving any roles and groups on a given organizational unit
Method Detail

logIn

public ESAuthenticationInformation logIn(String username,
                                         String password,
                                         ESClientVersionInfo clientVersionInfo)
                                  throws AccessControlException
Login the given user with the provided password and client version.

Parameters:
username - the name of the user to be logged in
password - the password of the user
clientVersionInfo - the client version of the user
Returns:
an ESAuthenticationInformation in case the login was successfull
Throws:
AccessControlException - in case user verification fails

logout

public void logout(ESSessionId sessionId)
            throws AccessControlException
Logout the given session.

Parameters:
sessionId - the ID of the session that should be logged out
Throws:
AccessControlException - in case the the session ID is null

verifyUser

public boolean verifyUser(String username,
                          String password,
                          ESClientVersionInfo clientVersionInfo)
Checks whether the given credentials are valid without logging the client in.

Parameters:
username - the user name
password - the encrypted password of the user
clientVersionInfo - the client's version
Returns:
true, if the user's credentials are valid, false otherwise


Copyright © 2016. All Rights Reserved.