1 package org.openslx.imagemaster.session;
3 import java.sql.SQLException;
5 import org.apache.logging.log4j.LogManager;
6 import org.apache.logging.log4j.Logger;
7 import org.
openslx.bwlp.thrift.iface.AuthorizationError;
8 import org.
openslx.bwlp.thrift.iface.InvocationError;
9 import org.
openslx.bwlp.thrift.iface.TAuthorizationException;
10 import org.
openslx.bwlp.thrift.iface.TInvocationException;
32 public static UserInfo
authenticate( String username, String password )
throws TAuthorizationException, TInvocationException
34 String login = username;
36 log.info(
"Logging in with: " + login );
41 }
catch ( SQLException e ) {
42 throw new TInvocationException( InvocationError.INTERNAL_SERVER_ERROR,
"Could not connect to database" );
45 log.debug(
"Login failed: " + username );
46 throw new TAuthorizationException( AuthorizationError.INVALID_CREDENTIALS,
"Invalid Username or password" );
48 log.debug(
"Login succesful: " + username );
Represents a user that can login against the masterserver.
static UserInfo authenticate(String username, String password)
Authenticate the user against whatever backend.
static LocalUser forUserId(final String login)
Query database for user with given user id.
Authenticates a user against a backend (mysql here)