From f00cf8ff0e88b4db142215ac13c9c486af4e6843 Mon Sep 17 00:00:00 2001 From: Viliam Balaz Date: Sun, 17 May 2020 19:15:36 +0200 Subject: [PATCH] #241 Add Facebook OAuth to README --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/README.md b/README.md index 082c17c74..80b063715 100644 --- a/README.md +++ b/README.md @@ -252,6 +252,7 @@ your browser. ## 3. Social accounts application keys + ### 3.1. Google OAuth 1. Go to https://code.google.com/apis/console/ and create a project. @@ -273,6 +274,49 @@ your browser. 'Client secret'. +### 3.2. Facebook OAuth + + 1. Go to https://developers.facebook.com/ and create an app. + + 2. Add a Product 'Facebook Login' and select platform 'Web'. Enter 'Site URL' `https://{domain}/`. + + 3. Go to 'Facebook Login' / 'Settings' and add 'Valid OAuth Redirect URIs': + + https://{domain}/accounts/facebook/login/callback/ + https://{domain}/sk/accounts/facebook/login/callback/ + https://{domain}/en/accounts/facebook/login/callback/ + + Where `{domain}` is your production domain or `127.0.0.1:8000` if in local development mode. + 'Site URL' in form `127.0.0.1:8000` is invalid use `localhost:8000` instead. + +To use Facebook Login, you need to use https. Setup default protocol in `settings/common.py`. + + ACCOUNT_DEFAULT_HTTP_PROTOCOL = u'https' + +To run a server with https you can use +[RunServerPlus](https://django-extensions.readthedocs.org/en/latest/runserver_plus.html) from +[django-extensions](https://github.com/django-extensions/django-extensions). To install run: + + $ pip install django-extensions==1.0.3 + $ pip install Werkzeug==0.16.1 + $ pip install pyOpenSSL==19.1.0 + +Add it to `INSTALLED_APPS` in `settings/common.py` file: + + INSTALLED_APPS = ( + ... + 'django_extensions', + ... + ) + +Run the server in ssl mode with: + + ./manage.py runserver_plus --cert /tmp/cert + +Or you can create a public https URL using [ngrok](https://ngrok.com/). Don't forget to add newly +generated URL in 'Valid OAuth Redirect URIs'. + + ## 4. Google custom search engine key 1. Sign into [Control Panel](https://cse.google.com/create/new) using your Google Account. @@ -375,6 +419,7 @@ If you want to contribute, please, create a new branch for your changes: And then submit a 'Pull Request' on GitHub. + ### 7.1. Site Content and translations All site text content is stored in templates. Templates are in `template` directories all over the