Package com.bank.auth_service.service
Interface AuthenticationService
- All Known Implementing Classes:
AuthenticationServiceImpl
public interface AuthenticationService
Service interface for handling authentication-related operations,
including user login with email and password, and login with token refresh functionality.
- Since:
- 1.0.0
- Version:
- 1.0.0, 06/23/2025
- Author:
- Fernando Cruz Cavina
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionlogin
(LoginUserDto loginUserDto, jakarta.servlet.http.HttpServletRequest request) Authenticates a user using provided credentials and generates authentication tokens.refreshToken
(UUID refreshToken, jakarta.servlet.http.HttpServletRequest request) Issues a new authentication token using a valid refresh token.
-
Method Details
-
login
AuthenticationTokenDto login(LoginUserDto loginUserDto, jakarta.servlet.http.HttpServletRequest request) Authenticates a user using provided credentials and generates authentication tokens.- Parameters:
loginUserDto
- the login credentials including email and passwordrequest
- the HTTP servlet request containing client metadata (IP, user agent)- Returns:
AuthenticationTokenDto
containing the JWT and refresh tokens- Throws:
InvalidUserCredentialsException
- if the credentials are invalidUserNotFoundException
- if the user does not exist- See Also:
-
refreshToken
Issues a new authentication token using a valid refresh token.If the client's IP address or user agent differs significantly from the original login, the system may trigger a security alert to the user's email.
- Parameters:
refreshToken
- the UUID of the refresh token issued at loginrequest
- the HTTP servlet request containing client metadata- Returns:
- a new JWT authentication token as a String
- Throws:
RefreshTokenNotFoundException
- if the refresh token does not existRefreshTokenExpiredException
- if the refresh token has expired- See Also:
-