Google Login
Options
Example
React Component
GitHub Login
Options
Example
React Component
OAuth Flow
- User clicks social login button
- SDK redirects to OAuth provider (Google/GitHub)
- User authorizes your application
- Provider redirects back with auth code
- SDK exchanges code for session
- User is logged in and redirected
Configuration
Enable OAuth Providers
- Go to Settings > Authentication in your dashboard
- Enable Google and/or GitHub
- Add your OAuth credentials
Google Setup
- Go to Google Cloud Console
- Create a new project or select existing
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add authorized redirect URI:
https://api.usegately.com/api/v1/sso/google/callback - Copy Client ID and Client Secret to Gately
GitHub Setup
- Go to GitHub Developer Settings
- Create a new OAuth App
- Set Authorization callback URL:
https://api.usegately.com/api/v1/sso/github/callback - Copy Client ID and Client Secret to Gately
Custom Domain
If you have a custom domain configured:Handling OAuth Redirect
The SDK automatically handles OAuth redirects. After successful authentication:- Session is saved to localStorage
- Cookies are set for cross-origin requests
gately:auth-successevent is dispatched- User is redirected to
redirectToURL