Class WorkerAuthServiceImpl
java.lang.Object
it.univr.passportease.service.worker.impl.WorkerAuthServiceImpl
- All Implemented Interfaces:
WorkerAuthService
Implementation of
WorkerAuthService, provides methods for authentication of Worker-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.springframework.security.authentication.AuthenticationManagerService for authenticatingWorkerprivate final JwtServiceService for generatingJWTprivate final MapWorkerService for mappingWorkertoLoginOutputprivate final OfficeRepositoryRepository forOfficeentityprivate org.springframework.security.crypto.password.PasswordEncoderService for encoding passwordprivate final WorkerRepositoryRepository forWorkerentity -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
workerRepository
Repository forWorkerentity -
officeRepository
Repository forOfficeentity -
mapWorker
Service for mappingWorkertoLoginOutput -
jwtService
Service for generatingJWT -
authenticationManager
private org.springframework.security.authentication.AuthenticationManager authenticationManagerService for authenticatingWorker -
passwordEncoder
private org.springframework.security.crypto.password.PasswordEncoder passwordEncoderService for encoding password
-
-
Constructor Details
-
WorkerAuthServiceImpl
public WorkerAuthServiceImpl()
-
-
Method Details
-
login
public LoginOutput login(String username, String password) throws WrongPasswordException, WorkerNotFoundException Login aWorker- Specified by:
loginin interfaceWorkerAuthService- Parameters:
username- username ofWorkerpassword- password ofWorker- Returns:
LoginOutputwithJWTSetofWorker- Throws:
WrongPasswordException- if password is wrongWorkerNotFoundException- ifWorkeris not found
-
register
@Deprecated(since="0.0.1") public LoginOutput register(WorkerInput workerInput) throws OfficeNotFoundException Deprecated.Register aWorker- Specified by:
registerin interfaceWorkerAuthService- Parameters:
workerInput-WorkerInputwith data ofWorker- Returns:
LoginOutputwithJWTSetofWorker- Throws:
OfficeNotFoundException- ifOfficeis not found
-
JWTofWorker, it's deprecated because theWorkeris inserted in the database manually by the administrator