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

Logout response validation failed with Authentication failed error #489

Open
alexanderzobnin opened this issue Feb 2, 2023 · 2 comments · May be fixed by #491
Open

Logout response validation failed with Authentication failed error #489

alexanderzobnin opened this issue Feb 2, 2023 · 2 comments · May be fixed by #491

Comments

@alexanderzobnin
Copy link
Contributor

When single logout is enabled, SP fails to perform logout with error Authentication failed. I tried to debug and found that error is happening in ValidateLogoutResponseRedirect(). It returns errors like
invalid character entity &d (no semicolon) or invalid UTF-8. After some investigation, I've found that it's related to compressed response. Error happens here:

if err := doc.ReadFromBytes(rawResponseBuf); err != nil {

rawResponseBuf contains compressed bytes and should be deflate first. In previous versions it was correct:

if _, err := doc.ReadFrom(bytes.NewReader(gr)); err != nil {

where gr is deflated string:

gr, err := ioutil.ReadAll(flate.NewReader(bytes.NewBuffer(rawResponseBuf)))

So I think the fix is pretty straightforward.

@rgl
Copy link

rgl commented Feb 4, 2023

@alexanderzobnin, is it because of this that the trivial example http://localhost:8000/logout endpoint ends up redirecting to http://localhost:8000/saml/slo and returning a 404?

@alexanderzobnin
Copy link
Contributor Author

@rgl not sure, error here is happening during logout response processing, so it should not end up with 404, but with error ("Authentication failed").

@alexanderzobnin alexanderzobnin linked a pull request Feb 6, 2023 that will close 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

Successfully merging a pull request may close this issue.

2 participants