Class HttpBasicAuthenticationProvider
java.lang.Object
org.operaton.bpm.engine.rest.security.auth.impl.HttpBasicAuthenticationProvider
- All Implemented Interfaces:
AuthenticationProvider
Implementation of the
AuthenticationProvider interface that performs
HTTP Basic Authentication against the identity service of a process engine.
This class extracts credentials from the "Authorization" HTTP header, decodes them, and validates them using the process engine's identity service.
If authentication fails, an appropriate challenge response is added to the HTTP response.
- Author:
- Thorben Lindhauer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaugmentResponseByAuthenticationChallenge(jakarta.servlet.http.HttpServletResponse response, ProcessEngine engine) Adds an HTTP Basic Authentication challenge to the response.extractAuthenticatedUser(jakarta.servlet.http.HttpServletRequest request, ProcessEngine engine) Extracts and authenticates the user from the HTTP request using Basic Authentication.protected booleanisAuthenticated(ProcessEngine engine, String userName, String password) Validates the provided username and password against the process engine's identity service.
-
Field Details
-
BASIC_AUTH_HEADER_PREFIX
- See Also:
-
-
Constructor Details
-
HttpBasicAuthenticationProvider
public HttpBasicAuthenticationProvider()
-
-
Method Details
-
extractAuthenticatedUser
public AuthenticationResult extractAuthenticatedUser(jakarta.servlet.http.HttpServletRequest request, ProcessEngine engine) Extracts and authenticates the user from the HTTP request using Basic Authentication.- Specified by:
extractAuthenticatedUserin interfaceAuthenticationProvider- Parameters:
request- the HTTP request containing the "Authorization" headerengine- the process engine used for authentication- Returns:
- an
AuthenticationResultindicating success or failure
-
isAuthenticated
Validates the provided username and password against the process engine's identity service.- Parameters:
engine- the process engine used for authenticationuserName- the username to authenticatepassword- the password to authenticate- Returns:
- true if the credentials are valid, false otherwise
-
augmentResponseByAuthenticationChallenge
public void augmentResponseByAuthenticationChallenge(jakarta.servlet.http.HttpServletResponse response, ProcessEngine engine) Adds an HTTP Basic Authentication challenge to the response.- Specified by:
augmentResponseByAuthenticationChallengein interfaceAuthenticationProvider- Parameters:
response- the HTTP response to augmentengine- the process engine providing the authentication realm
-