Class OpenIdProvider
java.lang.Object
io.goobi.viewer.model.security.authentication.HttpAuthenticationProvider
io.goobi.viewer.model.security.authentication.OpenIdProvider
- All Implemented Interfaces:
IAuthenticationProvider
OpenIdProvider class.
-
Field Summary
FieldsFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanallowsEmailChange.booleanallowsNicknameChange.booleanCheck whether this authentication service allows user to edit their password or to reset itcompleteLogin(com.auth0.jwt.interfaces.DecodedJWT jwt, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Tries to find or create a validUserbased on the given json object.Getter for the fieldclientId.Getter for the fieldclientSecret.Getter for the fieldoAuthAccessToken.Getter for the fieldoAuthState.getScope()longReturns a future containing the login result upon completion.voidlogout()Logs the user outsetDiscoveryUri(String discoveryUri) setJwksUri(String jwksUri) voidsetoAuthAccessToken(String oAuthAccessToken) Setter for the fieldoAuthAccessToken.voidsetoAuthState(String oAuthState) Setter for the fieldoAuthState.setRedirectionEndpoint(String redirectionEndpoint) setResponseMode(String responseMode) setResponseType(String responseType) setThirdPartyVariables(String thirdPartyLoginUrl, String thirdPartyLoginApiKey, String thirdPartyLoginScope, String thirdPartyLoginReqParamDef, String thirdPartyLoginClaim) setTokenCheckDelay(long tokenCheckDelay) setTokenEndpoint(String tokenEndpoint) Methods inherited from class io.goobi.viewer.model.security.authentication.HttpAuthenticationProvider
get, getAddUserToGroups, getImage, getImageUrl, getLabel, getName, getRedirectUrl, getTimeoutMillis, getType, getUrl, post, setAddUserToGroups, setRedirectUrl
-
Field Details
-
TYPE_OPENID
ConstantTYPE_OPENID="openId"- See Also:
-
-
Constructor Details
-
Method Details
-
login
public 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.
-
completeLogin
public Future<Boolean> completeLogin(com.auth0.jwt.interfaces.DecodedJWT jwt, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Tries to find or create a validUserbased on the given json object. Generates aLoginResultcontaining the given request and response and either an optional containing the user or nothing if no user was found, or aAuthenticationProviderExceptionif an internal error occured during login If this method is not called withinHttpAuthenticationProvider.getTimeoutMillis()ms after callinglogin(String, String), a loginResponse is created containing an appropriate exception. In any case, the future returned bylogin(String, String)is resolved.- Parameters:
jwt-DecodedJWTrequest- aHttpServletRequestobject.response- aHttpServletResponseobject.- Returns:
- a
Futureobject.
-
logout
Logs the user out- Throws:
AuthenticationProviderException- if any.
-
allowsPasswordChange
public 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
-
allowsNicknameChange
public boolean allowsNicknameChange()allowsNicknameChange.
- Returns:
- true if the nickname may be changed and is not essential for user identification
-
allowsEmailChange
public boolean allowsEmailChange()allowsEmailChange.
- Returns:
- true if the email may be changed and is not essential for user identification
-
getDiscoveryUri
- Returns:
- the discoveryUri
-
setDiscoveryUri
- Parameters:
discoveryUri- the discoveryUri to set- Returns:
- this
-
getClientId
Getter for the field
clientId.- Returns:
- the clientId
-
getClientSecret
Getter for the field
clientSecret.- Returns:
- the clientSecret
-
getTokenEndpoint
- Returns:
- the tokenEndpoint
-
setTokenEndpoint
- Parameters:
tokenEndpoint- the tokenEndpoint to set- Returns:
- this
-
getJwksUri
- Returns:
- the jwksUri
-
setJwksUri
- Parameters:
jwksUri- the jwksUri to set- Returns:
- this
-
getRedirectionEndpoint
- Returns:
- the redirectionEndpoint
-
setRedirectionEndpoint
- Parameters:
redirectionEndpoint- the redirectionEndpoint to set- Returns:
- this
-
getScope
- Returns:
- the scope
-
setScope
- Parameters:
scope- the scope to set- Returns:
- this
-
getResponseType
- Returns:
- the responseType
-
setResponseType
- Parameters:
responseType- the responseType to set- Returns:
- this
-
getResponseMode
- Returns:
- the responseMode
-
setResponseMode
- Parameters:
responseMode- the responseMode to set- Returns:
- this
-
getIssuer
- Returns:
- the issuer
-
setIssuer
- Parameters:
issuer- the issuer to set- Returns:
- this
-
getTokenCheckDelay
public long getTokenCheckDelay()- Returns:
- the tokenCheckDelay
-
setTokenCheckDelay
- Parameters:
tokenCheckDelay- the tokenCheckDelay to set- Returns:
- this
-
getThirdPartyLoginUrl
-
getThirdPartyLoginApiKey
-
getThirdPartyLoginScope
-
getThirdPartyLoginReqParamDef
-
getThirdPartyLoginClaim
-
setThirdPartyVariables
-
getoAuthState
Getter for the field
oAuthState.- Returns:
- the oAuthState
-
setoAuthState
Setter for the field
oAuthState.- Parameters:
oAuthState- the oAuthState to set
-
getoAuthAccessToken
Getter for the field
oAuthAccessToken.- Returns:
- the oAuthAccessToken
-
setoAuthAccessToken
Setter for the field
oAuthAccessToken.- Parameters:
oAuthAccessToken- the oAuthAccessToken to set
-