@sourceloop/authentication-service / Exports / SecureResourceOwnerVerifyProvider
Class: SecureResourceOwnerVerifyProvider¶
Implements¶
Provider<VerifyFunction.SecureResourceOwnerPasswordFn>
Table of contents¶
Constructors¶
Properties¶
Methods¶
Constructors¶
constructor¶
• new SecureResourceOwnerVerifyProvider(userRepository, utRepository, authSecureClientRepository, otpRepository)
Parameters¶
| Name | Type |
|---|---|
userRepository |
UserRepository |
utRepository |
UserTenantRepository |
authSecureClientRepository |
AuthSecureClientRepository |
otpRepository |
OtpRepository |
Defined in¶
Properties¶
authSecureClientRepository¶
• authSecureClientRepository: AuthSecureClientRepository
Defined in¶
otpRepository¶
• otpRepository: OtpRepository
Defined in¶
userRepository¶
• userRepository: UserRepository
Defined in¶
utRepository¶
• utRepository: UserTenantRepository
Defined in¶
Methods¶
ensureUserIsActiveInTenant¶
▸ Private ensureUserIsActiveInTenant(user): Promise<void>
Parameters¶
| Name | Type |
|---|---|
user |
User<DataObject<Model>> |
Returns¶
Promise<void>
Defined in¶
validateClientAccess¶
▸ Private validateClientAccess(clientId, clientSecret, user): Promise<AuthSecureClient>
Parameters¶
| Name | Type |
|---|---|
clientId |
string |
clientSecret |
string |
user |
User<DataObject<Model>> |
Returns¶
Promise<AuthSecureClient>
Defined in¶
value¶
▸ value(): SecureResourceOwnerPasswordFn<IAuthSecureClient, IAuthUser>
The function verifies the secure resource owner password for a client and user.
Returns¶
SecureResourceOwnerPasswordFn<IAuthSecureClient, IAuthUser>
The value() function returns a SecureResourceOwnerPasswordFn function, which is an
asynchronous function that takes clientId, clientSecret, username, and password as parameters.
Inside the function, it verifies the user's password or OTP, checks the user's status, validates
the client, and returns an object containing the client and user if all validations pass.
Implementation of¶
Provider.value
Defined in¶
verifyUserOrOtp¶
▸ Private verifyUserOrOtp(username, password): Promise<User<DataObject<Model>>>
Parameters¶
| Name | Type |
|---|---|
username |
string |
password |
string |
Returns¶
Promise<User<DataObject<Model>>>