Class HttpAuthenticationProvider
java.lang.Object
io.goobi.viewer.model.security.authentication.HttpAuthenticationProvider
- All Implemented Interfaces:
IAuthenticationProvider
- Direct Known Subclasses:
BibliothecaProvider,HttpHeaderProvider,LitteraProvider,OpenIdProvider,VuFindProvider
Authentication provider that delegates credential validation to an external HTTP endpoint.
- Author:
- Florian Alpers
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static org.apache.http.impl.conn.PoolingHttpClientConnectionManagerConstantconnectionManager.protected static final StringConstantDEFAULT_EMAIL="{username}@nomail.com".protected final Stringprotected final Stringprotected final Stringprotected StringURL to redirect to after successful login.protected final longprotected final Stringprotected static final StringConstantTYPE_USER_PASSWORD="userPassword".protected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringget.getAddUserToGroups.getImage()Getter for the fieldimage.getImageUrl.getLabel()Getter for the fieldlabel.getName()Returns an unique name for the authentication provider implementation.longGetter for the fieldtimeoutMillis.getType()The provider type.getUrl()Getter for the fieldurl.protected Stringpost.voidsetAddUserToGroups(List<String> addUserToGroups) setAddUserToGroups.voidsetRedirectUrl(String redirectUrl) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.goobi.viewer.model.security.authentication.IAuthenticationProvider
allowsEmailChange, allowsNicknameChange, allowsPasswordChange, login, logout
-
Field Details
-
DEFAULT_EMAIL
ConstantDEFAULT_EMAIL="{username}@nomail.com".- See Also:
-
TYPE_USER_PASSWORD
ConstantTYPE_USER_PASSWORD="userPassword".- See Also:
-
connectionManager
protected static org.apache.http.impl.conn.PoolingHttpClientConnectionManager connectionManagerConstantconnectionManager. -
name
-
label
-
type
-
image
-
timeoutMillis
protected final long timeoutMillis -
addUserToGroups
-
url
-
redirectUrl
URL to redirect to after successful login.
-
-
Constructor Details
-
HttpAuthenticationProvider
protected HttpAuthenticationProvider(String name, String label, String type, String url, String image, long timeoutMillis) Creates a new HttpAuthenticationProvider instance.- Parameters:
name- unique identifier for this providerlabel- display label shown to the usertype- provider type, e.g. userPasswordurl- remote authentication endpoint URLimage- relative or absolute path to the provider logotimeoutMillis- HTTP connection and socket timeout in milliseconds
-
-
Method Details
-
getTimeoutMillis
public long getTimeoutMillis()Getter for the fieldtimeoutMillis.- Returns:
- the timeout in milliseconds used for HTTP authentication requests
-
getName
Returns an unique name for the authentication provider implementation.- Specified by:
getNamein interfaceIAuthenticationProvider- Returns:
- The name of the provider
-
getLabel
Getter for the fieldlabel.- Returns:
- the display label for this provider, falling back to the name if no label is set
-
getUrl
Getter for the fieldurl.- Returns:
- the endpoint URL used for authentication requests
-
getImage
Getter for the fieldimage.- Returns:
- the image URL or path representing this authentication provider
-
getImageUrl
getImageUrl.- Returns:
- the absolute URL to the authentication provider's image
-
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
- Specified by:
getTypein interfaceIAuthenticationProvider- Returns:
- The type of the provider
-
getAddUserToGroups
getAddUserToGroups.- Specified by:
getAddUserToGroupsin interfaceIAuthenticationProvider- Returns:
- list of group names to add the user to on login
-
setAddUserToGroups
setAddUserToGroups.- Specified by:
setAddUserToGroupsin interfaceIAuthenticationProvider- Parameters:
addUserToGroups- group names to assign new or returning users to
-
getRedirectUrl
- Specified by:
getRedirectUrlin interfaceIAuthenticationProvider
-
setRedirectUrl
- Specified by:
setRedirectUrlin interfaceIAuthenticationProvider
-
post
post.- Parameters:
url- target endpoint URI for the POST requestrequestEntity- JSON body to send in the POST request- Returns:
- the HTTP response body as string
- Throws:
WebApplicationException- if any.
-
get
get.- Parameters:
url- target endpoint URI for the GET request- Returns:
- the HTTP response body as string
- Throws:
WebApplicationException- if any.
-