microscopepony / omero-oauth

OMERO.web application to allow OAuth2 login to OMERO
https://gitlab.com/openmicroscopy/incubator/omero-oauth/
GNU Affero General Public License v3.0
0 stars 3 forks source link

QA: 31017: KeyError 'given_name' #2

Open joshmoore opened 2 years ago

joshmoore commented 2 years ago

Info:

User feedback:

I have logged into Synapse and am trying to connect to OMERO through it, but get server error 500. I've tried using Edge and Chrome, but neither work.

Error:

Traceback (most recent call last):

File "/opt/omero/OMERO.venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)

File "/opt/omero/OMERO.venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)

File "/opt/omero/OMERO.venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/opt/omero/OMERO.venv/lib/python3.6/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)

File "/opt/omero/OMERO.venv/lib/python3.6/site-packages/django/utils/decorators.py", line 67, in _wrapper
return bound_func(*args, **kwargs)

File "/opt/omero/OMERO.venv/lib/python3.6/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
return view(request, *args, **kwargs)

File "/opt/omero/OMERO.venv/lib/python3.6/site-packages/django/utils/decorators.py", line 63, in bound_func
return func.__get__(self, type(self))(*args2, **kwargs2)

File "/opt/omero/OMERO.venv/lib/python3.6/site-packages/omeroweb/webgateway/views.py", line 3098, in dispatch
return super(LoginView, self).dispatch(*args, **kwargs)

File "/opt/omero/OMERO.venv/lib/python3.6/site-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)

File "/opt/omero/OMERO.venv/lib/python3.6/site-packages/omero_oauth/views.py", line 95, in get
userinfo = oauth.get_userinfo(token)

File "/opt/omero/OMERO.venv/lib/python3.6/site-packages/omero_oauth/providers.py", line 125, in get_userinfo
userinfo = f(token, userinfo_url)

File "/opt/omero/OMERO.venv/lib/python3.6/site-packages/omero_oauth/providers.py", line 145, in userinfo_synapse_idp
userinfo = list(self._expand_all(decoded))

File "/opt/omero/OMERO.venv/lib/python3.6/site-packages/omero_oauth/providers.py", line 117, in _expand_all
firstname = self._expand_template('firstname', args)

File "/opt/omero/OMERO.venv/lib/python3.6/site-packages/omero_oauth/providers.py", line 112, in _expand_template
return template.format(**args)

KeyError: 'given_name'
manics commented 2 years ago

File "/opt/omero/OMERO.venv/lib/python3.6/site-packages/omero_oauth/providers.py", line 145, in userinfo_synapse_idp

This must be modified code, userinfo_synapse_idp isn't in https://github.com/microscopepony/omero-oauth/blob/v0.0.2/omero_oauth/providers.py

joshmoore commented 2 years ago

Thanks, @manics. Passed it out.