Dash Okta Auth
Dash Okta Auth is a simple library using Okta OAuth to authenticate and view a Dash app.
This Library uses Flask Dance and a modified version of Plotly's own dash auth for authentication.
This Library is heavily inspired by dash-google-oauth created by Lucas Chapin
Basic Use
Authentication can be added to your Dash application using the OktaOAuth
class, i.e.
from dash import Dash
from flask import Flask
from dash_okta_auth import OktaOAuth
server = Flask(__name__)
server.config.update({
'OKTA_OAUTH_CLIENT_ID': ...,
'OKTA_OAUTH_CLIENT_SECRET': ...,
})
app = Dash(__name__, server=server, url_base_pathname='/', auth='auth')
additional_scopes = [...]
auth = OktaOAuth(app, base_url='https://myoktadomain.okta-emea.com', additional_scopes)
# your Dash app here :)
...
Example
Steps to try this out yourself:
-
Install the
dash-okta-authlibrary usingpip:$ pip install dash-okta-auth
-
Follow the Flask Dance Guide to create an app on the okta admin console
-
Make a copy of app.py and set the variables (or set the corresponding environment variables):
server.config["OKTA_OAUTH_CLIENT_ID"] = ... server.config["OKTA_OAUTH_CLIENT_SECRET"] = ...
with values from the Okta OAuth 2 application you should have set up earlier. If you've set these up properly, you can find them at
Applications > yourapp > Generalunder the section Client Credentials. -
Run
python app.pyand open localhost in a browser window to try it out! If the app loads automatically without prompting a Okta login, that means you're already authenticated -- try using an inokta window in this case if you want to see the login experience for a new user.
Release files for dash-okta-auth 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dash-okta-auth-0.0.1.tar.gz | 11.2 kB | Details |
Release files / dash-okta-auth-0.0.1.tar.gz
| Download URL | dash-okta-auth-0.0.1.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6603a8f5192243c8b722d192cebf5d26a906218d64417ce4b90319cecaeec87e
|
|
BLAKE2b-256 checksum How to use checksums |
c8dd9cba79c3c16e0af162f3eef3e4579f1b1552117a40af6de29943a76fb153
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.15
|