A web application for generating authentication tokens for Zego services. This tool provides a user-friendly interface for creating and managing tokens with various permissions and configurations.
- Generate tokens with customizable parameters
- Create basic tokens with empty payload
- Configure App ID and Server Secret securely
- LDAP authentication for secure access
- Token history tracking and management
- Copy tokens to clipboard with one click
- Responsive design for various screen sizes
.
├── conf/ # Configuration files
│ ├── env.conf # Environment configuration (App ID and Server Secret)
│ └── token-history.json # Token history storage
├── page/ # HTML pages
│ └── login.html # Login page
├── server/ # Server-side code
│ ├── server.js # Main server implementation
│ ├── start-server.js # Server startup script
│ ├── tokenHistory.js # Token history management
│ ├── zegoServerAssistant.js # Token generation utilities
│ └── zegoServerAssistant.ts # TypeScript version of token utilities
├── style/ # CSS stylesheets
│ ├── styles.css # Main application styles
│ └── login-styles.css # Login page styles
├── index.html # Main application page
├── package.json # Project dependencies and scripts
├── package-lock.json # Dependency lock file
└── test-api.js # API testing utilities
- Node.js (v14 or higher)
- npm (v6 or higher)
-
Clone the repository:
git clone https://github.com/yourusername/zego-token-generator.git cd zego-token-generator -
Install dependencies:
npm install -
Configure the application:
- Create a
conf/env.conffile with your App ID and Server Secret (this will be created automatically on first run if it doesn't exist)
- Create a
-
Start the server:
npm start -
Open your browser and navigate to:
http://localhost:3000 -
Log in with your LDAP credentials
-
Configure your App ID and Server Secret if not already set
-
Generate tokens by filling in the required fields and clicking "Generate" or "Generate Basic Token"
POST /generate-token: Generate token with payloadPOST /generate-basic-token: Generate basic token with empty payloadPOST /save-config: Save configurationGET /get-config: Get configurationGET /get-token-history: Get token historyPOST /api/login: Login with LDAP credentialsPOST /api/logout: Logout and clear sessionPOST /api/clear-cookies: Clear all cookies and sessionGET /api/check-login-status: Check if user is logged in
- LDAP authentication for secure access
- Secure storage of App ID and Server Secret
- Session management with automatic logout
- No hardcoded credentials
- Base64 encoding of sensitive information
To run the application in development mode:
npm run dev
This will start both the main server and API server concurrently.
This project is licensed under the MIT License - see the LICENSE file for details.
- Zego for providing the token generation SDK
- Express.js for the web server framework
- All contributors who have helped improve this tool