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

Base64 decoding of SAML Response fails decoding UTF8 #57

Open
wscheicher opened this issue Oct 7, 2015 · 0 comments
Open

Base64 decoding of SAML Response fails decoding UTF8 #57

wscheicher opened this issue Oct 7, 2015 · 0 comments

Comments

@wscheicher
Copy link

After some mysterious Login Failures in our GitLab using omniauth saml i could identify the problem being the SAML response not being decoded properly.

Doing some more digging, i found this:
http://blog.zachallett.com/base64-decode64-does-bad-things-if-you-are-expecting-utf-8-encoded-strings/

Lacking any Ruby skills at all, i blindly appended .force_encoding('UTF-8').encode at this line in omniauth-saml-1.4.1/lib/omniauth/strategies/saml.rb :
response = (response =~ /^</) ? response : Base64.decode64(response)
Which fixed the problem for me.

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

1 participant