Class UserPasswordAuthProviderClientImpl
- java.lang.Object
-
- com.mongodb.stitch.core.auth.providers.internal.CoreAuthProviderClient<StitchRequestClient>
-
- com.mongodb.stitch.core.auth.providers.userpassword.internal.CoreUserPasswordAuthProviderClient
-
- com.mongodb.stitch.server.core.auth.providers.userpassword.internal.UserPasswordAuthProviderClientImpl
-
- All Implemented Interfaces:
UserPasswordAuthProviderClient
public final class UserPasswordAuthProviderClientImpl extends CoreUserPasswordAuthProviderClient implements UserPasswordAuthProviderClient
The implementation of the User/Password authentication provider client.
-
-
Field Summary
-
Fields inherited from interface com.mongodb.stitch.server.core.auth.providers.userpassword.UserPasswordAuthProviderClient
factory
-
-
Constructor Summary
Constructors Constructor Description UserPasswordAuthProviderClientImpl(String providerName, StitchRequestClient requestClient, StitchAuthRoutes routes)
Constructs a new User/Password authentication provider client.
-
Method Summary
Modifier and Type Method Description void
callResetPasswordFunction(String email, String password, List<?> args)
Call a reset password function configured to the provider.void
confirmUser(String token, String tokenId)
Confirms a user with the given token and token id.void
registerWithEmail(String email, String password)
Registers a new user with the given email and password.void
resendConfirmationEmail(String email)
Resend the confirmation for a user to the given email.void
resetPassword(String token, String tokenId, String password)
Resets the password of a user with the given token, token id, and new password.void
sendResetPasswordEmail(String email)
Sends a user a password reset email for the given email.-
Methods inherited from class com.mongodb.stitch.core.auth.providers.userpassword.internal.CoreUserPasswordAuthProviderClient
callResetPasswordFunctionInternal, confirmUserInternal, registerWithEmailInternal, resendConfirmationEmailInternal, resetPasswordInternal, sendResetPasswordEmailInternal
-
Methods inherited from class com.mongodb.stitch.core.auth.providers.internal.CoreAuthProviderClient
getBaseRoute, getProviderName, getRequestClient
-
-
-
-
Constructor Detail
-
UserPasswordAuthProviderClientImpl
public UserPasswordAuthProviderClientImpl(String providerName, StitchRequestClient requestClient, StitchAuthRoutes routes)
Constructs a new User/Password authentication provider client.- Parameters:
providerName
- the provider this client is for.requestClient
- the request client used to make requests against Stitch.routes
- the routes needed by the request client.
-
-
Method Detail
-
registerWithEmail
public void registerWithEmail(String email, String password)
Registers a new user with the given email and password.- Specified by:
registerWithEmail
in interfaceUserPasswordAuthProviderClient
- Parameters:
email
- the email to register with. This will be the username used during log in.password
- the password to associated with the email. The password must be between 6 and 128 characters long.
-
confirmUser
public void confirmUser(String token, String tokenId)
Confirms a user with the given token and token id.- Specified by:
confirmUser
in interfaceUserPasswordAuthProviderClient
- Parameters:
token
- the confirmation token.tokenId
- the id of the confirmation token.
-
resendConfirmationEmail
public void resendConfirmationEmail(String email)
Resend the confirmation for a user to the given email.- Specified by:
resendConfirmationEmail
in interfaceUserPasswordAuthProviderClient
- Parameters:
email
- the email of the user.
-
resetPassword
public void resetPassword(String token, String tokenId, String password)
Resets the password of a user with the given token, token id, and new password.- Specified by:
resetPassword
in interfaceUserPasswordAuthProviderClient
- Parameters:
token
- the reset password token.tokenId
- the id of the reset password token.password
- the new password for the user. The password must be between 6 and 128 characters long.
-
sendResetPasswordEmail
public void sendResetPasswordEmail(String email)
Sends a user a password reset email for the given email.- Specified by:
sendResetPasswordEmail
in interfaceUserPasswordAuthProviderClient
- Parameters:
email
- the email of the user.
-
callResetPasswordFunction
public void callResetPasswordFunction(String email, String password, List<?> args)
Call a reset password function configured to the provider.- Specified by:
callResetPasswordFunction
in interfaceUserPasswordAuthProviderClient
- Parameters:
email
- the email of the userpassword
- the new password to setargs
- arguments to be provided to the reset function
-
-