Skip to content

Commit 7eae862

Browse files
committed
Update the docs - add "Backends" section
1 parent 6e06db5 commit 7eae862

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

docs/integration/configuration.md

+18-5
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,26 @@ OAuth2Client(
5151
)
5252
```
5353

54-
Sometime, a `backend` needs settings. You can define them by enrironment variable (host OS, Docker, .env file, ...)
54+
## Backends
5555

56-
Syntax is : `SOCIAL_AUTH_<BACKEND_NAME>_<VARIABLE_NAME>`
56+
If endpoints of a backend need to use `authorization_url` and `access_token_url`, then please ensure
57+
`AUTHORIZATION_URL` and `ACCESS_TOKEN_URL` are set to `None` or at least empty strings so they can be called
58+
alternatively.
5759

58-
```bash
59-
# Example: Set API_VERSION to 20.0 for "facebook-app" backend
60-
SOCIAL_AUTH_FACEBOOK_APP_API_VERSION=20.0
60+
```python
61+
from social_core.backends import facebook
62+
63+
64+
class FacebookOAuth2(facebook.FacebookOAuth2):
65+
AUTHORIZATION_URL = None
66+
ACCESS_TOKEN_URL = None
67+
USER_DATA_URL = "https://graph.facebook.com/v18.0/me"
68+
69+
def authorization_url(self):
70+
return "https://www.facebook.com/v18.0/dialog/oauth"
71+
72+
def access_token_url(self):
73+
return "https://graph.facebook.com/v18.0/oauth/access_token"
6174
```
6275

6376
## Claims

0 commit comments

Comments
 (0)