ruby-saml-mod 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,7 @@ module Onelogin::Saml
17
17
  issue_instant = Onelogin::Saml::AuthRequest.get_timestamp
18
18
 
19
19
  @request_xml =
20
- "<samlp:AuthnRequest xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" ID=\"#{@id}\" Version=\"2.0\" IssueInstant=\"#{issue_instant}\" ProtocolBinding=\"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST\" AssertionConsumerServiceURL=\"#{settings.assertion_consumer_service_url}\">" +
20
+ "<samlp:AuthnRequest xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" ID=\"#{@id}\" Version=\"2.0\" IssueInstant=\"#{issue_instant}\" ProtocolBinding=\"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST\" AssertionConsumerServiceURL=\"#{Array(settings.assertion_consumer_service_url).first}\">" +
21
21
  "<saml:Issuer xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\">#{@settings.issuer}</saml:Issuer>\n" +
22
22
  "<samlp:NameIDPolicy xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" Format=\"#{@settings.name_identifier_format}\" AllowCreate=\"true\"></samlp:NameIDPolicy>\n"
23
23
 
@@ -41,8 +41,8 @@ module Onelogin::Saml
41
41
  def self.generate_unique_id(length)
42
42
  chars = ("a".."f").to_a + ("0".."9").to_a
43
43
  chars_len = chars.size
44
- unique_id = ""
45
- 1.upto(length) { |i| unique_id << chars[rand(chars_len-1)] }
44
+ unique_id = ("a".."f").to_a[rand(6)]
45
+ 2.upto(length) { |i| unique_id << chars[rand(chars_len)] }
46
46
  unique_id
47
47
  end
48
48
 
@@ -23,7 +23,13 @@ module Onelogin::Saml
23
23
  end
24
24
  xml += %{
25
25
  <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="#{settings.sp_slo_url}"/>
26
- <AssertionConsumerService index="0" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="#{settings.assertion_consumer_service_url}"/>
26
+ }
27
+ Array(settings.assertion_consumer_service_url).each_with_index do |url, index|
28
+ xml += %{
29
+ <AssertionConsumerService index="#{index}" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="#{url}"/>
30
+ }
31
+ end
32
+ xml += %{
27
33
  </SPSSODescriptor>
28
34
  <ContactPerson contactType="technical">
29
35
  <SurName>#{settings.tech_contact_name}</SurName>
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{ruby-saml-mod}
3
- s.version = "0.1.7"
3
+ s.version = "0.1.8"
4
4
 
5
- s.authors = ["OneLogin LLC", "Bracken", "Zach"]
5
+ s.authors = ["OneLogin LLC", "Bracken", "Zach", "Cody"]
6
6
  s.date = %q{2012-02-06}
7
7
  s.extra_rdoc_files = [
8
8
  "LICENSE"
metadata CHANGED
@@ -1,18 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-saml-mod
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 7
10
- version: 0.1.7
9
+ - 8
10
+ version: 0.1.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - OneLogin LLC
14
14
  - Bracken
15
15
  - Zach
16
+ - Cody
16
17
  autorequire:
17
18
  bindir: bin
18
19
  cert_chain: []