Skip to content

Commit b9b6996

Browse files
committed
Document options[:raw_get_params] in README.md
Explains the new parameter, and why to use it.
1 parent 9c701f6 commit b9b6996

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
# Ruby SAML [![Build Status](https://secure.travis-ci.org/onelogin/ruby-saml.svg)](http://travis-ci.org/onelogin/ruby-saml) [![Coverage Status](https://coveralls.io/repos/onelogin/ruby-saml/badge.svg?branch=master%0A)](https://coveralls.io/r/onelogin/ruby-saml?branch=master%0A) [![Gem Version](https://badge.fury.io/rb/ruby-saml.svg)](http://badge.fury.io/rb/ruby-saml)
22

3+
## Updating from 1.5.0 to 1.6.0
4+
5+
Version `1.6.0` changes the preferred way to construct instances of `Logoutresponse` and `SloLogoutrequest`. Previously the _SAMLResponse_, _RelayState_, and _SigAlg_ parameters of these message types were provided via the constructor's `options[:get_params]` parameter. Unfortunately this can result in incompatibility with other SAML implementations; signatures are specified to be computed based on the _sender's_ URI-encoding of the message, which can differ from that of Ruby SAML. In particular, Ruby SAML's URI-encoding does not match that of Microsoft ADFS, so messages from ADFS can fail signature validation.
6+
7+
The new preferred way to provide _SAMLResponse_, _RelayState_, and _SigAlg_ is via the `options[:raw_get_params]` parameter. For example:
8+
9+
```ruby
10+
# In this example `query_params` is assumed to contain decoded query parameters,
11+
# and `raw_query_params` is assumed to contain encoded query parameters as sent
12+
# by the IDP.
13+
settings = {
14+
settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1
15+
settings.soft = false
16+
}
17+
options = {
18+
get_params: {
19+
"Signature" => query_params["Signature"],
20+
},
21+
raw_get_params: {
22+
"SAMLRequest" => raw_query_params["SAMLRequest"],
23+
"SigAlg" => raw_query_params["SigAlg"],
24+
"RelayState" => raw_query_params["RelayState"],
25+
},
26+
}
27+
slo_logout_request = OneLogin::RubySaml::SloLogoutrequest.new(query_params["SAMLRequest"], settings, options)
28+
raise "Uh oh!" unless slo_logout_request.is_valid?
29+
```
30+
31+
The old form is still supported for backward compatibility, but all Ruby SAML users should prefer `options[:raw_get_params]` where possible to ensure compatibility with other SAML implementations.
32+
333
## Updating from 1.4.2 to 1.4.3
434

535
Version `1.4.3` introduces Recipient validation of SubjectConfirmation elements.

0 commit comments

Comments
 (0)