Skip to content

Commit

Permalink
#241 Add Facebook OAuth to README
Browse files Browse the repository at this point in the history
  • Loading branch information
viliambalaz committed May 17, 2020
1 parent d62f0c9 commit f00cf8f
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f00cf8f

Please sign in to comment.