Issues when using the new version of dash_auth

Hello,
I Have tried to follow this example here to add authentication with OpenID Connect and got an error when trying to import the OIDCAuth Class. I have installed the latest version

Could someone please tell me if I need to import the class differently?

from dash import Dash, Input, Output, dcc, html
from dash_auth import OIDCAuth

app = Dash(__name__)
app.layout = html.Div([
    html.H1('Hello World'),
])


if __name__ == '__main__':
    app.run_server(debug=True)
Traceback (most recent call last):
  File "/datascience/common_model/mit_old/test.py", line 2, in <module>
    from dash_auth import OIDCAuth
ImportError: cannot import name 'OIDCAuth' from 'dash_auth' (/usr/local/lib/python3.9/dist-packages/dash_auth/__init__.py)

Hello @Amazigh,

I think there are some other dependencies that are required for it now, which aren’t auto included in the repo.

I think it’s authlib and requests[security] that are missing.

1 Like

Installing authlib and requests solved it. Thank you so much :slightly_smiling_face:

2 Likes