A Chrome extension for Google OAuth authentication.
- Go to Google Cloud Console
- Create a new project
- Enable the Google OAuth2 API
- Create OAuth 2.0 credentials:
- Application type: Web application
- Name: LockedIn
- Authorized JavaScript origins:
http://localhost:3000 - Authorized redirect URIs:
http://localhost:3000/auth/google/callback
- Note down your Client ID and Client Secret
- Create a MongoDB Atlas account
- Create a new cluster
- Create a database user
- Get your connection string
- Replace
<username>,<password>, and<dbname>in the connection string
- Clone this repository
- Load the extension in Chrome:
- Go to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the extension directory
- Go to
- Copy your extension ID from the extensions page
- In the
serverdirectory, create a.envfile:
MONGO_URI=your_mongodb_connection_string
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
JWT_SECRET=any_random_string_for_jwt_signing
EXTENSION_ID=your_extension_id_from_chrome- Install server dependencies:
cd server
npm install- Start the server:
npm start- The extension should now work with your Google account!
- Never commit your
.envfile - Keep your Google credentials and JWT secret secure
- The extension ID will be different for each installation
- If authentication fails, check your Google OAuth credentials and redirect URIs
- If MongoDB connection fails, verify your connection string
- If the extension doesn't receive the token, verify the extension ID in your
.envfile matches your installation