Follow these simple steps to set up Civic Auth with a Django backend (a working example is available in the github repo).
http://localhost:8000
and click the login link to test authentication.
/auth/login
- starts the login process/auth/callback
- completes authentication/auth/login
- Start authentication/auth/callback
- Handle OAuth callback (auto-created)/auth/logout
- Sign out userrequest.civic_user
as a dictionary:
@civic_auth_required
decorator to protect views:
Field | Required | Description |
---|---|---|
client_id | Yes | Your Civic Auth Client ID from auth.civic.com |
redirect_url | Yes | Where Civic redirects after authentication (must be absolute URL) |
post_logout_redirect_url | Yes | Where users go after logout (must be absolute URL) |
redirect_url
and post_logout_redirect_url
must be absolute URLs.YOUR_CLIENT_ID
with your actual client ID