Class AuthController

java.lang.Object
org.odpi.openmetadata.userauthn.AuthController

@RestController public class AuthController extends Object
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 Details

    • AuthController

      public AuthController(TokenService tokenService, org.springframework.security.authentication.AuthenticationManager authenticationManager)
      Constructor for the token service.
      Parameters:
      tokenService - implementation of the token generation service
      authenticationManager - implementation of the pluggable authentication manager
  • Method Details

    • token

      @PostMapping("/api/token") public String token(@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("/api/servers/{serverName}/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.