A full-stack authentication POC using AWS Cognito User Pools with Google Sign-In, implemented with a React frontend and FastAPI backend. Demonstrates secure login, token handling, and protected API access.
- ✅ Google OAuth 2.0 integration
- ✅ AWS Cognito User Pool authentication
- ✅ React frontend with AWS Amplify
- ✅ FastAPI backend with JWT validation
- ✅ Protected API routes
- ✅ User profile display
auth-poc-google-cognito/
├── backend/
│ ├── main.py # FastAPI application
│ ├── requirements.txt # Python dependencies
│ └── .env.example # Environment variables template
├── frontend/
│ ├── public/
│ │ └── index.html # HTML template
│ ├── src/
│ │ ├── components/
│ │ │ ├── LoginPage.js # Login page component
│ │ │ ├── LoginPage.css
│ │ │ ├── ProfilePage.js # Profile page component
│ │ │ └── ProfilePage.css
│ │ ├── App.js # Main app component
│ │ ├── App.css
│ │ ├── index.js # Entry point
│ │ └── index.css
│ ├── package.json
│ └── .env.example # Environment variables template
├── docs/
│ └── SETUP.md # Detailed setup guide
└── README.md # This file
- Option 1 (Docker - Recommended):
- Docker Desktop
- Docker Compose
- Option 2 (Manual):
- Node.js (v14+)
- Python (3.8+)
- Both options:
- AWS Account
- Google Cloud Platform Account
git clone https://github.com/capt-farvez/auth-poc-google-cognito.git
cd auth-poc-google-cognitoSee Google Console Setup and AWS Cognito Setup for detailed instructions on setting up Google OAuth credentials and AWS Cognito User Pool.
Create backend/.env:
COGNITO_REGION=us-east-1
COGNITO_USER_POOL_ID=us-east-1_XXXXXXXXX
COGNITO_APP_CLIENT_ID=your-app-client-idCreate frontend/.env:
REACT_APP_COGNITO_REGION=us-east-1
REACT_APP_COGNITO_USER_POOL_ID=us-east-1_XXXXXXXXX
REACT_APP_COGNITO_APP_CLIENT_ID=your-app-client-id
REACT_APP_COGNITO_DOMAIN=your-domain.auth.us-east-1.amazoncognito.comChoose one of the following options:
- Option A: Using Docker (Recommended) - See Run in Docker
- Option B: Running Locally Without Docker - See Run Locally
- Navigate to http://localhost:3000
- Click "Sign in with Google"
- Authenticate with your Google account
- You'll be redirected to the profile page
- Profile page shows:
- Your Google account information
- Authentication status
- Backend API connection status
MIT
This is a POC project. Feel free to fork and modify for your needs.