Overview
Dependify uses GitHub OAuth 2.0 to authenticate users and access repositories. This ensures secure, token-based authentication without requiring your GitHub password.Authentication Flow
User Initiates OAuth
When you click “Continue with GitHub” on dependify.vercel.app, you’re redirected to GitHub’s authorization page.Redirect URL:
GitHub Authorization
On GitHub’s page, you’ll see:
- The Dependify application name
- Requested permissions (repository access)
- Option to authorize or cancel
OAuth Code Exchange
After authorization, GitHub redirects back to Dependify with a temporary authorization code:Dependify’s backend exchanges this code for an access token by calling:
This happens automatically in the background. You don’t need to do anything.
JWT Token Creation
Once Dependify receives your GitHub access token, it creates a JWT (JSON Web Token) for API authentication:Token Contents:
- Your GitHub user ID
- Your GitHub username
- GitHub access token (for API calls)
- Expiration timestamp (24 hours from creation)
Required Permissions
Dependify requests the following GitHub OAuth scopes:public_repo (Implicit)
Access to your public repositories:
- Read repository contents
- Create branches
- Push commits
- Create pull requests
repo (For Private Repositories)
If you want to modernize private repositories, you’ll need to grant full repository access:
- All
public_repopermissions - Access to private repositories
- Fork creation
What Dependify Does With Your Token
Your GitHub access token is used exclusively for:- Reading repository files - To analyze code for modernization
- Creating forks - For repositories you don’t own
- Creating branches - To store modernized code
- Pushing commits - To submit changes
- Creating pull requests - To propose changes
Security Note: Tokens are encrypted in transit and at rest. They are never logged or shared with third parties.
Session Management
Token Expiration
- You’ll be automatically redirected to re-authenticate
- Your GitHub OAuth token remains valid (doesn’t require re-authorization)
- A new JWT is issued seamlessly
Session Duration
Server-side sessions last 7 days from your last activity. After 7 days of inactivity:- You’ll need to click “Continue with GitHub” again
- GitHub may or may not require re-authorization (depends on their cache)
Verification
To check if you’re authenticated, Dependify calls:Token Verification
Every API request goes through token verification:Invalid or expired tokens automatically trigger re-authentication. You don’t need to manually handle this.
Security Best Practices
For Users
- Review Permissions - Always check what permissions you’re granting
- Revoke Access - You can revoke Dependify’s access anytime from GitHub Settings > Applications
- Use 2FA - Enable two-factor authentication on your GitHub account
For Developers
- Never Log Tokens - GitHub tokens are sensitive credentials
- Use Environment Variables - Store OAuth secrets in
.envfiles - Rotate Secrets - Regularly rotate your
API_SECRET_KEY
Rate Limiting
To prevent abuse, authentication endpoints are rate-limited:- 10 OAuth exchanges per minute - Prevents brute-force attacks
- 100 API requests per hour - For repository modernization
If you hit rate limits, wait a few minutes and try again. Limits reset on a rolling window basis.
Troubleshooting
”Invalid token” Error
Cause: Your JWT has expired or is malformed. Solution: Refresh the page and re-authenticate.”GitHub OAuth error: bad_verification_code”
Cause: The OAuth code expired (codes are single-use and expire after 10 minutes). Solution: Start the OAuth flow again from the beginning.”Token has expired”
Cause: Your JWT is older than 24 hours. Solution: Click “Continue with GitHub” to get a new token.”Failed to access repository”
Cause: Your GitHub token lacks necessary permissions. Solution:- Revoke Dependify’s access on GitHub
- Re-authenticate and grant full
reposcope - Try again
Environment Variables
If you’re running Dependify locally or self-hosting, configure these variables:API Integration
To use Dependify’s API programmatically:- Get your JWT token from the browser’s localStorage after authenticating
- Include it in requests:
See the API Reference for complete integration details.
Next Steps
First Modernization
Now that you’re authenticated, modernize your first repository
API Reference
Integrate authentication into your own applications