Skip to main content

OpenID Connect authentication provider for Sentry

Project description

An SSO provider for Sentry which enables OpenID Connect Apps authentication.

This is a fork of sentry-auth-google.

Why fork, instead of adapting sentry-auth-google to work with every OpenID Connect provider?

The maintainer has different ideas with sentry-auth-google. See:

Install

$ pip install doda-sentry-auth-oidc

Example Setup for Google

Start by creating a project in the Google Developers Console.

In the Authorized redirect URIs add the SSO endpoint for your installation:

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

Naturally other providers, that are supporting OpenID-Connect can also be used (like GitLab).

Finally, obtain the API keys and the well-known account URL and plug them into your sentry.conf.py:

OIDC_CLIENT_ID = ""

OIDC_CLIENT_SECRET = ""

OIDC_SCOPE = "openid email"

OIDC_PKCE_ENABLED = False  # Set to True to use PKCE with S256

OIDC_DOMAIN = "https://accounts.google.com"  # e.g. for Google

The OIDC_DOMAIN defines where the OIDC configuration is going to be pulled from. Basically it specifies the OIDC server and adds the path .well-known/openid-configuration to it. That’s where different endpoint paths can be found.

Detailed information can be found in the ProviderConfig specification.

You can also define OIDC_ISSUER to change the default provider name in the UI, even when the OIDC_DOMAIN is set.

Set OIDC_PKCE_ENABLED = True to enable PKCE using the S256 code challenge method. Leave it disabled to preserve OAuth 2.0 compatibility with providers that do not support PKCE.

If your provider doesn’t support the OIDC_DOMAIN, then you have to set these required endpoints by yourself (autorization_endpoint, token_endpoint, userinfo_endpoint, issuer).

OIDC_AUTHORIZATION_ENDPOINT = "https://accounts.google.com/o/oauth2/v2/auth"  # e.g. for Google

OIDC_TOKEN_ENDPOINT = "https://www.googleapis.com/oauth2/v4/token"  # e.g. for Google

OIDC_USERINFO_ENDPOINT = "https://www.googleapis.com/oauth2/v3/userinfo" # e.g. for Google

OIDC_ISSUER = "Google"

Development

FAQ

  • If you are using macOS brew’s openssl and you get a psycopg build error such as:
    ld: library not found for -lssl
    Please setup the following environment variables:
    export LDFLAGS="-L/usr/local/opt/openssl/lib"
    export CPPFLAGS="-I/usr/local/opt/openssl/include"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

doda_sentry_auth_oidc-9.1.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

doda_sentry_auth_oidc-9.1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file doda_sentry_auth_oidc-9.1.0.tar.gz.

File metadata

File hashes

Hashes for doda_sentry_auth_oidc-9.1.0.tar.gz
Algorithm Hash digest
SHA256 41bc0e3d0855590101ea3a808057830dbb09bf23587ff9fcaa58a7bd3b7702b0
MD5 6d5d44a1e2b15a26946cc3b901cbfbe2
BLAKE2b-256 5eb468824ca22d6aec69d93900e096160d02d65a60da6450bac63809d03eb460

See more details on using hashes here.

File details

Details for the file doda_sentry_auth_oidc-9.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for doda_sentry_auth_oidc-9.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c1f04b9c5d13b0c4e7061adcdc7d9f58f57a2738ba23706f4fb66f5d6c32ecf9
MD5 555c6f819039b9ef2659b9c6fa38587f
BLAKE2b-256 e1401d73d3dcb5956fd26c0721e1a6a702a1ba7ce4db969906c10f6c7ef54963

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page