Google Social Authentication
Read Context
For reusability, ensure to read the discussion on context so that the environment variables that are secured can be repurposed for testing in other websites later on.
Field | Value |
---|---|
Homepage url | http ://127.0.0.1:8000/ |
Callback url | http ://127.0.0.1:8000/accounts/google/login/callback |
0.0.0.0:8080
as Google redirect url
Cannot register a container context for Google because the redirect uri of 0.0.0.0:8080
does not meet the validation criteria for a valid domain.
Replace start-django.fly.dev
with the new site.
Field | Value |
---|---|
Homepage url | e.g. https ://start-django.fly.dev |
Callback url | e.g. http ://start-django.fly.dev/accounts/google/login/callback/ |
User support email address | Should be part of Google organization |
Developer contact email address | - |
Test user email addresses (< 100) | - |
AllAuth
We need to secure the following values:
Key | Value |
---|---|
GOOGLE_ID |
Client id |
GOOGLE_KEY |
Client secret |
This is per the configuration we set via django-allauth:
/config/settings/_auth.py | |
---|---|
Visit console.
OAuth consent screen
Create an app:
According to the External
User Type for testing:
Your app will only be available to users you add to the list of test users. Once your app is ready to publish, you may need to verify your app.
Note optional badges of trust
- App logo
- Link to privacy policy as a badge of trust
- Link to terms of service
Credentials screen
After completing requisites of OAuth consent screen
, can proceed to securing credentials.
Fields to consider:
Application type | Authorized redirect URI |
---|---|
Web application |
https://start-django.fly.dev/accounts/google/login/callback/ |
Submit to get Client id and Client secret