OAuth 2.0
Quick Start Options
Choose the path that best fits your needs:
Starting a New Application
Recommended: Use the Fanvue App Starter Kit
Our starter kit provides:
- Pre-configured OAuth 2.0 flow with PKCE
- Secure token management
- Best practices built-in
- Next.js template ready to deploy
Simply clone the repository, add your OAuth credentials, and you’re ready to build.
Adding OAuth to an Existing Application
If you’re integrating OAuth into an existing application, follow the implementation steps below. For detailed technical specifications and code examples, see our OAuth 2.0 Implementation Guide.
Implementation Steps
Here’s the high-level flow for implementing OAuth 2.0:
1. Generate PKCE Parameters
Create code_verifier and code_challenge cryptographically.
TypeScript
Python
2. Store Code Verifier
Save code_verifier securely in your session/cookie.
TypeScript
Python
3. Authorization Request
Redirect users to Fanvue with code_challenge and code_challenge_method=S256.
TypeScript
Python
4. User Consent
User logs in to Fanvue and approves the requested permissions (handled by Fanvue).
5. Authorization Grant
Fanvue redirects back to your app with an authorization code (handled by Fanvue).
6. Token Exchange
Exchange the authorization code for tokens, including the original code_verifier.
TypeScript
Python
7. API Access
Use the access token to make authenticated API requests.
TypeScript
Python
8. Token Refresh
Use refresh tokens to get new access tokens when they expire.
TypeScript
Python
PKCE (Proof Key for Code Exchange) is required for all OAuth 2.0 flows. It’s a security extension that prevents authorization code interception attacks. See the Implementation Guide for detailed PKCE implementation instructions and complete examples.
Next Steps
Ready to Build?
- New Project: Clone the Fanvue App Starter Kit and follow the README
- Complete Tutorial: See our Quickstart Guide for a step-by-step walkthrough
- Technical Details: Review the OAuth 2.0 Implementation Guide for PKCE implementation, token exchange specs, and troubleshooting
Need Help?
- App Management: Visit the developer portal to manage your OAuth applications
- API Reference: Check our API documentation for endpoint details
- Starter Template: Explore the Fanvue App Starter Kit source code