Auth0 Home Blog Docs

Exception Value: Session value state missing


Hi All.
Im not sure if anyone had come across this issue. I cant find a solution for it. Im working django framework with the OpenConnectId extented to interface it with the Auth0.

When im accessing witth http://localhost:30030 everything works wine. The movement i change the host to an IP address everything stops to work. Effectively it fails with the following error message.

File “/portal-env/lib/python3.6/site-packages/django/core/handlers/” in inner
41. response = get_response(request)

File “/portal-env/lib/python3.6/site-packages/django/core/handlers/” in _get_response
187. response = self.process_exception_by_middleware(e, request)

File “/portal-env/lib/python3.6/site-packages/django/core/handlers/” in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File “/portal-env/lib/python3.6/site-packages/django/views/decorators/” in _wrapped_view_func
57. response = view_func(request, *args, **kwargs)

File “/portal-env/lib/python3.6/site-packages/django/views/decorators/” in wrapped_view
58. return view_func(*args, **kwargs)

File “/portal-env/lib/python3.6/site-packages/social_django/” in wrapper
49. return func(request, backend, *args, **kwargs)

File “/portal-env/lib/python3.6/site-packages/social_django/” in complete
33. *args, **kwargs)

File “/portal-env/lib/python3.6/site-packages/social_core/” in do_complete
41. user = backend.complete(user=user, *args, **kwargs)

File “/portal-env/lib/python3.6/site-packages/social_core/backends/” in complete
40. return self.auth_complete(*args, **kwargs)

File “/portal-env/lib/python3.6/site-packages/social_core/” in wrapper
252. return func(*args, **kwargs)

File “/portal-env/lib/python3.6/site-packages/social_core/backends/” in auth_complete
388. state = self.validate_state()

File “/portal-env/lib/python3.6/site-packages/social_core/backends/” in validate_state
90. raise AuthStateMissing(self, ‘state’)

Exception Type: AuthStateMissing at /accounts/complete/auth0
Exception Value: Session value state missing.

Even though the url looks like this

The fails because it cant find state and code url params, when they are present. Looks at the oauth auth_complete method it loks for those url params and when they are not set it raises an exception. The question when are the session set after the change url from localhost to ip address?

Am I missing something?

Any help would greatly be appreciated.

Many thanks