Understanding Civic Auth’s flexible OAuth 2.0 authentication methods for maximum security across all application types.
Civic Auth supports multiple OAuth 2.0 authentication methods to provide maximum security across different application architectures and use cases.
Best for: Public clients (SPAs, mobile apps) where secrets cannot be securely stored.
Best for: Public clients (SPAs, mobile apps) where secrets cannot be securely stored.
Best for: Server-side applications that do not support PKCE.
Best for: Maximum security for confidential clients that can support both methods.
To generate a client secret, log into your dashboard at auth.civic.com, navigate to the Security tab, and click “Generate Client Secret”. Important: The client secret is only displayed once upon generation, so make sure to copy and securely store it immediately. You can always regenerate a new client secret if needed.
Security Requirements: Client secrets must be stored securely and never exposed in client-side code. They are suitable only for server-side applications with secure credential storage.
Flexible Security: Choose the authentication method that best fits your application architecture. Use PKCE-only for public clients, client secrets for traditional OAuth compatibility, or both together for maximum security.
PKCE Security Model
Client Secret Security Model
The Civic Auth SDK is initialized with a config
object that varies based on the authentication method you choose. The core implementation remains the same.
Parameter | PKCE Only (Default) | Client Secret Only | PKCE + Client Secret (Max Security) | Notes |
---|---|---|---|---|
clientId | Required | Required | Required | Your application’s Client ID. |
clientSecret | Not used | Required | Required | Generate in dashboard Security tab. |
pkce | true (default) | false | true | Enables or disables PKCE. |
redirectUrl | Required | Required | Required | The URL to redirect to after login. |
postLogoutRedirectUrl | Optional | Optional | Optional | The URL to redirect to after logout. |
For full implementation examples with specific frameworks, see our integration guides. The guides show the PKCE-only approach by default, but you can adapt the config
object using the parameters above for other flows.