Interface IAuthenticationProvider
- All Known Implementing Classes:
BibliothecaProvider
,HttpAuthenticationProvider
,HttpHeaderProvider
,LitteraProvider
,LocalAuthenticationProvider
,OpenIdProvider
,VuFindProvider
,XServiceProvider
public interface IAuthenticationProvider
Interface of all user authentication related actions, particularly logging in and out of a viewer user account
- Author:
- Florian Alpers
-
Method Summary
Modifier and TypeMethodDescriptionboolean
allowsEmailChange.boolean
allowsNicknameChange.boolean
Check whether this authentication service allows user to edit their password or to reset itgetAddUserToGroups.getName()
Returns an unique name for the authentication provider implementationgetType()
The provider type.Returns a future containing the login result upon completion.void
logout()
Logs the user outvoid
setAddUserToGroups
(List<String> addUserToGroups) setAddUserToGroups.void
setRedirectUrl
(String redirectUrl)
-
Method Details
-
getName
String getName()Returns an unique name for the authentication provider implementation- Returns:
- The name of the provider
-
login
CompletableFuture<LoginResult> login(String loginName, String password) throws AuthenticationProviderException Returns a future containing the login result upon completion. The result optionally contains the logged inUser
as well as theHttpServletRequest
andHttpServletResponse
to be used to complete the login and possible request forwarding If an error occurs and the request can not be processed, anAuthenticationException
must be thrown. If a login has been refused, the exact reasons can be determined using the methodsUser.isActive()
,User.isSuspended()
andLoginResult.isRefused()
- Parameters:
password
- A string to be used as a password or similar for login. If the provider does not require such a string, this can be left empty or nullloginName
- aString
object.- Returns:
- A
CompletableFuture
which is resolved once login is completed and contains aLoginResult
- Throws:
AuthenticationProviderException
- if any.
-
logout
Logs the user out- Throws:
AuthenticationProviderException
- if any.
-
allowsPasswordChange
boolean allowsPasswordChange()Check whether this authentication service allows user to edit their password or to reset it- Returns:
- true if the authentication service provides means to change or reset the user password
-
getType
String getType()The provider type. This should either be "local", "userpassword" or "openId". This value is used to determine where this provider is displayed. Providers with the same type are displayed together- Returns:
- The type of the provider
-
allowsNicknameChange
boolean allowsNicknameChange()allowsNicknameChange.
- Returns:
- true if the nickname may be changed and is not essential for user identification
-
allowsEmailChange
boolean allowsEmailChange()allowsEmailChange.
- Returns:
- true if the email may be changed and is not essential for user identification
-
getAddUserToGroups
getAddUserToGroups.
- Returns:
- a
List
object.
-
setAddUserToGroups
setAddUserToGroups.
- Parameters:
addUserToGroups
- aList
object.
-
getRedirectUrl
String getRedirectUrl()- Returns:
- the redirectUrl
-
setRedirectUrl
- Parameters:
redirectUrl
- the redirectUrl to set
-