Integrating Okta OIDC with Dash Application
OK, so I found this post, whih ended up solving my problem simply by replacing login_required
with oidc.require_login
. Turns out the invalid start byte was related to another bug I had.
app = Flask(__name__) app.config.from_mapping( SECRET_KEY="testkey", OIDC_CLIENT_SECRETS="XXX", OIDC_COOKIE_SECURE= False, OIDC_CALLBACK_ROUTE="/oidc/callback", OIDC_SCOPES=["openid", "email", "profile"], OIDC_ID_TOKEN_COOKIE_NAME="oidc_token", DEBUG_TB_INTERCEPT_REDIRECTS = False ) oidc.init_app(app) dash_app = dash.Dash(__name__, server = app, url_base_pathname='/dash/' ) for view_func in app.view_functions: if view_func.startswith(dash_app.config['url_base_pathname']): app.view_functions[view_func] = oidc.require_login(app.view_functions[view_func]) dash_app.layout = html.Div([intro_div, navbar, exec_dashboard, body]) register_dash_callbacks(dash_app)