Package 'RCognito'

Title: A Simplified Interface for 'Amazon Cognito'
Description: Simplifies integration with 'Amazon Cognito' (<https://aws.amazon.com/cognito/>) for R developers, enabling easy management of user authentication, registration, and password flows.
Authors: Sanjaya J Shetty [aut, cre]
Maintainer: Sanjaya J Shetty <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2024-12-14 06:54:02 UTC
Source: CRAN

Help Index


Change User Password

Description

Change User Password

Usage

change_password(old_password, new_password, token)

Arguments

old_password

A character string representing the user's current password.

new_password

A character string representing the user's new password.

token

A character string representing the user's access token.

Value

A message indicating the success of the password change, or an error if it fails.


Confirm Forgot Password

Description

This function confirms the forgot password process by setting a new password for a user.

Usage

confirm_forgot_password(client_id, username, confirmation_code, new_password)

Arguments

client_id

A character string representing the app client ID.

username

A character string for the user's username.

confirmation_code

A character string for the confirmation code sent to the user.

new_password

A character string for the user's new password.

Value

Nothing (displays a message on success or raises an error if it fails).


Confirm User Sign Up

Description

This function confirms the sign-up process for a user in AWS Cognito.

Usage

confirm_sign_up_user(client_id, userpool, username, verification_code)

Arguments

client_id

A character string representing the app client ID.

userpool

A character string representing the user pool ID.

username

A character string for the user's username.

verification_code

A character string for the verification code sent to the user.

Value

Nothing (displays a message on success or raises an error if it fails).


Initiate Forgot Password Request

Description

Initiate Forgot Password Request

Usage

forgot_password(client_id, username)

Arguments

client_id

A character string representing the app client ID.

username

A character string for the user's username.

Value

Nothing (displays a message on success or raises an error if it fails).


Get User List from Cognito

Description

Retrieve the list of usernames and email addresses from Cognito.

Usage

get_user_list_from_cognito(cognito_client, userpool)

Arguments

cognito_client

The Cognito client.

userpool

A character string representing the user pool ID.

Value

A list containing usernames and email addresses.


Check if an email address is valid.

Description

This function validates the format of an email address.

Usage

is_valid_email(email)

Arguments

email

The email address to be validated.

Value

TRUE if the email is valid, otherwise an error is thrown.


Check if an access token is valid.

Description

This function validates the format of an access token.

Usage

is_valid_token(token)

Arguments

token

The access token to be validated.

Value

TRUE if the token is valid, otherwise an error is thrown.


Sign in to AWS Cognito

Description

Sign in to AWS Cognito

Usage

sign_in(client_id, username, password, authflow = "USER_PASSWORD_AUTH")

Arguments

client_id

A character string representing the app client ID.

username

A character string for the user's username.

password

A character string for the user's password.

authflow

A character string specifying the authentication flow (default: "USER_PASSWORD_AUTH").

Value

A list with user information and tokens if successful; throws an error otherwise.


Sign up a new user to AWS Cognito

Description

Sign up a new user to AWS Cognito

Usage

sign_up_user(client_id, email, username, password, ...)

Arguments

client_id

A character string representing the app client ID.

email

A character string for the user's email address.

username

A character string for the user's username.

password

A character string for the user's password.

...

Additional named user attributes for Cognito (e.g., 'phone_number').

Value

A list with sign-up confirmation details if successful; throws an error otherwise.