Package api.mpba.rastvdmy.service.impl
Class AuthServiceImpl
java.lang.Object
api.mpba.rastvdmy.service.generator.FinancialDataGenerator
api.mpba.rastvdmy.service.impl.AuthServiceImpl
- All Implemented Interfaces:
AuthService
This class implements the AuthService interface and provides functionalities for user authentication
and registration within the banking application.
It manages user profiles, authentication tokens,
and ensures data validation during the signup and login processes.
-
Constructor Summary
ConstructorDescriptionAuthServiceImpl
(UserProfileRepository userProfileRepository, org.springframework.security.authentication.AuthenticationManager authenticationManager, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder, CurrencyDataRepository currencyDataRepository, GenerateAccessToken generateAccessToken, UserDataValidator userDataValidator) Constructor for the AuthServiceImpl class. -
Method Summary
Modifier and TypeMethodDescriptionauthenticate
(UserLoginRequest request) Authenticates an existing user and generates an access token.signUp
(UserProfileRequest request) Registers a new user profile in the system.Methods inherited from class api.mpba.rastvdmy.service.generator.FinancialDataGenerator
generateAccountNumber, generateBankNumber, generateCardNumber, generateCvv, generateIban, generatePin, generateSwift, getRandomExpirationDate, getRandomStartDate
-
Constructor Details
-
AuthServiceImpl
public AuthServiceImpl(UserProfileRepository userProfileRepository, org.springframework.security.authentication.AuthenticationManager authenticationManager, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder, CurrencyDataRepository currencyDataRepository, GenerateAccessToken generateAccessToken, UserDataValidator userDataValidator) Constructor for the AuthServiceImpl class.- Parameters:
userProfileRepository
- Repository for user profile operations.authenticationManager
- Manages the authentication processes.passwordEncoder
- Encodes user passwords for secure storage.currencyDataRepository
- Repository for currency data operations.generateAccessToken
- Generates access tokens for authenticated users.userDataValidator
- Validates user data during registration.
-
-
Method Details
-
signUp
Registers a new user profile in the system.- Specified by:
signUp
in interfaceAuthService
- Parameters:
request
- Contains the user profile details to register.- Returns:
- JwtAuthResponse containing the generated JWT token and its expiration details.
- Throws:
Exception
- if there is an error during the registration process.
-
authenticate
Authenticates an existing user and generates an access token.- Specified by:
authenticate
in interfaceAuthService
- Parameters:
request
- Contains the login credentials (email and password).- Returns:
- JwtAuthResponse containing the generated JWT token and its expiration details.
-