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.

37 lines
1.3 KiB

  1. # How to use OAuth
  2. 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.
  3. ## Create OAuth App
  4. 1. In the upper-right corner of GitHub, click your profile photo, then click **Settings**.
  5. 2. In the left sidebar, click **Developer settings**.
  6. 3. In the left sidebar, click **OAuth Apps**.
  7. 4. Click **New OAuth App**.
  8. 5. In "Application name", type the name of your app.
  9. 6. In "Homepage URL", type the full URL to your app's website.
  10. 7. In "Authorization callback URL", type the callback URL(e.g. <https://example.com/social/complete/github/>) of your app.
  11. 8. Click Register application.
  12. ## Set enviromental variables
  13. Once the application is registered, your app's `Client ID` and `Client Secret` will be displayed on the following page:
  14. ![image](../images/oauth/oauth_apps.png)
  15. 1. Copy the `Client ID` and `Client Secret` from the Developer Applications of your app on GitHub.
  16. 2. Set the `Client ID` and `Client Secret` to enviromental variables:
  17. ```bash
  18. export OAUTH_GITHUB_KEY=YOUR_CLIENT_ID
  19. export OAUTH_GITHUB_SECRET=YOUR_CLIENT_SECRET
  20. ```
  21. ## Run server
  22. ```bash
  23. python manage.py runserver
  24. ```
  25. Go to login page:
  26. ![image](../images/oauth/login_page.png)