Class AuthenticationEndpoint
java.lang.Object
io.goobi.viewer.api.rest.v1.authentication.AuthenticationEndpoint
REST endpoint handling user authentication, login/logout flows, and OAuth-based API token management.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthenticateUser(String email, String password) authenticateUser.headerParameterLogin(String redirectUrl) openIdLoginGET(String error, String authCode, String accessToken, String state) OpenID Connect POST callback.
-
Constructor Details
-
AuthenticationEndpoint
public AuthenticationEndpoint()
-
-
Method Details
-
authenticateUser
@POST @Produces("application/json") @Consumes("application/x-www-form-urlencoded") public Response authenticateUser(@FormParam("email") String email, @FormParam("password") String password) authenticateUser.- Parameters:
email- user email address for authenticationpassword- user password for authentication- Returns:
- the HTTP response containing the authentication token on success, or a 403/500 status on failure
-
headerParameterLogin
@GET @Path("/header") public Response headerParameterLogin(@QueryParam("redirectUrl") String redirectUrl) - Parameters:
redirectUrl- optional URL to redirect to after login- Returns:
Response
-
openIdLoginGET
@GET @Path("/oauth") public Response openIdLoginGET(@QueryParam("error") String error, @QueryParam("code") String authCode, @QueryParam("id_token") String accessToken, @QueryParam("state") String state) throws IOException - Parameters:
error- error code returned by the OpenID provider on failureauthCode- authorization code from the OpenID provideraccessToken- ID token passed directly by the providerstate- state value to match against the registered provider- Returns:
Response- Throws:
IOException
-
openIdLoginPOST
@POST @Path("/oauth") @Consumes("application/x-www-form-urlencoded") public Response openIdLoginPOST() throws IOExceptionOpenID Connect POST callback. Parameters are read from the request body viaServletRequest.getParameter(String)to avoid Jersey throwingIllegalStateExceptionwhen Content-Type is absent.- Returns:
Response- Throws:
IOException
-