ruby-saml-for-portal 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2010 OneLogin, LLC
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,99 @@
1
+ It's a fork of Christian Pedersen and Christian M. Weis . Made for personal usage by Sycheva Elena.
2
+ = Ruby SAML
3
+
4
+ The Ruby SAML library is for implementing the client side of a SAML authorization, i.e. it provides a means for managing authorization initialization and confirmation requests from identity providers.
5
+
6
+ SAML authorization is a two step process and you are expected to implement support for both.
7
+
8
+ == The initialization phase
9
+
10
+ This is the first request you will get from the identity provider. It will hit your application at a specific URL (that you've announced as being your SAML initialization point). The response to this initialization, is a redirect back to the identity provider, which can look something like this (ignore the saml_settings method call for now):
11
+
12
+ def initialize
13
+ request = Onelogin::Saml::Authrequest.new
14
+ redirect_to(request.create(saml_settings))
15
+ end
16
+
17
+ Once you've redirected back to the identity provider, it will ensure that the user has been authorized and redirect back to your application for final consumption, this is can look something like this (the authorize_success and authorize_failure methods are specific to your application):
18
+
19
+ def consume
20
+ response = Onelogin::Saml::Response.new(params[:SAMLResponse])
21
+ response.settings = saml_settings
22
+
23
+ if response.is_valid? && user = current_account.users.find_by_email(response.name_id)
24
+ authorize_success(user)
25
+ else
26
+ authorize_failure(user)
27
+ end
28
+ end
29
+
30
+ In the above there are a few assumptions in place, one being that the response.name_id is an email address. This is all handled with how you specify the settings that are in play via the saml_settings method. That could be implemented along the lines of this:
31
+
32
+ def saml_settings
33
+ settings = Onelogin::Saml::Settings.new
34
+
35
+ settings.assertion_consumer_service_url = "http://#{request.host}/saml/finalize"
36
+ settings.issuer = request.host
37
+ settings.idp_sso_target_url = "https://app.onelogin.com/saml/signon/#{OneLoginAppId}"
38
+ settings.idp_cert_fingerprint = OneLoginAppCertFingerPrint
39
+ settings.name_identifier_format = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
40
+
41
+ settings
42
+ end
43
+
44
+ What's left at this point, is to wrap it all up in a controller and point the initialization and consumption URLs in OneLogin at that. A full controller example could look like this:
45
+
46
+ # This controller expects you to use the URLs /saml/initialize and /saml/consume in your OneLogin application.
47
+ class SamlController < ApplicationController
48
+ def initialize
49
+ request = Onelogin::Saml::Authrequest.new
50
+ redirect_to(request.create(saml_settings))
51
+ end
52
+
53
+ def consume
54
+ response = Onelogin::Saml::Response.new(params[:SAMLResponse])
55
+ response.settings = saml_settings
56
+
57
+ if response.is_valid? && user = current_account.users.find_by_email(response.name_id)
58
+ authorize_success(user)
59
+ else
60
+ authorize_failure(user)
61
+ end
62
+ end
63
+
64
+ private
65
+
66
+ def saml_settings
67
+ settings = Onelogin::Saml::Settings.new
68
+
69
+ settings.assertion_consumer_service_url = "http://#{request.host}/saml/consume"
70
+ settings.issuer = request.host
71
+ settings.idp_sso_target_url = "https://app.onelogin.com/saml/signon/#{OneLoginAppId}"
72
+ settings.idp_cert_fingerprint = OneLoginAppCertFingerPrint
73
+ settings.name_identifier_format = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
74
+
75
+ settings
76
+ end
77
+ end
78
+
79
+ If are using saml:AttributeStatement to transfare metadata, like the user name, you can access all the attributes through response.attributes. It
80
+ contains all the saml:AttributeStatement with its 'Name' as a indifferent key and the one saml:AttributeValue as value.
81
+
82
+ response = Onelogin::Saml::Response.new(params[:SAMLResponse])
83
+ response.settings = saml_settings
84
+
85
+ response.attributes[:username]
86
+
87
+
88
+ = Full Example
89
+
90
+ Please check https://github.com/onelogin/ruby-saml-example for a very basic sample Rails application using this gem.
91
+
92
+ == Note on Patches/Pull Requests
93
+
94
+ * Fork the project.
95
+ * Make your feature addition or bug fix.
96
+ * Add tests for it. This is important so I don't break it in a
97
+ future version unintentionally.
98
+ * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
99
+ * Send me a pull request. Bonus points for topic branches.
data/Rakefile ADDED
@@ -0,0 +1,63 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "ruby-saml"
8
+ gem.summary = %Q{SAML Ruby Tookit}
9
+ gem.description = %Q{SAML toolkit for Ruby on Rails}
10
+ gem.email = "support@onelogin.com"
11
+ gem.homepage = "http://github.com/onelogin/ruby-saml"
12
+ gem.authors = ["OneLogin LLC"]
13
+ gem.add_dependency("xmlcanonicalizer","= 0.1.0")
14
+ gem.add_dependency("uuid","= 2.3.1")
15
+ gem.add_dependency("rsa", "~> 0.1.4")
16
+ gem.add_dependency("systemu", "~> 2.2.0")
17
+ gem.add_development_dependency "shoulda"
18
+ gem.add_development_dependency "mocha"
19
+ #gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
20
+ end
21
+ Jeweler::GemcutterTasks.new
22
+ rescue LoadError
23
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
24
+ end
25
+
26
+ #not being used yet.
27
+ require 'rake/testtask'
28
+ Rake::TestTask.new(:test) do |test|
29
+ test.libs << 'lib' << 'test'
30
+ test.pattern = 'test/**/*_test.rb'
31
+ test.verbose = true
32
+ end
33
+
34
+ begin
35
+ require 'rcov/rcovtask'
36
+ Rcov::RcovTask.new do |test|
37
+ test.libs << 'test'
38
+ test.pattern = 'test/**/*_test.rb'
39
+ test.verbose = true
40
+ end
41
+ rescue LoadError
42
+ task :rcov do
43
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
44
+ end
45
+ end
46
+
47
+ task :test => :check_dependencies
48
+
49
+ task :default => :test
50
+
51
+ # require 'rake/rdoctask'
52
+ # Rake::RDocTask.new do |rdoc|
53
+ # if File.exist?('VERSION')
54
+ # version = File.read('VERSION')
55
+ # else
56
+ # version = ""
57
+ # end
58
+
59
+ # rdoc.rdoc_dir = 'rdoc'
60
+ # rdoc.title = "ruby-saml #{version}"
61
+ # rdoc.rdoc_files.include('README*')
62
+ # rdoc.rdoc_files.include('lib/**/*.rb')
63
+ #end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.3.2 p
@@ -0,0 +1,5 @@
1
+ require 'onelogin/saml/authrequest'
2
+ require 'onelogin/saml/response'
3
+ require 'onelogin/saml/settings'
4
+ require 'onelogin/saml/logout_request'
5
+
@@ -0,0 +1,33 @@
1
+ require "base64"
2
+ require "uuid"
3
+ require "zlib"
4
+ require "cgi"
5
+
6
+ module Onelogin::Saml
7
+ class Authrequest
8
+ def create(settings, params = {})
9
+ uuid = "_" + UUID.new.generate
10
+ time = Time.now.utc.strftime("%Y-%m-%dT%H:%M:%SZ")
11
+
12
+ request =
13
+ "<samlp:AuthnRequest xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" ID=\"#{uuid}\" Version=\"2.0\" IssueInstant=\"#{time}\" ProtocolBinding=\"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST\" AssertionConsumerServiceURL=\"#{settings.assertion_consumer_service_url}\">" +
14
+ "<saml:Issuer xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\">#{settings.issuer}</saml:Issuer>\n" +
15
+ "<samlp:NameIDPolicy xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" Format=\"#{settings.name_identifier_format}\" AllowCreate=\"true\"></samlp:NameIDPolicy>\n" +
16
+ "<samlp:RequestedAuthnContext xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" Comparison=\"exact\">" +
17
+ "<saml:AuthnContextClassRef xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\">urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef></samlp:RequestedAuthnContext>\n" +
18
+ "</samlp:AuthnRequest>"
19
+
20
+ deflated_request = Zlib::Deflate.deflate(request, 9)[2..-5]
21
+ base64_request = Base64.encode64(deflated_request)
22
+ encoded_request = CGI.escape(base64_request)
23
+ request_params = "?SAMLRequest=" + encoded_request
24
+
25
+ params.each_pair do |key, value|
26
+ request_params << "&#{key}=#{CGI.escape(value.to_s)}"
27
+ end
28
+
29
+ settings.idp_sso_target_url + request_params
30
+ end
31
+
32
+ end
33
+ end
@@ -0,0 +1,46 @@
1
+ require "xml_security"
2
+ require "time"
3
+
4
+ module Onelogin::Saml
5
+ class Response
6
+ attr_accessor :response, :document, :logger, :settings
7
+
8
+ def initialize(response)
9
+ raise ArgumentError.new("Response cannot be nil") if response.nil?
10
+ self.response = response
11
+ self.document = XMLSecurity::SignedDocument.new(Base64.decode64(response))
12
+ end
13
+
14
+ def is_valid?
15
+ return false if response.empty?
16
+ return false if settings.nil?
17
+ return true if document.validate_doc(settings.idp_public_cert, nil)
18
+ return false
19
+ end
20
+
21
+ def decode
22
+ body = document.decode(settings.private_key)
23
+ self.document = body
24
+ end
25
+
26
+ # The value of the user identifier as designated by the initialization request response
27
+ def name_id
28
+ @name_id ||= document.elements["saml2:Assertion/saml2:Subject/saml2:NameID"].text
29
+ end
30
+
31
+ def session_index
32
+ @session_index ||= document.elements["saml2:Assertion/saml2:AuthnStatement"].attributes["SessionIndex"]
33
+ end
34
+
35
+ # A hash of attributes and values
36
+ def attributes
37
+ result = {}
38
+ document.elements.each("saml2:Assertion/saml2:AttributeStatement/saml2:Attribute") do |element|
39
+ result.merge!(element.attributes["FriendlyName"] => element.elements.first.text)
40
+ end
41
+ result.merge!("name_id" => name_id)
42
+ result.merge!("session_index" => session_index)
43
+ result
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,30 @@
1
+ module Onelogin::Saml
2
+ class Settings
3
+ attr_accessor :assertion_consumer_service_url, :issuer, :sp_name_qualifier
4
+ attr_accessor :idp_sso_target_url, :idp_ssl_target_url, :idp_cert_fingerprint, :name_identifier_format
5
+
6
+ def private_key=(private_key_path)
7
+ @private_key = OpenSSL::PKey::RSA.new(File.read(private_key_path))
8
+ end
9
+
10
+ def private_key
11
+ @private_key
12
+ end
13
+
14
+ def idp_public_cert=(idp_public_cert_path)
15
+ @idp_public_cert = OpenSSL::X509::Certificate.new(File.read(idp_public_cert_path))
16
+ end
17
+
18
+ def idp_public_cert
19
+ @idp_public_cert
20
+ end
21
+
22
+ # def private_key_logout_sign=(private_key_path)
23
+ # @private_key_logout_sign = OpenSSL::PKey::RSA.new(File.read(private_key_path))
24
+ # end
25
+ #
26
+ # def private_key_logout_sign
27
+ # @private_key_logout_sign
28
+ # end
29
+ end
30
+ end
data/lib/rsa_ext.rb ADDED
@@ -0,0 +1,115 @@
1
+ require 'digest/sha1'
2
+ require 'rsa'
3
+
4
+ module RSA
5
+ module OAEP
6
+ extend self
7
+
8
+ # Represents an error that occurs during decoding when using
9
+ # RSA::OAEP.decode or RSA::OAEP.eme_decode. There is one argument which is
10
+ # a brief message detailing the error
11
+ class DecodeError < StandardError; end
12
+
13
+ # The algorithms below need the HLEN variable. This is the length of the
14
+ # hashes generated by the hashing function. For now, this only supports SHA1
15
+ # as the hashing function, and this has a hash length of 20
16
+ HLEN = 20
17
+
18
+ # Performs the rsa-oaep-mgf1 decrypt algorithm. This is specified in section
19
+ # 7.1.2 of http://www.ietf.org/rfc/rfc2437.txt.
20
+ #
21
+ # This implementation assumes that the sha1 hashing algorithm was used.
22
+ #
23
+ # @param [RSA::Key] k the private key whose public key was used to
24
+ # encrypt the data
25
+ # @param [String] c a string of raw bytes representing the text to be
26
+ # decoded
27
+ # @param [String] p the options which were used in the original encoding of
28
+ # the string. By default this is the empty string.
29
+ #
30
+ # @return [String] the decoded string of bytes
31
+ # @raise [DecodeError] If decoding cannot occur, an error is raised
32
+ def decode k, c, p = ''
33
+ # First, generate how many bytes the key's modulus is
34
+ n = k.modulus
35
+ bytes = 0
36
+ while n > 0
37
+ bytes += 1
38
+ n /= 2
39
+ end
40
+ bytes /= 8
41
+
42
+ raise DecodeError, 'input is wrong length!' unless c.length == bytes
43
+
44
+ enc = RSA::PKCS1.os2ip c
45
+ m = RSA::PKCS1.rsadp k, enc
46
+ em = RSA::PKCS1.i2osp m, bytes - 1
47
+
48
+ eme_decode em, p
49
+ end
50
+
51
+ # Decodes the encrypted message as specified by the algorithm listed on
52
+ # http://www.ietf.org/rfc/rfc2437.txt in section 9.1.1.2
53
+ #
54
+ # @param [String] em the encoded message that needs to be decoded
55
+ # @param [String] p the flags used in the original encoding scheme.
56
+ #
57
+ # @return [String] the decoded byte string of the supplied message
58
+ # @raise [DecodeError] if decoding goes awry or the message does not pass
59
+ # sanity checks during decoding
60
+ def eme_decode em, p = ''
61
+ raise DecodeError, 'message is too short!' if em.length < HLEN * 2 + 1
62
+
63
+ maskedSeed = em[0...HLEN]
64
+ maskedDB = em[HLEN..-1]
65
+ seedMask = mgf1 maskedDB, HLEN
66
+ seed = xor maskedSeed, seedMask
67
+ dbMask = mgf1 seed, em.size - HLEN
68
+ db = xor maskedDB, dbMask
69
+ pHash = Digest::SHA1.digest p
70
+
71
+ ind = db.index("\x01", HLEN)
72
+ raise DecodeError, 'message is invalid!' if ind.nil?
73
+
74
+ pHash2 = db[0...HLEN]
75
+ ps = db[HLEN...ind]
76
+ m = db[(ind + 1)..-1]
77
+
78
+ raise DecodeError, 'message is invalid!' unless ps.bytes.all?(&:zero?)
79
+ raise DecodeError, "specified p = #{p.inspect} is wrong!" unless pHash2 == pHash
80
+
81
+ m
82
+ end
83
+
84
+ # Defined in seciton 10.2.1 of http://www.ietf.org/rfc/rfc2437.txt, this
85
+ # is the mask generation function used in the eme_decode function
86
+ #
87
+ # @param [String] z this is the seed which the mask function runs off of
88
+ # @param [Integer] l the desired length of the resultant hash
89
+ #
90
+ # @return [String] the mask generated
91
+ def mgf1 z, l
92
+ t = ''
93
+
94
+ (0..(l / HLEN)).each{ |i|
95
+ t += Digest::SHA1.digest(z + RSA::PKCS1.i2osp(i, 4))
96
+ }
97
+
98
+ t[0...l]
99
+ end
100
+
101
+ private
102
+
103
+ def xor s1, s2
104
+ b1 = s1.unpack('c*')
105
+ b2 = s2.unpack('c*')
106
+
107
+ if b1.length != b2.length
108
+ raise DecodeError, 'cannot xor strings of different lengths!'
109
+ end
110
+
111
+ b1.zip(b2).map{ |a, b| a ^ b }.pack('c*')
112
+ end
113
+
114
+ end
115
+ end
data/lib/ruby-saml.rb ADDED
@@ -0,0 +1,5 @@
1
+ module Onelogin
2
+ end
3
+
4
+ require 'onelogin/saml'
5
+
@@ -0,0 +1,144 @@
1
+ # The contents of this file are subject to the terms
2
+ # of the Common Development and Distribution License
3
+ # (the License). You may not use this file except in
4
+ # compliance with the License.
5
+ #
6
+ # You can obtain a copy of the License at
7
+ # https://opensso.dev.java.net/public/CDDLv1.0.html or
8
+ # opensso/legal/CDDLv1.0.txt
9
+ # See the License for the specific language governing
10
+ # permission and limitations under the License.
11
+ #
12
+ # When distributing Covered Code, include this CDDL
13
+ # Header Notice in each file and include the License file
14
+ # at opensso/legal/CDDLv1.0.txt.
15
+ # If applicable, add the following below the CDDL Header,
16
+ # with the fields enclosed by brackets [] replaced by
17
+ # your own identifying information:
18
+ # "Portions Copyrighted [year] [name of copyright owner]"
19
+ #
20
+ # $Id: xml_sec.rb,v 1.6 2007/10/24 00:28:41 todddd Exp $
21
+ #
22
+ # Copyright 2007 Sun Microsystems Inc. All Rights Reserved
23
+ # Portions Copyrighted 2007 Todd W Saxton.
24
+
25
+ require 'rubygems'
26
+ require "rexml/document"
27
+ require "rexml/xpath"
28
+ require "openssl"
29
+ require "xmlcanonicalizer"
30
+ require "digest/sha1"
31
+ require 'rsa_ext'
32
+
33
+ module XMLSecurity
34
+
35
+ class SignedDocument < REXML::Document
36
+
37
+ def validate (idp_cert_fingerprint, logger = nil, private_key = nil)
38
+ # get cert from response
39
+ base64_cert = self.elements["//ds:X509Certificate"].text
40
+ cert_text = Base64.decode64(base64_cert)
41
+ cert = OpenSSL::X509::Certificate.new(cert_text)
42
+
43
+ # check cert matches registered idp cert
44
+ fingerprint = Digest::SHA1.hexdigest(cert.to_der)
45
+ valid_flag = fingerprint == idp_cert_fingerprint.gsub(":", "").downcase
46
+
47
+ return valid_flag if !valid_flag
48
+
49
+ if validate_doc(base64_cert, logger)
50
+ return true
51
+ # elsif private_key
52
+ # return decode(private_key)
53
+ else
54
+ return false
55
+ end
56
+ end
57
+
58
+ def validate_doc(cert, logger)
59
+ # validate references
60
+
61
+ # remove signature node
62
+ sig_element = REXML::XPath.first(self, "//ds:Signature", {"ds"=>"http://www.w3.org/2000/09/xmldsig#"})
63
+ return false unless sig_element
64
+ sig_element.remove
65
+
66
+ #временно выключили проверку дайджеста
67
+
68
+ # #check digests
69
+ # REXML::XPath.each(sig_element, "//ds:Reference", {"ds"=>"http://www.w3.org/2000/09/xmldsig#"}) do | ref |
70
+ #
71
+ # uri = ref.attributes.get_attribute("URI").value
72
+ # hashed_element = REXML::XPath.first(self, "//[@ID='#{uri[1,uri.size]}']")
73
+ # canoner = XML::Util::XmlCanonicalizer.new(false, true)
74
+ # canon_hashed_element = canoner.canonicalize(hashed_element)
75
+ # hash = Base64.encode64(Digest::SHA1.digest(canon_hashed_element)).chomp
76
+ # digest_value = REXML::XPath.first(ref, "//ds:DigestValue", {"ds"=>"http://www.w3.org/2000/09/xmldsig#"}).text
77
+ #
78
+ # valid_flag = hash == digest_value
79
+ #
80
+ # return valid_flag if !valid_flag
81
+ # end
82
+
83
+ # verify signature
84
+ canoner = XML::Util::XmlCanonicalizer.new(false, true)
85
+ signed_info_element = REXML::XPath.first(sig_element, "//ds:SignedInfo", {"ds"=>"http://www.w3.org/2000/09/xmldsig#"})
86
+ canon_string = canoner.canonicalize(signed_info_element)
87
+
88
+ base64_signature = REXML::XPath.first(sig_element, "//ds:SignatureValue", {"ds"=>"http://www.w3.org/2000/09/xmldsig#"}).text
89
+ signature = Base64.decode64(base64_signature)
90
+
91
+ # get certificate object
92
+ valid_flag = cert.public_key.verify(OpenSSL::Digest::SHA1.new, signature, canon_string)
93
+
94
+ return valid_flag
95
+ end
96
+
97
+ def decode private_key
98
+ # This is the public key which encrypted the first CipherValue
99
+ certs = REXML::XPath.match(self, '//ds:X509Certificate')#, 'ds' => "http://www.w3.org/2000/09/xmldsig#") array two elements dcert = REXML::XPath.first(self, '//ds:X509Certificate')#, 'ds' => "http://www.w3.org/2000/09/xmldsig#")
100
+
101
+ #Find the certificate for the private key
102
+ cert = certs.select{|c| OpenSSL::X509::Certificate.new(Base64.decode64(c.text)).check_private_key(private_key)}
103
+ unless cert.empty?
104
+ cert = cert[0]
105
+ else
106
+ return false
107
+ end
108
+ c1, c2 = REXML::XPath.match(self, '//xenc:CipherValue', 'xenc' => 'http://www.w3.org/2001/04/xmlenc#')
109
+
110
+ # Generate the key used for the cipher below via the RSA::OAEP algo
111
+ rsak = RSA::Key.new private_key.n, private_key.d
112
+ v1s = Base64.decode64(c1.text)
113
+
114
+ begin
115
+ cipherkey = RSA::OAEP.decode rsak, v1s
116
+ rescue RSA::OAEP::DecodeError
117
+ return false
118
+ end
119
+
120
+ # The aes-128-cbc cipher has a 128 bit initialization vector (16 bytes)
121
+ # and this is the first 16 bytes of the raw string.
122
+ bytes = Base64.decode64(c2.text).bytes.to_a
123
+ iv = bytes[0...16].pack('c*')
124
+ others = bytes[16..-1].pack('c*')
125
+
126
+ cipher = OpenSSL::Cipher.new('aes-128-cbc')
127
+ cipher.decrypt
128
+ cipher.iv = iv
129
+ cipher.key = cipherkey
130
+
131
+ out = cipher.update(others)
132
+
133
+ # The encrypted string's length might not be a multiple of the block
134
+ # length of aes-128-cbc (16), so add in another block and then trim
135
+ # off the padding. More info about padding is available at
136
+ # http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html in
137
+ # Section 5.2
138
+ out << cipher.update("\x00" * 16)
139
+ padding = out.bytes.to_a.last
140
+ self.class.new(out[0..-(padding + 1)])
141
+ end
142
+
143
+ end
144
+ end
data/ruby-saml.gemspec ADDED
@@ -0,0 +1,76 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{ruby-saml-for-portal}
8
+ s.version = "0.3.3"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["OneLogin LLC"]
12
+ s.date = %q{2011-03-08}
13
+ s.description = %q{SAML toolkit for Ruby on Rails}
14
+ s.email = %q{support@onelogin.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ "LICENSE",
21
+ "README.rdoc",
22
+ "Rakefile",
23
+ "VERSION",
24
+ "lib/onelogin/saml.rb",
25
+ "lib/onelogin/saml/authrequest.rb",
26
+ "lib/onelogin/saml/response.rb",
27
+ "lib/onelogin/saml/settings.rb",
28
+ "lib/ruby-saml.rb",
29
+ "lib/xml_security.rb",
30
+ "lib/rsa_ext.rb",
31
+ "ruby-saml.gemspec",
32
+ "test/response.txt",
33
+ "test/ruby-saml_test.rb",
34
+ "test/test_helper.rb",
35
+ "test/xml_security_test.rb"
36
+ ]
37
+ s.homepage = %q{http://github.com/onelogin/ruby-saml}
38
+ s.rdoc_options = ["--charset=UTF-8"]
39
+ s.require_paths = ["lib"]
40
+ s.rubygems_version = %q{1.3.7}
41
+ s.summary = %q{SAML Ruby Tookit}
42
+ s.test_files = [
43
+ "test/ruby-saml_test.rb",
44
+ "test/test_helper.rb",
45
+ "test/xml_security_test.rb"
46
+ ]
47
+
48
+ if s.respond_to? :specification_version then
49
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
50
+ s.specification_version = 3
51
+
52
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
53
+ s.add_runtime_dependency(%q<xmlcanonicalizer>, ["~> 0.1.1"])
54
+ s.add_runtime_dependency(%q<uuid>, ["~> 2.3.3"])
55
+ s.add_runtime_dependency(%q<systemu>, ["~> 2.2.0"])
56
+ s.add_runtime_dependency(%q<rsa>, ["~> 0.1.4"])
57
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
58
+ s.add_development_dependency(%q<mocha>, [">= 0"])
59
+ else
60
+ s.add_dependency(%q<xmlcanonicalizer>, ["~> 0.1.1"])
61
+ s.add_dependency(%q<uuid>, ["~> 2.3.3"])
62
+ s.add_dependency(%q<systemu>, ["~> 2.2.0"])
63
+ s.add_dependency(%q<rsa>, ["~> 0.1.4"])
64
+ s.add_dependency(%q<shoulda>, [">= 0"])
65
+ s.add_dependency(%q<mocha>, [">= 0"])
66
+ end
67
+ else
68
+ s.add_dependency(%q<xmlcanonicalizer>, ["~> 0.1.1"])
69
+ s.add_dependency(%q<uuid>, ["~> 2.3.3"])
70
+ s.add_dependency(%q<systemu>, ["~> 2.2.0"])
71
+ s.add_dependency(%q<rsa>, ["~> 0.1.4"])
72
+ s.add_dependency(%q<shoulda>, [">= 0"])
73
+ s.add_dependency(%q<mocha>, [">= 0"])
74
+ end
75
+ end
76
+
data/test/response.tx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8
+ end
9
+ should "should provide getters and settings" do
10
+ accessors = [
11
+ :assertion_consumer_service_url, :issuer, :sp_name_qualifier, :sp_name_qualifier,
12
+ :idp_sso_target_url, :idp_cert_fingerprint, :name_identifier_format
13
+ ]
14
+
15
+ accessors.each do |accessor|
16
+ value = Kernel.rand
17
+ @settings.send("#{accessor}=".to_sym, value)
18
+ assert_equal value, @settings.send(accessor)
19
+ end
20
+ end
21
+ end
22
+
23
+ context "Response" do
24
+ should "provide setter for a logger" do
25
+ response = Onelogin::Saml::Response.new('')
26
+ assert response.logger = 'hello'
27
+ end
28
+
29
+ should "raise an exception when response is initialized with nil" do
30
+ assert_raises(ArgumentError) { Onelogin::Saml::Response.new(nil) }
31
+ end
32
+
33
+ context "#is_valid?" do
34
+ should "return false when response is initialized with blank data" do
35
+ response = Onelogin::Saml::Response.new('')
36
+ assert !response.is_valid?
37
+ end
38
+
39
+ should "return false if settings have not been set" do
40
+ response = Onelogin::Saml::Response.new(response_document)
41
+ assert !response.is_valid?
42
+ end
43
+
44
+ should "return true when the response is initialized with valid data" do
45
+ response = Onelogin::Saml::Response.new(response_document)
46
+ settings = Onelogin::Saml::Settings.new
47
+ settings.idp_cert_fingerprint = 'hello'
48
+ response.settings = settings
49
+ assert !response.is_valid?
50
+ document = stub()
51
+ document.stubs(:validate).returns(true)
52
+ response.document = document
53
+ assert response.is_valid?
54
+ end
55
+ end
56
+
57
+ context "#name_id" do
58
+ should "extract the value of the name id element" do
59
+ response = Onelogin::Saml::Response.new(response_document)
60
+ assert_equal "support@onelogin.com", response.name_id
61
+ end
62
+ end
63
+
64
+ context "#attributes" do
65
+ should "extract the first attribute in a hash accessed via its symbol" do
66
+ response = Onelogin::Saml::Response.new(response_document)
67
+ assert_equal "demo", response.attributes[:uid]
68
+ end
69
+
70
+ should "extract the first attribute in a hash accessed via its name" do
71
+ response = Onelogin::Saml::Response.new(response_document)
72
+ assert_equal "demo", response.attributes["uid"]
73
+ end
74
+
75
+ should "extract all attributes" do
76
+ response = Onelogin::Saml::Response.new(response_document)
77
+ assert_equal "demo", response.attributes[:uid]
78
+ assert_equal "value", response.attributes[:another_value]
79
+ end
80
+ end
81
+
82
+ context "#session_expires_at" do
83
+ should "extract the value of the SessionNotOnOrAfter attribute" do
84
+ response = Onelogin::Saml::Response.new(response_document)
85
+ assert response.session_expires_at.is_a?(Time)
86
+ end
87
+ end
88
+ end
89
+
90
+ context "Authrequest" do
91
+ should "create the SAMLRequest URL parameter" do
92
+ settings = Onelogin::Saml::Settings.new
93
+ settings.idp_sso_target_url = "http://stuff.com"
94
+ auth_url = Onelogin::Saml::Authrequest.new.create(settings)
95
+ assert auth_url =~ /^http:\/\/stuff\.com\?SAMLRequest=/
96
+ payload = CGI.unescape(auth_url.split("=").last)
97
+ end
98
+
99
+ should "accept extra parameters" do
100
+ settings = Onelogin::Saml::Settings.new
101
+ settings.idp_sso_target_url = "http://stuff.com"
102
+
103
+ auth_url = Onelogin::Saml::Authrequest.new.create(settings, { :hello => "there" })
104
+ assert auth_url =~ /&hello=there$/
105
+
106
+ auth_url = Onelogin::Saml::Authrequest.new.create(settings, { :hello => nil })
107
+ assert auth_url =~ /&hello=$/
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,14 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+ require 'mocha'
5
+
6
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
7
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
8
+ require 'ruby-saml'
9
+
10
+ class Test::Unit::TestCase
11
+ def response_document
12
+ @response_document ||= File.read(File.join(File.dirname(__FILE__), 'response.txt'))
13
+ end
14
+ end
@@ -0,0 +1,16 @@
1
+ require 'test_helper'
2
+ require 'xml_security'
3
+
4
+ class XmlSecurityTest < Test::Unit::TestCase
5
+ include XMLSecurity
6
+ context "XmlSecurity" do
7
+ setup do
8
+ @document = XMLSecurity::SignedDocument.new(Base64.decode64(response_document))
9
+ end
10
+
11
+ should "should run validate without throwing NS related exceptions" do
12
+ base64cert = @document.elements["//ds:X509Certificate"].text
13
+ @document.validate_doc(base64cert, nil)
14
+ end
15
+ end
16
+ end
metadata ADDED
@@ -0,0 +1,132 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby-saml-for-portal
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.3
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - OneLogin LLC
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-03-08 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: xmlcanonicalizer
16
+ requirement: &16186840 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 0.1.1
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *16186840
25
+ - !ruby/object:Gem::Dependency
26
+ name: uuid
27
+ requirement: &16186240 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: 2.3.3
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *16186240
36
+ - !ruby/object:Gem::Dependency
37
+ name: systemu
38
+ requirement: &16185640 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: 2.2.0
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *16185640
47
+ - !ruby/object:Gem::Dependency
48
+ name: rsa
49
+ requirement: &16183480 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 0.1.4
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: *16183480
58
+ - !ruby/object:Gem::Dependency
59
+ name: shoulda
60
+ requirement: &16182960 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *16182960
69
+ - !ruby/object:Gem::Dependency
70
+ name: mocha
71
+ requirement: &16182440 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: *16182440
80
+ description: SAML toolkit for Ruby on Rails
81
+ email: support@onelogin.com
82
+ executables: []
83
+ extensions: []
84
+ extra_rdoc_files:
85
+ - LICENSE
86
+ - README.rdoc
87
+ files:
88
+ - LICENSE
89
+ - README.rdoc
90
+ - Rakefile
91
+ - VERSION
92
+ - lib/onelogin/saml.rb
93
+ - lib/onelogin/saml/authrequest.rb
94
+ - lib/onelogin/saml/response.rb
95
+ - lib/onelogin/saml/settings.rb
96
+ - lib/ruby-saml.rb
97
+ - lib/xml_security.rb
98
+ - lib/rsa_ext.rb
99
+ - ruby-saml.gemspec
100
+ - test/response.txt
101
+ - test/ruby-saml_test.rb
102
+ - test/test_helper.rb
103
+ - test/xml_security_test.rb
104
+ homepage: http://github.com/onelogin/ruby-saml
105
+ licenses: []
106
+ post_install_message:
107
+ rdoc_options:
108
+ - --charset=UTF-8
109
+ require_paths:
110
+ - lib
111
+ required_ruby_version: !ruby/object:Gem::Requirement
112
+ none: false
113
+ requirements:
114
+ - - ! '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ required_rubygems_version: !ruby/object:Gem::Requirement
118
+ none: false
119
+ requirements:
120
+ - - ! '>='
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ requirements: []
124
+ rubyforge_project:
125
+ rubygems_version: 1.8.8
126
+ signing_key:
127
+ specification_version: 3
128
+ summary: SAML Ruby Tookit
129
+ test_files:
130
+ - test/ruby-saml_test.rb
131
+ - test/test_helper.rb
132
+ - test/xml_security_test.rb