Package org.odpi.openmetadata.userauthn
Class LoginController
java.lang.Object
org.odpi.openmetadata.userauthn.LoginController
AuthController provides the simple token service that can be used to log a user into open metadata.
It uses the Spring framework to provide the authentication token. The user
-
Constructor Summary
ConstructorsConstructorDescriptionLoginController(TokenService tokenService, org.springframework.security.authentication.AuthenticationManager authenticationManager) Constructor for the token service. -
Method Summary
Modifier and TypeMethodDescriptionplatformToken(LoginRequest userLogin) External service that provides an encrypted token that act as a bearer token for a REST API request.serverToken(String serverName, LoginRequest userLogin) External service that provides an encrypted token that act as a bearer token for a REST API request.
-
Constructor Details
-
LoginController
public LoginController(TokenService tokenService, org.springframework.security.authentication.AuthenticationManager authenticationManager) Constructor for the token service.- Parameters:
tokenService- implementation of the token generation serviceauthenticationManager- implementation of the pluggable authentication manager
-
-
Method Details
-
platformToken
@PostMapping("/api/token") public String platformToken(@RequestBody LoginRequest userLogin) throws org.springframework.security.core.AuthenticationException External service that provides an encrypted token that act as a bearer token for a REST API request. The userId and password are sent in the request body- Parameters:
userLogin- request body that contains the userId and password- Returns:
- token
- Throws:
org.springframework.security.core.AuthenticationException- The user and password do not match the values in the user directory.
-
serverToken
@PostMapping("/servers/{serverName}/api/token") public String serverToken(@PathVariable String serverName, @RequestBody LoginRequest userLogin) throws org.springframework.security.core.AuthenticationException External service that provides an encrypted token that act as a bearer token for a REST API request. The userId and password are sent in the request body- Parameters:
userLogin- request body that contains the userId and password- Returns:
- token
- Throws:
org.springframework.security.core.AuthenticationException- The user and password do not match the values in the user directory.
-