Auth0 Home Blog Docs

Exception Value: Session value state missing


#1

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 http://10.5.125.20:30030 everything stops to work. Effectively it fails with the following error message.

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

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

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

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

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

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

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

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

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

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

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

File “/portal-env/lib/python3.6/site-packages/social_core/backends/oauth.py” 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
http://10.5.125.20:30030/accounts/complete/auth0?code=5D0AGmNchxHFsyeP&state=3mf5vxCWLUz9HbBjmsXCDJgIf9DyqQnA.

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