libsaml 3.6.0 → 3.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9eea4c36aa9fc6f404ff5e6283c2ef39c1cb0e328652edc5e5fda2ceb7b21416
4
- data.tar.gz: d76324210f3fe2863f82f89ac7b7317bc295798ec10982b903f2e3b2700dd62f
3
+ metadata.gz: e689c8b19f26da4c7cc09904fb18cb052088834f32567abf14023219f9987481
4
+ data.tar.gz: cbc544b35d8b045d11c09c85f074234466d33b1a90a91a229d47d594456cc646
5
5
  SHA512:
6
- metadata.gz: 40a5e18247a43f3e215ce6045d51feeb2774a86e649b4702a64533555b4c5c98b83dad3927b3238929d141f0c49a1078903a278b2ccd76cdf6c29d6188f71839
7
- data.tar.gz: 0eda4d5265000e0da3fc7d2650b69064cda9de9914a287cecb2974e077f42d4c76d05e30e7025a56f6ba7173128c63a652b185f0253424715e6e62227f5bdb45
6
+ metadata.gz: 1b11d5dda8bf220251d944a1c8397075e33b0c98c67a42b6d0e61bffe0c67722a8628e79461880d3ecd9d982751ef322ff5485a18cd320c024f1ef13e5d80827
7
+ data.tar.gz: cec277eeadebc7a6c4f5294437b34f7a39daff47873c9e35ad95e6c42e0f91429580bca880214c4e95728f17cdf599694e60981bab8d24c2483f99ab0c79c1cb
data/README.md CHANGED
@@ -94,10 +94,10 @@ Now you can make a SAML controller in `app/controllers/saml_controller.rb`:
94
94
  ```ruby
95
95
  class SamlController < ApplicationController
96
96
  extend Saml::Rails::ControllerHelper
97
- current_provider "entity_id"
97
+ current_provider "<sp_entity_id>"
98
98
 
99
99
  def request_authentication
100
- provider = Saml.provider("my:very:original:entityid")
100
+ provider = Saml.provider("<idp_enity_id>")
101
101
  destination = provider.single_sign_on_service_url(Saml::ProtocolBinding::HTTP_POST)
102
102
 
103
103
  authn_request = Saml::AuthnRequest.new(destination: destination)
@@ -153,7 +153,7 @@ Below is an example of a very primitive IDP Saml Controller
153
153
  ```ruby
154
154
  class SamlController < ActionController::Base
155
155
  extend Saml::Rails::ControllerHelper
156
- current_provider "entity_id"
156
+ current_provider "<idp_entity_id>"
157
157
 
158
158
  def receive_authn_request
159
159
  authn_request = if request.get?
@@ -227,6 +227,10 @@ class SamlController < ActionController::Base
227
227
  end
228
228
  ```
229
229
 
230
+ ## Caveats
231
+
232
+ - SAMLResponse and Assertions have to be signed as per the SAML security guidelines (Some IDP's don't do this by default and require special configuration)
233
+
230
234
  ## Contributing
231
235
 
232
236
  - Fork the project
@@ -5,7 +5,7 @@ module Saml
5
5
 
6
6
  class << self
7
7
  def create_url(request_or_response, options = {})
8
- options[:signature_algorithm] ||= 'http://www.w3.org/2000/09/xmldsig#rsa-sha1'
8
+ options[:signature_algorithm] ||= 'http://www.w3.org/2000/09/xmldsig#rsa-sha1' unless options[:exclude_signature]
9
9
  new(request_or_response, options).create_url
10
10
  end
11
11
 
@@ -42,13 +42,14 @@ module Saml
42
42
  end
43
43
  end
44
44
 
45
- attr_accessor :request_or_response, :signature_algorithm, :relay_state, :signature
45
+ attr_accessor :request_or_response, :signature_algorithm, :relay_state, :signature, :exclude_signature
46
46
 
47
47
  def initialize(request_or_response, options = {})
48
48
  @request_or_response = request_or_response
49
49
  @signature_algorithm = options[:signature_algorithm]
50
50
  @relay_state = options[:relay_state]
51
51
  @signature = options[:signature]
52
+ @exclude_signature = options[:exclude_signature]
52
53
  end
53
54
 
54
55
  def verify_signature(query)
@@ -61,7 +62,7 @@ module Saml
61
62
  url = request_or_response.destination
62
63
  delimiter = url.include?('?') ? '&' : '?'
63
64
 
64
- [url, signed_params].join(delimiter)
65
+ [url, exclude_signature ? unsigned_params : signed_params].join(delimiter)
65
66
  end
66
67
 
67
68
  private
@@ -108,6 +109,10 @@ module Saml
108
109
 
109
110
  "#{encoded_params}&Signature=#{encoded_signature}"
110
111
  end
112
+
113
+ def unsigned_params
114
+ encoded_params.to_s
115
+ end
111
116
  end
112
117
  end
113
118
  end
@@ -1,3 +1,3 @@
1
1
  module Saml
2
- VERSION = '3.6.0'
2
+ VERSION = '3.7.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libsaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.0
4
+ version: 3.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoist Claassen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-10 00:00:00.000000000 Z
11
+ date: 2020-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport