mirror of
https://github.com/boostorg/website-v2.git
synced 2026-01-19 04:42:17 +00:00
This is related to ticket #1374, and simplifies the steps for local development environments to have a working login flow for github and google. The improvements were configuration for the client id and secret for google and github via .env vars instead of having to go through setting up "Social Applications" via the admin interface, and automating the process for creating google cloud projects in which oauth clients can be created. Documentation was adjusted to fit. That was as far as this could be automated given limitations on both Google Cloud Platform and Github's APIs for creating oauth clients/apps. The terraform process can be improved if these tickets see some progress or an API comes about to support this. Google https://github.com/hashicorp/terraform-provider-google/issues/16452 https://issuetracker.google.com/issues/116182848 Github https://github.com/integrations/terraform-provider-github/issues/786
This commit is contained in:
@@ -348,8 +348,37 @@ SOCIALACCOUNT_PROVIDERS = {
|
||||
"access_type": "online",
|
||||
},
|
||||
"OAUTH_PKCE_ENABLED": True,
|
||||
}
|
||||
},
|
||||
"github": {},
|
||||
}
|
||||
if LOCAL_DEVELOPMENT:
|
||||
github_oauth_client_id = env("GITHUB_OAUTH_CLIENT_ID", default=None)
|
||||
github_oauth_secret = env("GITHUB_OAUTH_CLIENT_SECRET", default=None)
|
||||
if not github_oauth_client_id or not github_oauth_secret:
|
||||
logging.warning("Github OAuth credentials not set")
|
||||
else:
|
||||
SOCIALACCOUNT_PROVIDERS["github"] = {
|
||||
"APPS": [
|
||||
{
|
||||
"client_id": github_oauth_client_id,
|
||||
"secret": github_oauth_secret,
|
||||
}
|
||||
]
|
||||
}
|
||||
google_oauth_client_id = env("GOOGLE_OAUTH_CLIENT_ID", default=None)
|
||||
google_oauth_secret = env("GOOGLE_OAUTH_CLIENT_SECRET", default=None)
|
||||
if not google_oauth_client_id or not google_oauth_secret:
|
||||
logging.warning("Google OAuth credentials not set")
|
||||
else:
|
||||
SOCIALACCOUNT_PROVIDERS["google"] = {
|
||||
"APPS": [
|
||||
{
|
||||
"client_id": google_oauth_client_id,
|
||||
"secret": google_oauth_secret,
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
# Allow Allauth to use HTTPS when deployed but HTTP for local dev
|
||||
SECURE_PROXY_SSL_HEADER_NAME = env("SECURE_PROXY_SSL_HEADER_NAME", default=None)
|
||||
|
||||
Reference in New Issue
Block a user