Class XServiceProvider
java.lang.Object
io.goobi.viewer.model.security.authentication.HttpAuthenticationProvider
io.goobi.viewer.model.security.authentication.VuFindProvider
io.goobi.viewer.model.security.authentication.XServiceProvider
- All Implemented Interfaces:
IAuthenticationProvider
Authentication provider that authenticates users via the X-Service API.
-
Field Summary
Fields inherited from class io.goobi.viewer.model.security.authentication.HttpAuthenticationProvider
addUserToGroups, connectionManager, DEFAULT_EMAIL, image, label, name, redirectUrl, timeoutMillis, type, TYPE_USER_PASSWORD, url -
Constructor Summary
ConstructorsConstructorDescriptionXServiceProvider(String name, String label, String url, String image, long timeoutMillis) Creates a new XServiceProvider instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether this authentication service allows user to edit their password or to reset it.Returns a future containing the login result upon completion.voidlogout()Logs the user out.Methods inherited from class io.goobi.viewer.model.security.authentication.VuFindProvider
allowsEmailChange, allowsNicknameChangeMethods inherited from class io.goobi.viewer.model.security.authentication.HttpAuthenticationProvider
get, getAddUserToGroups, getImage, getImageUrl, getLabel, getName, getRedirectUrl, getTimeoutMillis, getType, getUrl, post, setAddUserToGroups, setRedirectUrl
-
Constructor Details
-
XServiceProvider
Creates a new XServiceProvider instance.- Parameters:
name- internal provider identifierlabel- human-readable provider name shown in the UIurl- base URL of the XService authentication endpointimage- path to the provider logo imagetimeoutMillis- HTTP request timeout in milliseconds
-
-
Method Details
-
login
public CompletableFuture<LoginResult> login(String borID, 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()- Specified by:
loginin interfaceIAuthenticationProvider- Overrides:
loginin classVuFindProvider- Parameters:
borID- login name or identifier supplied by the userpassword- 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.- Specified by:
logoutin interfaceIAuthenticationProvider- Overrides:
logoutin classVuFindProvider- Throws:
AuthenticationProviderException- if any.
-
allowsPasswordChange
public boolean allowsPasswordChange()Checks whether this authentication service allows user to edit their password or to reset it.- Specified by:
allowsPasswordChangein interfaceIAuthenticationProvider- Overrides:
allowsPasswordChangein classVuFindProvider- Returns:
- true if the authentication service provides means to change or reset the user password
-