added new readme file on how to do drf authorization
This commit is contained in:
parent
c3f680d3c9
commit
b780ce5527
1 changed files with 56 additions and 0 deletions
56
share/templates/readmes/drf_authorization_facebook.md
Normal file
56
share/templates/readmes/drf_authorization_facebook.md
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
## main info
|
||||||
|
|
||||||
|
https://medium.com/scalereal/the-ultimate-guide-to-using-social-login-in-django-f0abe0022ab0
|
||||||
|
|
||||||
|
### facebook settings
|
||||||
|
|
||||||
|
#### these settings are needed for csrf to work
|
||||||
|
|
||||||
|
ACCOUNT_DEFAULT_HTTP_PROTOCOL='https'
|
||||||
|
|
||||||
|
[source for account default setting](https://stackoverflow.com/questions/55666103/django-allauth-facebook-integration-login-failure)
|
||||||
|
|
||||||
|
CSRF_TRUSTED_ORIGINS = ['https://oauth.drftesting.net']
|
||||||
|
ALLOWED_HOSTS = ['https://oauth.drftesting.net']
|
||||||
|
|
||||||
|
#### settings in facebook developer apps
|
||||||
|
|
||||||
|
##### in app settings / basic
|
||||||
|
|
||||||
|
app settings->basic
|
||||||
|
|
||||||
|
###### app domains
|
||||||
|
|
||||||
|
add the top level domain and the full domain. should look like
|
||||||
|
|
||||||
|
drftesting.net
|
||||||
|
oauth.drftesting.net
|
||||||
|
|
||||||
|
go a little further down and click on the button that says "add platform"
|
||||||
|
|
||||||
|
###### Site URL
|
||||||
|
put the full site url in with "https"
|
||||||
|
|
||||||
|
https://oauth.drftesting.net/
|
||||||
|
|
||||||
|
##### under products
|
||||||
|
|
||||||
|
products->facebook login->configure (dropdown) -> settings
|
||||||
|
|
||||||
|
set Embedded Browser OAuth Login to yes
|
||||||
|
|
||||||
|
##### in Valid OAuth Redirect URIs add the callback url:
|
||||||
|
|
||||||
|
example url:
|
||||||
|
|
||||||
|
https://oauth.drftesting.net/accounts/facebook/login/callback/
|
||||||
|
|
||||||
|
######source on creating and setting up a facebook app
|
||||||
|
[configure facebook login](https://help.sharetribe.com/en/articles/666072-configure-facebook-login)
|
||||||
|
|
||||||
|
######django alluth doc on how to configure callback
|
||||||
|
[django allauth callback](https://django-allauth.readthedocs.io/en/latest/socialaccount/providers/index.html?highlight=callback)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
Add table
Reference in a new issue