jamesholcombe / dash-auth-external

Plotly Dash plugin to allow authentication through 3rd party OAuth providers.
https://pypi.org/project/dash-auth-external/
MIT License
29 stars 7 forks source link

Outdated PYPI #4

Closed John-LucaGIT closed 1 year ago

John-LucaGIT commented 2 years ago

Hi, I noticed that the master branch differs from the pypi version, when using the pypi version there is a dict error that appears which is resolved in the GitHub branch. Could you update the pypi version as well? Lastly, I keep getting a key error but as far as I can tell my token field name is correct. I am using O2Auth with openID connect.

token = auth.get_token()
File "auth.py", line 27, in get_token
raise KeyError(
KeyError: 'Header with name access_token not found in the flask request headers.'

Here is my method:

auth = DashAuthExternal(
                        external_auth_url= AUTH_URL,
                        external_token_url= TOKEN_URL,
                        client_id= CLIENT_ID,
                        with_pkce=True,
                        app_url= "http://127.0.0.1:8050",
                        redirect_suffix = "/redirect",
                        auth_suffix = "/",
                        home_suffix="/app",
                        client_secret= CLIENT_SECRET,
                        _secret_key= None,
                        auth_request_headers= None,
                        token_request_headers= None,
                        scope= ("openid profile"),
                        )

Could the error be caused by anything other than an incorrect token field name?

I also am getting this error if I try to go to /redirect after already authenticating, I am not sure if it is relevant or normal behavior after authentication.

File "/dash_auth_external/routes.py", line 76, in build_token_body
code = redirect_params["code"][0]
KeyError: 'code'
jamesholcombe commented 1 year ago

Sorry I missed this. Presume you managed to get this working?