Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ In the **Authorized redirect URIs** add the SSO endpoint for your installation::

https://sentry.example.com/auth/sso/

Finally, obtain the API keys and plug them into your ``sentry.conf.py``:
Finally, obtain the API keys and configure the ``GOOGLE_CLIENT_ID`` and ``GOOGLE_CLIENT_SECRET`` as environment variables.
Alternatively, you can plug them into your ``sentry.conf.py``:

.. code-block:: python

Expand Down
6 changes: 4 additions & 2 deletions sentry_auth_google/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

from django.conf import settings

import os
env = os.environ.get

AUTHORIZE_URL = 'https://accounts.google.com/o/oauth2/auth'

ACCESS_TOKEN_URL = 'https://www.googleapis.com/oauth2/v4/token'

CLIENT_ID = getattr(settings, 'GOOGLE_CLIENT_ID', None)
CLIENT_ID = env('GOOGLE_CLIENT_ID') or getattr(settings, 'GOOGLE_CLIENT_ID', None)

CLIENT_SECRET = getattr(settings, 'GOOGLE_CLIENT_SECRET', None)
CLIENT_SECRET = env('GOOGLE_CLIENT_SECRET') or getattr(settings, 'GOOGLE_CLIENT_SECRET', None)

ERR_INVALID_DOMAIN = 'The domain for your Google account (%s) is not allowed to authenticate with this provider.'

Expand Down