Overview
For apps that only need user authentication without wallet functionality. This approach uses standard OAuth2/OIDC flow to authenticate users and access their profile information. What you get:- User sign-in/sign-out
- Access to user profile (email, name, picture)
- Access and ID tokens for API calls
- Session management
- Blockchain wallet functionality
- Transaction signing
- Crypto payments
Installation
Before starting, complete the Installation & Setup guide. For authentication-only integration, you only need these packages:OAuth2 Configuration
Civic Auth uses standard OAuth2/OIDC endpoints:- Authorization:
https://auth.civic.com/oauth/auth - Token:
https://auth.civic.com/oauth/token - UserInfo:
https://auth.civic.com/oauth/userinfo - Scopes:
openid profile email
App Scheme Configuration
Before implementing authentication, you need to configure your app scheme properly for mobile redirects.1. Configure app.json/app.config.js
Add your app scheme to your Expo configuration:app.json
app.config.js:
app.config.js
2. Register URL Scheme (iOS)
If using bare workflow, also add to yourios/YourApp/Info.plist:
3. Register Intent Filter (Android)
If using bare workflow, add to yourandroid/app/src/main/AndroidManifest.xml:
Implementation
1. Basic Authentication Flow
React Native applications can integrate with Civic Auth using OAuth2/OIDC-compatible libraries. Popular options include:- Expo AuthSession (Recommended)
- react-native-app-auth
2. Authentication Flow Steps
The implementation follows a standard OAuth2 authorization code flow with PKCE:- User initiates sign-in
- App opens Civic Auth in a WebView
- User authenticates with Civic
- App receives authorization code through redirect
- App exchanges code for tokens
- App fetches user information
3. Example AuthContext
Here’s a complete authentication context using Expo AuthSession:4. Using the AuthContext
Token Management
Access Tokens
Use access tokens to make authenticated API calls to your backend:ID Tokens
ID tokens contain user information and can be verified on your backend:Error Handling
Resources
Next Steps
- Need Web3 functionality? Check out Web3 Wallet Integration
- Review the API Reference for detailed documentation
- Explore example implementations

