You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.4 KiB

  1. This document aims to instruct how to setup OAuth for doccano. doccano now supports social login via GitHub and Active Directory by [#75](https://github.com/doccano/doccano/pull/75). In this document, we show GitHub OAuth as an example.
  2. ## Create OAuth App
  3. 1. In the upper-right corner of GitHub, click your profile photo, then click **Settings**.
  4. 2. In the left sidebar, click **Developer settings**.
  5. 3. In the left sidebar, click **OAuth Apps**.
  6. 4. Click **New OAuth App**.
  7. 5. In "Application name", type the name of your app.
  8. 6. In "Homepage URL", type the full URL to your app's website.
  9. 7. In "Authorization callback URL", type the callback URL(e.g. <https://example.com/social/complete/github/>) of your app.
  10. 8. Click Register application.
  11. ## Set enviromental variables
  12. Once the application is registered, your app's `Client ID` and `Client Secret` will be displayed on the following page:
  13. ![image](https://user-images.githubusercontent.com/6737785/51811605-1073d480-22f1-11e9-8be0-726a8ee5e832.png)
  14. 1. Copy the `Client ID` and `Client Secret` from the Developer Applications of your app on GitHub.
  15. 2. Set the `Client ID` and `Client Secret` to enviromental variables:
  16. ```bash
  17. export OAUTH_GITHUB_KEY=YOUR_CLIENT_ID
  18. export OAUTH_GITHUB_SECRET=YOUR_CLIENT_SECRET
  19. ```
  20. ## Run server
  21. ```bash
  22. python manage.py runserver
  23. ```
  24. Go to login page:
  25. ![image](https://user-images.githubusercontent.com/6737785/51812454-e7edd980-22f4-11e9-80c6-2f18fbc49108.png)