Documentation ¶
Index ¶
- Variables
- func ChangePassword(ctx context.Context, accessToken string, oldPassword string, ...) error
- func ForgotPassword(ctx context.Context, emailAddress string) (*cognitoidentityprovider.ForgotPasswordOutput, error)
- func ForgotPasswordConfirm(ctx context.Context, confirmationCode string, emailAddress string, ...) error
- func Initialize(ctx context.Context, profile string, region string, cognitoUserPoolID string, ...) error
- func SignIn(ctx context.Context, emailAddress string, password string) (*cognitoidentityprovider.InitiateAuthOutput, error)
- func SignUp(ctx context.Context, emailAddress string, password string) (string, error)
- func SignUpConfirm(ctx context.Context, emailAddress string, confirmationCode string) error
- func UpdateExpiredPassword(ctx context.Context, session string, emailAddress string, password string) (*cognitoidentityprovider.RespondToAuthChallengeOutput, error)
Constants ¶
This section is empty.
Variables ¶
var ( // CognitoClient is the client that interacts with Cognito. CognitoClient *cognitoidentityprovider.Client // CognitoUserPoolID is the id of the user pool in Cognito. CognitoUserPoolID string // CognitoClientID is the id of the user pool client in Cognito. CognitoClientID string )
Functions ¶
func ChangePassword ¶
func ChangePassword(ctx context.Context, accessToken string, oldPassword string, newPassword string) error
ChangePassword changes a user's password.
- Use auth.ForgotPassword if the user doesn't know their password.
- Use auth.UpdateExpiredPassword if the user has a requirement for their password to be changed.
func ForgotPassword ¶
func ForgotPassword(ctx context.Context, emailAddress string) (*cognitoidentityprovider.ForgotPasswordOutput, error)
ForgotPassword will initiate a forgot password request.
- Use auth.ChangePassword and auth.ChangePasswordConfirm to update a user's password that doesn't require resetting.
- Use auth.UpdateExpiredPassword if the user has a requirement for their password to be changed.
func ForgotPasswordConfirm ¶
func ForgotPasswordConfirm(ctx context.Context, confirmationCode string, emailAddress string, newPassword string) error
ForgotPasswordConfirm will confirm a forgot password request.
func Initialize ¶
func Initialize(ctx context.Context, profile string, region string, cognitoUserPoolID string, cognitoClientID string) error
Initialize will initialize the auth package. Both profile and region parameters are option if authentication can be achieved via another method. For example, environment variables or IAM roles.
func SignIn ¶
func SignIn(ctx context.Context, emailAddress string, password string) (*cognitoidentityprovider.InitiateAuthOutput, error)
SignIn will attempt to sign a user in, returning the result.
func SignUpConfirm ¶
SignUpConfirm confirms a newly signed up user with the confirmation code they received.
func UpdateExpiredPassword ¶ added in v0.4.0
func UpdateExpiredPassword(ctx context.Context, session string, emailAddress string, password string) (*cognitoidentityprovider.RespondToAuthChallengeOutput, error)
UpdateExpiredPassword updates a password for a user that has a requirement for their password to be changed. The session parameter can be obtained from the output.Session return value of auth.SignIn.
- Use auth.ForgotPassword if the user doesn't know their password.
- Use auth.ChangePassword and auth.ChangePasswordConfirm to update a user's password that doesn't require resetting.
Types ¶
This section is empty.