Skip to content

Commit 2a29f98

Browse files
authored
Merge pull request #73 from mlavin/71-update-fb-docs
Update docs and fixtures for FB API changes.
2 parents 0d060c1 + a369967 commit 2a29f98

File tree

3 files changed

+23
-14
lines changed

3 files changed

+23
-14
lines changed

allaccess/fixtures/common_providers.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"model": "allaccess.provider",
55
"fields": {
66
"name": "facebook",
7-
"authorization_url": "https://www.facebook.com/dialog/oauth",
8-
"access_token_url": "https://graph.facebook.com/oauth/access_token",
7+
"authorization_url": "https://www.facebook.com/v2.8/dialog/oauth",
8+
"access_token_url": "https://graph.facebook.com/v2.8/oauth/access_token",
99
"request_token_url": "",
10-
"profile_url": "https://graph.facebook.com/me"
10+
"profile_url": "https://graph.facebook.com/v2.8/me"
1111
}
1212
},
1313
{
@@ -65,4 +65,4 @@
6565
"profile_url": "https://api.bitbucket.org/1.0/user/"
6666
}
6767
}
68-
]
68+
]

docs/providers.rst

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Configuring Providers
44
django-all-access configures and stores the set of OAuth providers in the database.
55
To enable your users to authenticate with a particular provider, you will need to add
66
the OAuth API URLs as well as your application's consumer key and consumer secret.
7-
The process of registering your application with each provider will vary and
7+
The process of registering your application with each provider will vary and
88
you should refer to the provider's API documentation for more information.
99

1010
.. note::
@@ -14,18 +14,16 @@ you should refer to the provider's API documentation for more information.
1414
`AES specification <http://en.wikipedia.org/wiki/Advanced_Encryption_Standard>`_.
1515
Since this is a symmetric-key encryption the key/secret pairs can still be read
1616
if the encryption key is compromised. In this case django-all-access uses a
17-
key based on the standard ``SECRET_KEY`` setting. You should take care to keep
17+
key based on the standard ``SECRET_KEY`` setting. You should take care to keep
1818
this setting secret as its name would imply.
1919

2020

21-
.. versionadded:: 0.6
22-
2321
Common Providers
2422
------------------------------------
2523

2624
To get you started, there is an initial fixture of commonly used providers. This includes
2725
the URLs needed for Facebook, Twitter, Google, Microsoft Live, Github and Bitbucket. Once you've
28-
added ``allaccess`` to your ``INSTALLED_APP`` and created the tables with ``syncdb``/``migrate``,
26+
added ``allaccess`` to your ``INSTALLED_APP`` and created the tables with ``migrate``,
2927
you can load this fixture via::
3028

3129
python manage.py loaddata common_providers.json
@@ -38,8 +36,8 @@ and how they would be populated for additional providers you might want to use.
3836
OAuth 1.0 Providers
3937
------------------------------------
4038

41-
OAuth 1.0 Protocol is defined by `RFC 5849 <http://tools.ietf.org/html/rfc5849>`_.
42-
It is sometimes referred to as 3-Legged OAuth due to the number of requests
39+
OAuth 1.0 Protocol is defined by `RFC 5849 <http://tools.ietf.org/html/rfc5849>`_.
40+
It is sometimes referred to as 3-Legged OAuth due to the number of requests
4341
between the provider and consumer.
4442

4543
To enable an OAuth provider, you should add a ``Provider`` record with the necessary
@@ -99,12 +97,20 @@ Facebook is a large social network which provides a REST API with OAuth 2.0
9997
authentication. The below ``Provider`` record will enable Facebook authentication::
10098

10199
name: facebook
102-
authorization_url: https://www.facebook.com/dialog/oauth
103-
access_token_url: https://graph.facebook.com/oauth/access_token
104-
profile_url: https://graph.facebook.com/me
100+
authorization_url: https://www.facebook.com/v2.8/dialog/oauth
101+
access_token_url: https://graph.facebook.com/v2.8/oauth/access_token
102+
profile_url: https://graph.facebook.com/v2.8/me
105103

106104
As you can see, the ``request_token_url`` is not included because it is not needed.
107105
After adding your consumer key and secret to this record you should now be able
108106
to authenticate with Facebook by visiting ``/accounts/login/facebook/``.
109107
Facebook also has `developer docs <http://developers.facebook.com/docs/>`_
110108
for additional information on using their API.
109+
110+
.. note::
111+
112+
Facebook began using the version number in the URL as part of their 2.0 API.
113+
Since then very little has changed with regard to the OAuth flow but the
114+
version number is now required. The latest version of the API might not
115+
match the documentation here. For the most up to date info on the Facebook
116+
API you should consult their API docs.

docs/releases.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Release History
33

44
Release and change history for django-all-access
55

6+
67
v0.9.0 (TBD)
78
-----------------------------------
89

@@ -13,6 +14,8 @@ attempting to decrypt. This was added thanks to Florian Demmer (@fdemmer).
1314
Other small changes include:
1415

1516
- Added Django 1.10 and Python 3.5 to the test suite coverage.
17+
- Updated documentation on Facebook version numbers.
18+
- Update provider fixtures to include the latest version number for Facebook.
1619

1720

1821
v0.8.0 (2016-01-23)

0 commit comments

Comments
 (0)