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

How to handle status other than 'Success' gracefully #30

Open
HDenBreejen opened this issue Apr 20, 2018 · 2 comments
Open

How to handle status other than 'Success' gracefully #30

HDenBreejen opened this issue Apr 20, 2018 · 2 comments

Comments

@HDenBreejen
Copy link

My IDP responds with a 'Responder' status when the user at some point cancels the authentication.
SAML2 throws an exception when on any status other then Success.

I need to handle this situation gracefully in my app. Perhaps I would like to redirect to a 'Try again' page.
The only way of doing this I can think of, is examining the exception. A Saml20Exception, however, does not have a error code, so I would have to resort to testing the Mesage property.

Unless there is a better way to approach this situation, I would suggest adding some properties to the Saml20Exception, so the application can handle specific situations.

Specifically for my scenario, an extra endpoint attribute for a non-success redirect-url would do fine, but that would not be as versatile.

@i8beef
Copy link
Owner

i8beef commented Apr 24, 2018

I would instead say that a more robust list of Exceptions would be better here for you to catch. Do you just need it to throw something like a Saml20BadStatusCodeResponse or something?

@HDenBreejen
Copy link
Author

HDenBreejen commented May 14, 2018

Sorry for the delayed response - I had some time off line..
Introducing a set of specific exceptions would be fine too. That would give the application the opportunity to differentiate where necessary.
For my exact situation, a Saml20BadStatusCodeResponse exception, having a property with the actual statuscode received, would be great.

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

2 participants