Create a React Native app and implement user authentication with Auth0
Budget: £20 – £250 GBP
Requirements (For reference link please check the attached document)
Important: Please note that all work specified below must be implemented and demonstrated using the resources we provide. Access to these resources will be granted upon acceptance of the project. Implementation or demonstration on personal resources will not be considered as fulfilment of the work.
Create a React Native app and implement user authentication with Auth0:
Develop a basic React Native application to demonstrate the following authentication flows (Refer to the Auth0 React Native template: Auth0 React Native Login):
○ Email/password registration.
○ Email/password login.
○ Social login via Google
○ Social login via Apple.
Upon successful authentication, the id token and access token of the logged-in user should be returned by Auth0 to the React Native app.
Note: Implement the authentication using Auth0’s Proof Key for Code Exchange (PKCE) mechanism for token verification: PKCE Auth Flow instead of the traditional client ID / client secret method.
AWS API Gateway Endpoints Implementation:
Implement the below AWS API Gateway endpoints. The endpoints should have the user access token as bearer tokens for authentication during invocation.
1. Create a POST endpoint to allow users to submit reviews Endpoint: POST spaces/:spaceId/reviews
Payload:
{
"rating": 4,
"comment": "Great location and neatly maintained."
}
Success Response: Status Code 201 (Created)
Error Response: Return appropriate status codes (e.g., 404, 501).
○ Create a GET endpoint for users to view reviews Endpoint: GET spaces/:spaceId/reviews
Success Response: A JSON array of reviews:
[
{
"reviewer": "John Doe",
"rating": 4,
"comment": "Perfect location"
}, {
"reviewer": "Jane Doe",
"rating": 3,
"comment": "Not as good as expected."
} ]
Error Response: Return appropriate status codes (e.g., 404, 501).
AWS Infrastructure Implementation:
AWS Infrastructure Setup:
○ Implement CloudFormation templates to provision any AWS API Gateway endpoint as mentioned above.
○ Create a Custom Authorizer (Lambda function) to verify user access tokens with Auth0 and return IAM policies to accept or deny the API requests.
○ Provision a PostgreSQL database on AWS RDS with a users table. The table should include columns id and sub (the unique key), where sub is retrieved from the user's token.
CI/CD and Automation:
1. CI/CD Integration:
■ Store all CloudFormation templates in the GitHub infra repository. Ensure that
changes to this repository trigger an infrastructure deployment via AWS
CodePipeline.
■ Deploy all Lambda functions to a GitHub code repository, and ensure that
changes trigger an automated build and deployment pipeline.
2. Implement an automated process to create the new users in db as per the below flow:
○ Upon new user registration in Auth0, using the React Native app (via email/password or social login), Auth0 triggers a notification to AWS using Auth0 Actions (potentially post-user registration trigger).
References:
■ Auth0 Actions.
■ Post-user Registration Trigger.
○ The AWS Lambda function receives this notification through an AWS API
Gateway POST endpoint.
○ The Lambda function creates a corresponding user record in PostgreSQL
using Amazon RDS.
○ Implement IAM policies to protect this user creation endpoint, ensuring only
Auth0 can invoke it.
Important: Please note that all work specified below must be implemented and demonstrated using the resources we provide. Access to these resources will be granted upon acceptance of the project. Implementation or demonstration on personal resources will not be considered as fulfilment of the work.
Create a React Native app and implement user authentication with Auth0:
Develop a basic React Native application to demonstrate the following authentication flows (Refer to the Auth0 React Native template: Auth0 React Native Login):
○ Email/password registration.
○ Email/password login.
○ Social login via Google
○ Social login via Apple.
Upon successful authentication, the id token and access token of the logged-in user should be returned by Auth0 to the React Native app.
Note: Implement the authentication using Auth0’s Proof Key for Code Exchange (PKCE) mechanism for token verification: PKCE Auth Flow instead of the traditional client ID / client secret method.
AWS API Gateway Endpoints Implementation:
Implement the below AWS API Gateway endpoints. The endpoints should have the user access token as bearer tokens for authentication during invocation.
1. Create a POST endpoint to allow users to submit reviews Endpoint: POST spaces/:spaceId/reviews
Payload:
{
"rating": 4,
"comment": "Great location and neatly maintained."
}
Success Response: Status Code 201 (Created)
Error Response: Return appropriate status codes (e.g., 404, 501).
○ Create a GET endpoint for users to view reviews Endpoint: GET spaces/:spaceId/reviews
Success Response: A JSON array of reviews:
[
{
"reviewer": "John Doe",
"rating": 4,
"comment": "Perfect location"
}, {
"reviewer": "Jane Doe",
"rating": 3,
"comment": "Not as good as expected."
} ]
Error Response: Return appropriate status codes (e.g., 404, 501).
AWS Infrastructure Implementation:
AWS Infrastructure Setup:
○ Implement CloudFormation templates to provision any AWS API Gateway endpoint as mentioned above.
○ Create a Custom Authorizer (Lambda function) to verify user access tokens with Auth0 and return IAM policies to accept or deny the API requests.
○ Provision a PostgreSQL database on AWS RDS with a users table. The table should include columns id and sub (the unique key), where sub is retrieved from the user's token.
CI/CD and Automation:
1. CI/CD Integration:
■ Store all CloudFormation templates in the GitHub infra repository. Ensure that
changes to this repository trigger an infrastructure deployment via AWS
CodePipeline.
■ Deploy all Lambda functions to a GitHub code repository, and ensure that
changes trigger an automated build and deployment pipeline.
2. Implement an automated process to create the new users in db as per the below flow:
○ Upon new user registration in Auth0, using the React Native app (via email/password or social login), Auth0 triggers a notification to AWS using Auth0 Actions (potentially post-user registration trigger).
References:
■ Auth0 Actions.
■ Post-user Registration Trigger.
○ The AWS Lambda function receives this notification through an AWS API
Gateway POST endpoint.
○ The Lambda function creates a corresponding user record in PostgreSQL
using Amazon RDS.
○ Implement IAM policies to protect this user creation endpoint, ensuring only
Auth0 can invoke it.