Class AuthService

java.lang.Object
com.order.api01authgateway.service.AuthService

@Service public class AuthService extends Object
Service component responsible for handling user authentication business logic.

This service coordinates the authentication process by verifying credentials against configured identity providers and generating secure access tokens using JwtService. It relies on Spring Security's AuthenticationManager to perform BCrypt-based password verification.

  • Constructor Details

    • AuthService

      public AuthService()
  • Method Details

    • authenticate

      public TokenResponse authenticate(LoginRequest request)
      Authenticates a user and returns a token response.
      Parameters:
      request - The login request containing username and password.
      Returns:
      A TokenResponse containing the generated JWT.
      Throws:
      org.springframework.security.core.AuthenticationException - If authentication fails (e.g., bad credentials).