Package xal.plugin.essrbac
Class EssRbacLogin
java.lang.Object
xal.plugin.essrbac.EssRbacLogin
- All Implemented Interfaces:
RBACLogin
EssRbacLogin extends
RBACLogin
.
Basically just a wrapper for SecurityFacade
to authenticate.- Version:
- 0.1 27 Jul 2015
- Author:
- Blaž Kranjc <blaz.kranjc@cosylab.com>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthenticate
(String username, char[] password) Authenticates the user using username and password.authenticate
(String username, char[] password, String preferredRole) Authenticates the user using username, password and preferred role.authenticate
(String username, char[] password, String preferredRole, String ip) Authenticates the user using username and password, preferred role and ip.String[]
getRolesForUser
(String ip, String username) Returns the list of all roles for the provided username.
-
Constructor Details
-
EssRbacLogin
public EssRbacLogin()
-
-
Method Details
-
getRolesForUser
Description copied from interface:RBACLogin
Returns the list of all roles for the provided username.RBACException
is thrown in case of an error.- Specified by:
getRolesForUser
in interfaceRBACLogin
- Parameters:
ip
- the host IPusername
- the username of the user to get assigned roles for- Returns:
- array of role names assigned to the user
- Throws:
RBACException
- if there was an error
-
authenticate
public RBACSubject authenticate(String username, char[] password) throws AccessDeniedException, RBACException Description copied from interface:RBACLogin
Authenticates the user using username and password. The method returns the Token if authentication was successful or throws aAccessDeniedException
if authentication failed.- Specified by:
authenticate
in interfaceRBACLogin
- Parameters:
username
- that will be used for authentication.password
- that will be used for authentication.- Returns:
- RBACSubject class representing logged in user
- Throws:
RBACException
- if there is an errorAccessDeniedException
-
authenticate
public RBACSubject authenticate(String username, char[] password, String preferredRole) throws AccessDeniedException, RBACException Description copied from interface:RBACLogin
Authenticates the user using username, password and preferred role. The method returns the Token if authentication was successful or throws aAccessDeniedException
if authentication failed.- Specified by:
authenticate
in interfaceRBACLogin
- Parameters:
username
- that will be used for authentication.password
- that will be used for authentication.preferredRole
- the user would prefer to have.- Returns:
- RBACSubject class representing logged in user
- Throws:
RBACException
- if there is an errorAccessDeniedException
-
authenticate
public RBACSubject authenticate(String username, char[] password, String preferredRole, String ip) throws AccessDeniedException, RBACException Description copied from interface:RBACLogin
Authenticates the user using username and password, preferred role and ip. The method returns the Token if authentication was successful or throws aAccessDeniedException
if authentication failed.- Specified by:
authenticate
in interfaceRBACLogin
- Parameters:
username
- that will be used for authentication.password
- that will be used for authentication.preferredRole
- the user would prefer to have.ip
- address that will be used for authentication.- Returns:
- RBACSubject class representing logged in user
- Throws:
RBACException
- if there is an errorAccessDeniedException
-