This project has been archived due to fundamental security design issues and should not be used in production.
This Chrome extension example demonstrates an insecure authentication pattern that exposes sensitive credentials:
-
API Key Exposure: The WorkOS API key is bundled into the Chrome extension, making it accessible to any user who inspects the extension's code. API keys should never be exposed in client-side code.
-
Cookie Password Exposure: The cookie encryption password is included in the extension's configuration, compromising session security. Cookie passwords must remain server-side only.
-
Direct API Access: Chrome extensions should not make direct calls to authentication APIs with embedded credentials. All authentication flows should be handled through a secure backend service.
If you need to implement authentication in a Chrome extension with WorkOS AuthKit:
- Use a Backend Service: Create a secure backend API that handles all WorkOS authentication operations
- Implement OAuth 2.0 Flow: Use the proper OAuth flow with your backend as the intermediary
- Store Tokens Securely: Use Chrome's storage API with proper encryption for any tokens
- Never Embed Secrets: API keys, client secrets, and cookie passwords must never appear in extension code
For a secure AuthKit integration:
- Set up a backend service that handles AuthKit operations
- Use the Chrome Identity API for OAuth flows
- Communicate with your backend using secure, authenticated requests
- Review the WorkOS AuthKit documentation for server-side implementation
A Chrome extension that integrates with WorkOS AuthKit for authentication management.
authkit-chrome-extension.mp4
- Manage AuthKit sessions within Chrome browser
- Monitor and automatically refresh authentication tokens
- View current session status in popup interface
- Log out from the extension popup
-
Clone this repository
-
Install dependencies:
pnpm install
-
Create a configuration file:
- Copy
config.example.json
toconfig.json
- Fill in your WorkOS credentials:
{ "apiKey": "your_workos_api_key", "clientId": "your_workos_client_id", "cookiePassword": "must be at least 32 characters long", "cookieDomain": "http://localhost:3000", "redirectUri": "http://localhost:3000/callback" }
- Copy
-
Build the extension:
pnpm build
- Open Chrome and go to
chrome://extensions
- Enable "Developer mode" (toggle in top-right corner)
- Click "Load unpacked" button
- Select the
dist_chrome
folder from this project
This extension is designed to work with the next-authkit-example application as an example AuthKit app. You'll need to run both this extension and the next-authkit-example app together for full functionality. The extension will manage the AuthKit sessions created by the example app.
For development with hot reloading:
pnpm dev