Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OIDC server does not support profile #115

Open
mjc0608 opened this issue Aug 6, 2023 · 0 comments
Open

OIDC server does not support profile #115

mjc0608 opened this issue Aug 6, 2023 · 0 comments

Comments

@mjc0608
Copy link

mjc0608 commented Aug 6, 2023

I got the following errors when configuring headscale-webui with OIDC

Traceback (most recent call last):
  File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/flask_oidc/__init__.py", line 488, in decorated
    return view_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/server.py", line 261, in settings_page
    OIDC_NAV_DROPDOWN = renderer.oidc_nav_dropdown(user_name, email_address, name)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/renderer.py", line 634, in oidc_nav_dropdown
    html_payload = """
                   ^^^
TypeError: can only concatenate str (not "NoneType") to str

I believe the root cause is that my OIDC server does not profile the "profile" scope, thus, the "name" field becomes a NoneType. I guess the easiest fix is to replace any NoneType with a "N/A" str here. I can submit a fix if you want.

Any idea on how to solve this issue in a more elegant way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant