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 TypeMethodDescriptionbooleanallowsEmailChange.booleanallowsNicknameChange.booleanCheck 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.voidlogout()Logs the user outvoidsetAddUserToGroups(List<String> addUserToGroups) setAddUserToGroups.voidsetRedirectUrl(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 inUseras well as theHttpServletRequestandHttpServletResponseto be used to complete the login and possible request forwarding If an error occurs and the request can not be processed, anAuthenticationExceptionmust be thrown. If a login has been refused, the exact reasons can be determined using the methodsUser.isActive(),User.isSuspended()andLoginResult.isRefused()- Parameters:
loginName- aStringobject.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 null- Returns:
- A
CompletableFuturewhich 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
Listobject.
-
setAddUserToGroups
setAddUserToGroups.
- Parameters:
addUserToGroups- aListobject.
-
getRedirectUrl
String getRedirectUrl()- Returns:
- the redirectUrl
-
setRedirectUrl
- Parameters:
redirectUrl- the redirectUrl to set
-