This commit helps reduce clutter on the navigation sidebar. Creates new directories and moves relevant files into them. Modifies index.rst, symlinks, and image paths accordingly. This commit also enables expandable/collapsible navigation items, renames files in docs/development and docs/production, modifies /tools/test-documentation so that it overrides a theme setting, Also updates links to other docs, file paths in the codebase that point to developer documents, and files that should be excluded from lint tests. Note that this commit does not update direct links to zulip.readthedocs.io in the codebase; those will be resolved in an upcoming follow-up commit (it'll be easier to verify all the links once this is merged and ReadTheDocs is updated). Fixes #5265.
2.2 KiB
Google & GitHub authentication with OAuth 2
Among the many authentication methods we support, a server can be configured to allow users to sign in with their Google accounts or GitHub accounts, using the OAuth protocol.
Testing OAuth in development
Because these authentication methods involve an interaction between Zulip, an external service, and the user's browser, and particularly because browsers can (rightly!) be picky about the identity of sites you interact with, the preferred way to set them up in a development environment is to set up the real Google and GitHub to process auth requests for your development environment.
The steps to do this are a variation of the steps documented in
prod_settings_template.py. Here are the full procedures for dev:
-
Visit https://console.developers.google.com and navigate to "APIs & services" > "Credentials". Create a "Project" which will correspond to your dev environment.
-
Navigate to "APIs & services" > "Library", and find the "Google+ API". Choose "Enable".
-
Return to "Credentials", and select "Create credentials". Choose "OAuth client ID", and follow prompts to create a consent screen, etc. For "Authorized redirect URIs", fill in
https://zulipdev.com:9991/accounts/login/google/done/. -
You should get a client ID and a client secret. Copy them. In
dev_settings.py, setGOOGLE_OAUTH2_CLIENT_IDto the client ID, and indev-secrets.conf, setgoogle_oauth2_client_secretto the client secret. -
Uncomment
'zproject.backends.GoogleMobileOauth2Backend'inAUTHENTICATION_BACKENDSindev_settings.py.
GitHub
-
Register an OAuth2 application with GitHub at one of https://github.com/settings/developers or https://github.com/organizations/ORGNAME/settings/developers. Specify
http://zulipdev.com:9991/complete/github/as the callback URL. -
You should get a page with settings for your new application, showing a client ID and a client secret. In
dev_settings.py, setSOCIAL_AUTH_GITHUB_KEYto the client ID, and indev-secrets.conf, setsocial_auth_github_secretto the client secret. -
Uncomment
'zproject.backends.GitHubAuthBackend'inAUTHENTICATION_BACKENDSindev_settings.py.