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 Summary

    Constructors
    Constructor
    Description
    AuthController(TokenService tokenService, org.springframework.security.authentication.AuthenticationManager authenticationManager)
    Constructor for the token service.
  • Method Summary

    Modifier and Type
    Method
    Description
    token(String username, String password)
    External service that provides an encrypted token that act as a bearer token for a REST API request.
    token(LoginRequest userLogin)
    External service that provides an encrypted token that act as a bearer token for a REST API request.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.
    • token

      @PostMapping(value="/api/token", params={"username","password"}) public String token(@RequestParam String username, @RequestParam String password) 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 supplied as request parameters.
      Parameters:
      username - request parameter for the userId
      password - request parameter for the password
      Returns:
      token
      Throws:
      org.springframework.security.core.AuthenticationException - The user and password do not match the values in the user directory.