Closed robertjd closed 8 years ago
This has been merged / released, so once you've updated the underlying stormpath sdk, it'll be good to go =)
Hey guys,
I updated stormpath and stormpath-django with pip3.4 in my local environment. Upon trying to login after five minutes I still get the following error. (Lines 132, 15, and 259 are highlighted).
Error at /stormpath-id-site-callback/
The session on ID Site has timed out. This can occur if the user stays on ID Site without logging in, registering, or resetting a password.
Request Method:
GET
Request URL:
http://127.0.0.1:8000/stormpath-id-site-callback/?jwtResponse=
▶ Local vars
/path/to/virtualenv
@avojnovicDk can you take a look at this? This should be fixed now.
This works exactly as I expected - it throws stormpath.error.Error
with message from the err
claim in the error JWT. Should this behave differently?
Ping @DanielStevenLewis. Looks like this is the expected functionality -- we are throwing a Stormpath Error object with the appropriate message here.
@rdegges @avojnovicDk
To quote Robert, "With this change, if the page has a timeout error we will send the user back to your site with the error message. Your server can then decide what to do, we assume you'll want to just redirect the user back to ID Site with a new session."
How are we supposed to redirect the user back to the ID site with a new session? The error seems to only be bubbling up to the stormpath app and django-stormpath app (not to my company's app) so I don't even know where to start implementing that behaviour.
Thanks
@DanielStevenLewis, you're right - it is not clear where to start with handling error JWT. I've made a simple example in django sample app: https://github.com/stormpath/stormpath-django-sample/commit/a0bdc66e194e9f2ac6eef03c44dc95e9991435f9 , so you can take a look.
Thanks @avojnovicDk , we got this working locally. I also figured out how to do it by writing middleware before you responded but this is definitely a cleaner solution.
Cheers
ID Site has been modified to return the user to the ID Site Callback with an error JWT, if an error occurs while using ID Site. For example, if the user times out on ID Site (the session expires) we return the user to the ID Site Callback with that error.
This error JWT has a different format from the normal JWT, please see "Error Token" on this page:
https://stormpath.atlassian.net/wiki/display/AM/JWT+Token
This library needs to be modified to return the error. At the moment it is throwing an exception because it is asserting certain claims: