Introduction
This guide will help you setup the frontend code to provide authentication to your users.
Prerequisites
Before following this guide, you need to have the backend installed and deployed.
Need help? Ask us on Discord! (You need to purchase the pro plan!↗)
Ask us on DiscordRetrieve data from AWS Cognito
- Connect to your AWS account and go to the Cognito Dashboard (opens in a new tab).
- Select the
boilerpro-cognito
user pool. - Copy the
User Pool ID
in your .env file underNEXT_PUBLIC_COGNITO_USER_POOL_ID
. - Go to the
App Integration
section and copy theCognito domain
in your .env file underNEXT_PUBLIC_COGNITO_DOMAIN
- Go to the
App Integration
section and select theboilerpro-frontend
client. - Copy the
Client ID
in your .env file underNEXT_PUBLIC_APP_CLIENT_ID
- Go back to the
App Integration
section and select theboilerpro-frontend-secret-client
client. - Copy the
Client ID
andClient Secret
in your .env file underAPP_CLIENT_ID
andAPP_CLIENT_SECRET
.
.env
APP_CLIENT_ID=<your_client_id>
APP_CLIENT_SECRET=<your_client_secret>
NEXT_PUBLIC_COGNITO_DOMAIN=<your_cognito_domain>
NEXT_PUBLIC_APP_CLIENT_ID=<your_client_id>
NEXT_PUBLIC_COGNITO_USER_POOL_ID=<your_userpool_id>
Add Authorized Javascript Origins on Google Cloud
- Go to the Google Cloud Console (https://console.cloud.google.com/ (opens in a new tab)) and open your project.
- Go to Credentials and add
<your_cognito_domain>
as an Authorized Javascript domain. - Go to Authorized URI redirect and add
<your_cognito_domain>/oauth2/idpresponse