omniauth-saml icon indicating copy to clipboard operation
omniauth-saml copied to clipboard

Base64 decoding of SAML Response fails decoding UTF8

Open wscheicher opened this issue 9 years ago • 0 comments

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.

wscheicher avatar Oct 07 '15 11:10 wscheicher