This page provides a high-level introduction to the Auth0.Android SDK, including its purpose, main capabilities, and core components. For detailed architectural information, see Architecture Overview. For installation and setup instructions, see Getting Started.
Auth0.Android is an Android SDK that provides authentication and authorization capabilities for Android applications. It enables developers to integrate Auth0's identity platform into their Android apps through a comprehensive set of APIs for:
Requirements:
Installation:
Sources: README.md1-58
| Capability | Description | Primary API |
|---|---|---|
| Web Authentication | Browser-based login using Auth0 Universal Login with OAuth 2.0 + PKCE | WebAuthProvider |
| API Authentication | Direct authentication without browser: database login, passwordless, MFA, passkeys, social tokens | AuthenticationAPIClient |
| Credential Management | Automatic token storage, refresh, and retrieval with optional encryption and biometric protection | CredentialsManager, SecureCredentialsManager |
| User Management | Profile retrieval, metadata updates, identity linking | UsersAPIClient |
| Self-Service Management | User-initiated authentication method enrollment (passkeys, phone, email, TOTP) | MyAccountAPIClient |
| Security Features | PKCE, DPoP token binding, ID token verification, encrypted storage, biometric authentication | Cross-cutting features |
Sources: README.md17-476 Diagram 1, Diagram 4
The SDK exposes four main client classes that applications interact with:
WebAuthProvider - Browser-based authentication
WebAuthProvider.login(account) and WebAuthProvider.logout(account)AuthenticationAPIClient - Direct authentication API
AuthenticationAPIClient(account)Credentials object containing tokensCredentialsManager / SecureCredentialsManager - Token storage
CredentialsManager(authentication, storage) and SecureCredentialsManager(context, authentication, storage)saveCredentials(), getCredentials(), hasValidCredentials(), clearCredentials()MyAccountAPIClient - User self-service
MyAccountAPIClient(account, accessToken)UsersAPIClient - Administrative user management
UsersAPIClient(account, token)Sources: auth0/src/main/java/com/auth0/android/provider/WebAuthProvider.kt auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.kt auth0/src/main/java/com/auth0/android/authentication/storage/CredentialsManager.kt auth0/src/main/java/com/auth0/android/myaccount/MyAccountAPIClient.kt auth0/src/main/java/com/auth0/android/management/UsersAPIClient.kt
Auth0 - Central configuration object
Auth0.getInstance(clientId, domain) or Auth0.getInstance(context) (reads from strings.xml)Sources: auth0/src/main/java/com/auth0/android/Auth0.kt README.md69-100
The following diagram shows how the main SDK components relate to each other and to the Android platform:
SDK Component Architecture
Key architectural patterns:
Auth0 instance that holds the client ID, domain, and networking configurationOAuthManager, PKCE, RequestFactory) handle protocol detailsSources: Diagram 1, auth0/src/main/java/com/auth0/android/ auth0/src/main/java/com/auth0/android/provider/ auth0/src/main/java/com/auth0/android/authentication/
The SDK supports multiple authentication flows, each optimized for different use cases:
Authentication Flow Paths
Flow characteristics:
| Flow | Entry Point | Security Features | Use Case |
|---|---|---|---|
| Universal Login | WebAuthProvider.login() | OAuth 2.0 + PKCE + State + ID Token Verification | Recommended for most apps, supports all Auth0 features |
| Database | AuthenticationAPIClient.login() | ID Token Verification, optional DPoP | Direct username/password when browser unavailable |
| Passwordless | AuthenticationAPIClient.passwordlessWithEmail/SMS() | ID Token Verification | One-time codes via email or SMS |
| MFA | AuthenticationAPIClient.multifactorChallenge() | Challenge-response, ID Token Verification | Add second factor to database login |
| Passkey | AuthenticationAPIClient.signupWithPasskey() / signinWithPasskey() | WebAuthn/FIDO2, Android Credential Manager | Phishing-resistant authentication |
| Social | AuthenticationAPIClient.loginWithNativeSocialToken() | Token exchange, ID Token Verification | Use native provider SDK tokens |
Sources: Diagram 2, README.md102-218 auth0/src/main/java/com/auth0/android/provider/WebAuthProvider.kt auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.kt
After successful authentication, the SDK provides credential managers to store, retrieve, and automatically refresh tokens:
Credential Management Flow
Key features:
getCredentials() detects expired tokens and a refresh token exists, it automatically calls /oauth/token to renew tokensSecureCredentialsManager can require biometric authentication with configurable policiesgetApiCredentials(audience, scope) for managing multiple access tokens with one refresh tokengetSsoCredentials() for Native-to-Web SSO scenariosSources: Diagram 3, README.md320-476 auth0/src/main/java/com/auth0/android/authentication/storage/CredentialsManager.kt auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.kt
The SDK implements multiple security layers throughout the authentication and credential management lifecycle:
Security Feature Matrix
Security implementations:
useDPoP(). See DPoPSecureCredentialsManager uses AES/RSA encryption with keys stored in Android Keystore. See Encryption and Key ManagementSources: Diagram 5, auth0/src/main/java/com/auth0/android/authentication/ auth0/src/main/java/com/auth0/android/provider/ auth0/src/main/java/com/auth0/android/authentication/storage/
The SDK provides dual API styles for most operations:
Callback-based API:
Coroutine-based API:
Both styles are functionally equivalent. Coroutine support was added in version 2.8.0. See Coroutines Support for more details.
Sources: README.md142-189 CHANGELOG.md229-233
Credentials - Token response object
accessToken, idToken, refreshToken, type, expiresAt, scope, user (UserProfile from ID token)AuthenticationException - Error response
code, description, statusCodeisBrowserAppNotAvailable, isCanceled, isNetworkError, isInvalidCredentials, isMultifactorRequired, isPasswordLeaked, etc.UserProfile - User information from ID token
id, name, email, nickname, pictureURL, createdAt, etc./userinfoSources: auth0/src/main/java/com/auth0/android/result/ auth0/src/main/java/com/auth0/android/authentication/AuthenticationException.kt
Sources: README.md17-476
Refresh this wiki
This wiki was recently refreshed. Please wait 7 days to refresh again.