Mantis MUI React
v3.5.0
v3.5.0
  • Documentation
  • Pre-requisites
  • Quick Start
  • Package
  • Folder Structure
  • State Management
  • Internationalization
  • Authentication
    • Switch to Auth0
    • Switch to Firebase
    • Switch to AWS Cognito
    • Switch to Supabase
  • Axios API Calls
  • Routing
  • Project Configuration
  • Color Presets
  • Theme/Style Configuration
  • How to
    • Login as First Page
    • Dashboard as First Page
    • Render Menu from the backend
    • Remove menu render from Backend
    • Remove Authentication
      • Vite
      • NextJS
  • Figma
  • Integration
    • Seed
    • To Existing Project
    • Comparison
  • Components
    • Avatar
    • BreadCrumb
    • Button
    • Dot
    • Main Card
    • Progress
    • SnackBar
    • Tooltip
    • Transitions
  • Dependencies
  • Roadmap
  • Support
  • Changelog
  • Mantis Eco System
  • FAQ
Powered by GitBook
On this page
  1. Authentication

Switch to AWS Cognito

PreviousSwitch to FirebaseNextSwitch to Supabase

JWT to AWS Cognito

  1. Set AWS Config

At present, AWS uses a dummy config, so we don't need to change anything, but in actual implementation, you need to set poolId and appClientId in the following file. For more detail refer to AWS here:

.env
...

## AWS
VITE_APP_AWS_POOL_ID=
VITE_APP_AWS_APP_CLIENT_ID=

...
  1. Change Config

src\config.ts
export const APP_AUTH: AuthProvider = AuthProvider.AWS;
  1. Change AuthProvider

Comment another provider in the following file and uncomment Aws one.

src/App.tsx
import { AWSCognitoProvider as AuthProvider } from 'contexts/AWSCognitoContext';
  1. Change Auth Hooks

Comment another context in the following file and uncomment Aws one.

src/hooks/useAuth.ts
import AuthContext from 'contexts/AWSCognitoContext';

JWT to AWS Cognito

  1. Set AWS Config

.env
...

## AWS
VITE_APP_AWS_POOL_ID=
VITE_APP_AWS_APP_CLIENT_ID=

...
  1. Change Config

src\config.ts
export const APP_AUTH: AuthProvider = AuthProvider.AWS;
  1. Change AuthProvider

Comment another provider in the following file and uncomment Aws one.

src/App.tsx
import { AWSCognitoProvider as AuthProvider } from 'contexts/AWSCognitoContext';
  1. Change Auth Hooks

Comment another context in the following file and uncomment Aws one.

src/hooks/useAuth.ts
import AuthContext from 'contexts/AWSCognitoContext';

At present, AWS uses a dummy config, so we don't need to change anything, but in actual implementation, you need to set poolId and appClientId in the following file. For more detail refer to AWS here:

For nextJS, refer next-auth site:

For nextJS, refer next-auth site:

https://aws.amazon.com/cognito/
https://aws.amazon.com/cognito/
https://next-auth.js.org/providers/cognito
https://next-auth.js.org/providers/cognito