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

File "/usr/local/lib/python3.5/dist-packages/django/contrib/sessions/backends/base.py", line 57, in __getitem__ return self._session[key] KeyError: 'op' #12

Open
Allan-Nava opened this issue Feb 26, 2018 · 5 comments

Comments

@Allan-Nava
Copy link

Hi @derek-pryor,
I have this error:

Internal Server Error: /openid/callback/login/
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.5/dist-packages/djangooidc/views.py", line 86, in authz_cb
    client = CLIENTS[request.session["op"]]
  File "/usr/local/lib/python3.5/dist-packages/django/contrib/sessions/backends/base.py", line 57, in __getitem__
    return self._session[key]
KeyError: 'op'
[26/Feb/2018 13:46:36] "GET /openid/callback/login/?state=eIPh2qXLAPTD6Bxl&code=eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0..VoGhtcibjd4qDx-fZgSWXw.7MqJc8VZ5kuwikVy0DINPd6C1fF9A0DzGOVVBw04nXpr9YRx91jPPREVxOxmtHVTEq562MoZ7WfElONtiiIcZRTtvd1J5WwHfB03SJa9iMSRl4BT_8__1oRrL7LKDKIkAuNNVAl-ghBUzM4dZbakuolCSPFZtQqMGA8Z4G8J0XA0JZv26Gimia60l4u8SyRx0-2K-lGyyz4RsQBVR4DJnxPtjiO-Go2MYEosoJV97J12FiwTJO_KVdjPurEm6m9w.lBk19XAq1Pqhmb7FIKGnAw HTTP/1.1" 500 76190

@k-dahl
Copy link

k-dahl commented Apr 18, 2018

This seems to have something to do with Django 2.0, when I switched to 1.11 it worked fine for me.

@mbourqui
Copy link
Contributor

mbourqui commented Jul 16, 2018

I have this issue as well on Django 1.11.12. It occurs after users register on a Keycloak server, when they are redirected back to my website on the Keycloack registration process termination.
It also occurs on regular login.

@to-bee
Copy link

to-bee commented Aug 8, 2018

That happens when you run Django on 127.0.0.1:8000 and you set the redirect url to localhost:8000. Just open Django on localhost:8000 and it works.

@Allan-Nava
Copy link
Author

@to-bee i use dns but I still have the same error

@mbourqui
Copy link
Contributor

mbourqui commented Aug 8, 2018

It occurs on one of my website on production, and an other website using version 0.1 does not suffer this issue.

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

4 participants