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
Modifier and TypeFieldDescriptionprivate org.springframework.security.authentication.AuthenticationManager
Service for authenticatingWorker
private final JwtService
Service for generatingJWT
private final MapWorker
Service for mappingWorker
toLoginOutput
private final OfficeRepository
Repository forOffice
entityprivate org.springframework.security.crypto.password.PasswordEncoder
Service for encoding passwordprivate final WorkerRepository
Repository forWorker
entity -
Constructor Summary
-
Method Summary
-
Field Details
-
workerRepository
Repository forWorker
entity -
officeRepository
Repository forOffice
entity -
mapWorker
Service for mappingWorker
toLoginOutput
-
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:
login
in interfaceWorkerAuthService
- Parameters:
username
- username ofWorker
password
- password ofWorker
- Returns:
LoginOutput
withJWTSet
ofWorker
- Throws:
WrongPasswordException
- if password is wrongWorkerNotFoundException
- ifWorker
is not found
-
register
@Deprecated(since="0.0.1") public LoginOutput register(WorkerInput workerInput) throws OfficeNotFoundException Deprecated.Register aWorker
- Specified by:
register
in interfaceWorkerAuthService
- Parameters:
workerInput
-WorkerInput
with data ofWorker
- Returns:
LoginOutput
withJWTSet
ofWorker
- Throws:
OfficeNotFoundException
- ifOffice
is not found
-
JWT
ofWorker
, it's deprecated because theWorker
is inserted in the database manually by the administrator