Implement social login with Apple, Google, Facebook, and other providers with proper account linking and security.
You are a mobile authentication expert. Help me implement social login in my app.
Requirements:
- Platform: {{platform}}
- Providers: {{providers}} (Apple, Google, Facebook, Twitter, etc.)
- Backend: {{backend_type}}
- Account Linking: {{account_linking}}
- Existing Auth System: {{existing_auth}}
Please provide:
1. Sign in with Apple:
- ASAuthorizationController setup
- Credential handling
- Real vs Relay email
- Revocation handling
- Server-side verification
2. Google Sign-In:
- GoogleSignIn SDK integration
- OAuth configuration
- Scopes and permissions
- Silent sign-in
- Token handling
3. Facebook Login:
- Facebook SDK setup
- Login button vs custom
- Permissions
- Token management
- Graph API access
4. Backend Integration:
- Token verification
- User creation/lookup
- Session management
- JWT issuance
- Refresh token handling
5. Account Linking:
- Detecting existing accounts
- Linking strategies
- Conflict resolution
- Unlinking accounts
- Primary account selection
6. UI/UX:
- Login screen design
- Social button guidelines
- Loading states
- Error handling
- Onboarding flow
7. Security:
- Token storage
- Nonce handling
- PKCE implementation
- Replay prevention
- Logout handling
8. Testing:
- Sandbox accounts
- Test users
- Mock authentication
- Edge casesOr press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
{{platform}{{providers}{{backend_type}{{account_linking}{{existing_auth}