Skip to main content

Dash Google OAuth

This is a simple library using Google OAuth to authenticate and view a Dash app written based on dash-auth. Upon authentication, a cookie is created and kept for 2 weeks.

Setup

Navigate to Google API Console, and setup an OAuth credentials with http://localhost:5000/login/callback as authorized redirect URL.

Install the package:

$ pip install dash-google-oauth

Define following environment variables:

FLASK_SECRET_KEY

GOOGLE_AUTH_URL
GOOGLE_AUTH_SCOPE
GOOGLE_AUTH_TOKEN_URI
GOOGLE_AUTH_REDIRECT_URI
GOOGLE_AUTH_USER_INFO_URL
GOOGLE_AUTH_CLIENT_ID
GOOGLE_AUTH_CLIENT_SECRET

for example using python-dotenv:

FLASK_SECRET_KEY="..."

GOOGLE_AUTH_URL=https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&prompt=consent
GOOGLE_AUTH_SCOPE="openid email profile"
GOOGLE_AUTH_TOKEN_URI=https://oauth2.googleapis.com/token
GOOGLE_AUTH_REDIRECT_URI=http://localhost:5000/login/callback
GOOGLE_AUTH_USER_INFO_URL=https://www.googleapis.com/userinfo/v2/me
GOOGLE_AUTH_CLIENT_ID="..."
GOOGLE_AUTH_CLIENT_SECRET="..."

Add it to the application:

app = Dash(__name__)

from dash_google_oauth.google_auth import GoogleAuth
auth = GoogleAuth(app)

To logout, you may make a GET request to /logout

Metadata

Release files for dash-google-oauth 1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dash-google-oauth 1.2
File Size Uploaded Provenance Actions
dash-google-oauth-1.2.tar.gz 3.5 kB Without provenance Details for dash-google-oauth-1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dash-google-oauth 1.2
File Interpreter ABI Platform Actions
dash_google_oauth-1.2-py3-none-any.whl Python 3 none any Details for dash_google_oauth-1.2-py3-none-any.whl

Total release size: 8.5 kB

Release files / dash-google-oauth-1.2.tar.gz

Download URL dash-google-oauth-1.2.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1303dceed6d85528b77621932619cfe5d27cd831d94a1475fac77591b521ffcf
BLAKE2b-256 checksum
How to use checksums
52a4b6a8a993023a1f6186cd7688054bfc6a45ce605397eb662f40f490e66f07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.12

Release files / dash_google_oauth-1.2-py3-none-any.whl

Download URL dash_google_oauth-1.2-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
594f925d78459cfe8af7df96c3b0368c8e834f287581aabfe80e9575f0c87ba9
BLAKE2b-256 checksum
How to use checksums
0f48d2bf8b954a2192003d81e35073397cca5d955e97e405ce0cc92a9360a729
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.12

Security for dash-google-oauth 1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page