commit c499eff45da8be8957df1c655f25abdf722e544f Author: Bohung Date: Sat May 14 11:53:04 2022 +0800 First push.(with ruby-saml 1.14.0) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..de5d954 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.bundle/ +log/*.log +pkg/ +test/dummy/db/*.sqlite3 +test/dummy/db/*.sqlite3-journal +test/dummy/log/*.log +test/dummy/tmp/ +test/dummy/.sass-cache diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..255a076 --- /dev/null +++ b/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +# Declare your gem's dependencies in sso_login_box.gemspec. +# Bundler will treat runtime dependencies like base dependencies, and +# development dependencies will be added by default to the :development group. +gemspec + +# Declare any dependencies that are still in development here instead of in +# your gemspec. These might include edge Rails or gems from your path or +# Git. Remember to move these dependencies to your gemspec before releasing +# your gem to rubygems.org. + +# To use debugger +# gem 'debugger' diff --git a/MIT-LICENSE b/MIT-LICENSE new file mode 100644 index 0000000..1b43c7a --- /dev/null +++ b/MIT-LICENSE @@ -0,0 +1,20 @@ +Copyright 2021 BOHUNG CHIU + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.rdoc b/README.rdoc new file mode 100644 index 0000000..310853b --- /dev/null +++ b/README.rdoc @@ -0,0 +1,3 @@ += SsoLoginBox + +This project rocks and uses MIT-LICENSE. \ No newline at end of file diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..eabba2e --- /dev/null +++ b/Rakefile @@ -0,0 +1,34 @@ +begin + require 'bundler/setup' +rescue LoadError + puts 'You must `gem install bundler` and `bundle install` to run rake tasks' +end + +require 'rdoc/task' + +RDoc::Task.new(:rdoc) do |rdoc| + rdoc.rdoc_dir = 'rdoc' + rdoc.title = 'SsoLoginBox' + rdoc.options << '--line-numbers' + rdoc.rdoc_files.include('README.rdoc') + rdoc.rdoc_files.include('lib/**/*.rb') +end + +APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) +load 'rails/tasks/engine.rake' + + + +Bundler::GemHelper.install_tasks + +require 'rake/testtask' + +Rake::TestTask.new(:test) do |t| + t.libs << 'lib' + t.libs << 'test' + t.pattern = 'test/**/*_test.rb' + t.verbose = false +end + + +task default: :test diff --git a/app/assets/images/sso_login_box/.keep b/app/assets/images/sso_login_box/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/controllers/sso_login_box_controller.rb b/app/controllers/sso_login_box_controller.rb new file mode 100644 index 0000000..65f23c3 --- /dev/null +++ b/app/controllers/sso_login_box_controller.rb @@ -0,0 +1,125 @@ +class SsoLoginBoxController < SessionsController + require 'openssl' + require 'onelogin/ruby-saml' + OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE + def sso_auth_page + session[:referer_url] = params[:referer_url] + puts ["session", session, session.to_hash] + request = OneLogin::RubySaml::Authrequest.new + redirect_to(request.create(saml_settings)) + end + def sso_sign_in + puts ["SSO sign in"] + puts "------------------------------" + response = OneLogin::RubySaml::Response.new(params[:SAMLResponse], {:settings => saml_settings, :allowed_clock_drift=> "60"}) + # puts response.inspect + # response = OneLogin::RubySaml::Response.new(params[:SAMLResponse], {skip_authnstatement: true}) # skips AuthnStatement + # response = OneLogin::RubySaml::Response.new(params[:SAMLResponse], {skip_conditions: true}) # skips conditions + # response = OneLogin::RubySaml::Response.new(params[:SAMLResponse], {skip_subject_confirmation: true}) # skips subject confirmation + # response = OneLogin::RubySaml::Response.new(params[:SAMLResponse], {skip_recipient_check: true}) # doesn't skip subject confirmation, but skips the recipient check which is a sub check of the subject_confirmation check + # response = OneLogin::RubySaml::Response.new(params[:SAMLResponse], {skip_audience: true}) # skips audience check + # We validate the SAML Response and check if the user already exists in the system + if response.is_valid? + attributes = response.attributes + puts ["attributes", attributes.inspect] + if true#["f", "s"].include?(attributes["AccountTypeCode"]) + email = attributes["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"] + member_name = attributes["ChineseName"] + sid = attributes["SEQ"] + matched_member = sid.present? ? MemberProfile.where(:sid=>sid).first : nil + user = nil + if matched_member + user = matched_member.user + else + matched_member = MemberProfile.where(:email=>email).first + if matched_member + user = matched_member.user + else + user = member_name.present? ? User.where("member_name.zh_tw"=> member_name).first : nil + end + end + if !user.nil? + session[:sso_token] = user.id + session[:user_id] = user.id + session[:login_referer] = nil + if params[:referer_url].present? + redirect_to URI.parse(params[:referer_url]).path + else + redirect_to admin_dashboards_path + end + else + @login_referer = session[:referer_url] + flash.now.alert = I18n.t("sso_login_box_for_ntu.user_not_in_database",:sid=>sid,:name=>member_name,:email=>email).gsub("\n","
").html_safe + render "new" + end + else + @login_referer = session[:referer_url] + flash.now.alert = I18n.t("sso_login_box_for_ntu.not_staff") + render "new" + end + else + puts ["errors", response.instance_variable_get(:@errors)] + @login_referer = session[:referer_url] + flash.now.alert = I18n.t("sso_login_box_for_ntu.sso_authorized_failure") + render "new" + end + end + def delete_session + reset_session + end + # Create a SP initiated SLO + def sp_logout_request + # LogoutRequest accepts plain browser requests w/o paramters + settings = saml_settings + + if settings.idp_slo_service_url.nil? + delete_session + else + logout_request = OneLogin::RubySaml::Logoutrequest.new + if settings.name_identifier_value.nil? + settings.name_identifier_value = session[:user_id] + end + + # Ensure user is logged out before redirect to IdP, in case anything goes wrong during single logout process (as recommended by saml2int [SDP-SP34]) + logged_user = session[:user_id] + delete_session + + # Save the transaction_id to compare it with the response we get back + session[:transaction_id] = logout_request.uuid + session[:logged_out_user] = logged_user + + relayState = "https://#{request.host}" + redirect_to(logout_request.create(settings, :RelayState => relayState)) + end + end + private + + def saml_settings + settings = OneLogin::RubySaml::Settings.new + request_host = request.host + settings.assertion_consumer_service_url = "https://#{request_host}/ntu_sso/response?referer_url=#{params[:referer_url]}" + settings.issuer = request_host + settings.idp_sso_target_url = "https://adfs.ntu.edu.tw/adfs/ls/" + # settings.idp_sso_target_binding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" # or :post, :redirect + settings.idp_slo_target_url = "https://adfs.ntu.edu.tw/adfs/ls/clearall.aspx?url=https://#{request_host}" + # settings.idp_slo_service_binding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" # or :post, :redirect + settings.idp_cert_fingerprint = "34:65:21:EB:1C:F8:43:52:69:CC:93:B8:D0:6B:F7:5D:9D:09:9D:76" + settings.idp_cert_fingerprint_algorithm = "http://www.w3.org/2000/09/xmldsig#sha1" + # settings.security[:signature_method] = XMLSecurity::Document::SHA256 + # settings.name_identifier_format = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" + + # # Optional for most SAML IdPs + # settings.authn_context = "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport" + # # or as an array + # settings.authn_context = [ + # "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport", + # "urn:oasis:names:tc:SAML:2.0:ac:classes:Password" + # ] + + # Optional bindings (defaults to Redirect for logout POST for ACS) + settings.single_logout_service_binding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" # or :post, :redirect + settings.assertion_consumer_service_binding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" # or :post, :redirect + + settings + end +end \ No newline at end of file diff --git a/bin/rails b/bin/rails new file mode 100644 index 0000000..e1f279d --- /dev/null +++ b/bin/rails @@ -0,0 +1,12 @@ +#!/usr/bin/env ruby +# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. + +ENGINE_ROOT = File.expand_path('../..', __FILE__) +ENGINE_PATH = File.expand_path('../../lib/sso_login_box/engine', __FILE__) + +# Set up gems listed in the Gemfile. +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) + +require 'rails/all' +require 'rails/engine/commands' diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 0000000..92a4833 --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,5 @@ +en: + sso_login_box_for_ncu: + user_not_in_database: "Name: %{name}\nEmail: %{email}\nStaff number: %{sid}\n not in database. Ask the administrator to help you create your account first and then try again." + sso_authorized_failure: "SSO Authorized failure!" + not_staff: "SSO only provide professor, Associate Professor and administration staff to login!" \ No newline at end of file diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml new file mode 100644 index 0000000..5e938a3 --- /dev/null +++ b/config/locales/zh_tw.yml @@ -0,0 +1,5 @@ +zh_tw: + sso_login_box_for_ntu: + user_not_in_database: "姓名: %{name}\nEmail: %{email}\n教師職員編號: %{sid}\n在資料庫中不存在。請聯繫網站管理員創建該使用者之會員後,再進行登入。" + sso_authorized_failure: "sso驗證錯誤!" + not_staff: "SSO只提供 教授 、 副教授 、 行政人員 進行登入!" \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000..a626790 --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,9 @@ +Rails.application.routes.draw do + locales = Site.first.in_use_locales rescue I18n.available_locales + + scope "(:locale)", locale: Regexp.new(locales.join("|")) do + post 'ntu_sso/response', to: 'sso_login_box#sso_sign_in' + get 'ntu_sso', to: 'sso_login_box#sso_auth_page' + get 'ntu_sso/logout', to: 'sso_login_box#sp_logout_request' + end +end \ No newline at end of file diff --git a/lib/sso_login_box.rb b/lib/sso_login_box.rb new file mode 100644 index 0000000..ef74da7 --- /dev/null +++ b/lib/sso_login_box.rb @@ -0,0 +1,7 @@ +require "sso_login_box/engine" + +module SsoLoginBox + def self.logout_url + "/ntu_sso/logout" + end +end diff --git a/lib/sso_login_box/engine.rb b/lib/sso_login_box/engine.rb new file mode 100644 index 0000000..a98db71 --- /dev/null +++ b/lib/sso_login_box/engine.rb @@ -0,0 +1,11 @@ +require "yaml" +module SsoLoginBox + class Engine < ::Rails::Engine + initializer "sso_login_box" do + OrbitApp.registration "SsoLoginBox", :type => "ModuleApp" do + base_url File.expand_path File.dirname(__FILE__) + set_keyword_contstraints ['/ntu_sso'] + end + end + end +end diff --git a/lib/sso_login_box/login_tag.rb b/lib/sso_login_box/login_tag.rb new file mode 100644 index 0000000..9429d09 --- /dev/null +++ b/lib/sso_login_box/login_tag.rb @@ -0,0 +1,14 @@ +module SsoLoginBox::LoginTag + def self.show + " +
+ +
" + end +end diff --git a/lib/sso_login_box/version.rb b/lib/sso_login_box/version.rb new file mode 100644 index 0000000..48476ff --- /dev/null +++ b/lib/sso_login_box/version.rb @@ -0,0 +1,3 @@ +module SsoLoginBox + VERSION = "0.0.1" +end diff --git a/lib/tasks/sso_login_box_tasks.rake b/lib/tasks/sso_login_box_tasks.rake new file mode 100644 index 0000000..19297ab --- /dev/null +++ b/lib/tasks/sso_login_box_tasks.rake @@ -0,0 +1,4 @@ +# desc "Explaining what the task does" +# task :sso_login_box do +# # Task goes here +# end diff --git a/ruby-saml-custom/.document b/ruby-saml-custom/.document new file mode 100644 index 0000000..ecf3673 --- /dev/null +++ b/ruby-saml-custom/.document @@ -0,0 +1,5 @@ +README.rdoc +lib/**/*.rb +bin/* +features/**/*.feature +LICENSE diff --git a/ruby-saml-custom/.gitignore b/ruby-saml-custom/.gitignore new file mode 100644 index 0000000..f7c0e3e --- /dev/null +++ b/ruby-saml-custom/.gitignore @@ -0,0 +1,14 @@ +*.sw? +.DS_Store +coverage +rdoc +pkg +Gemfile.lock +gemfiles/*.lock +.idea/* +lib/Lib.iml +test/Test.iml +.rvmrc +*.gem +.bundle +*.patch diff --git a/ruby-saml-custom/CHANGELOG.md b/ruby-saml-custom/CHANGELOG.md new file mode 100644 index 0000000..d045328 --- /dev/null +++ b/ruby-saml-custom/CHANGELOG.md @@ -0,0 +1,275 @@ +# Ruby SAML Changelog +### 1.14.0 (Feb 01, 2022) +* [#627](https://github.com/onelogin/ruby-saml/pull/627) Support escape downcasing for validating SLO Signatures of ADFS/Azure +* [#633](https://github.com/onelogin/ruby-saml/pull/633) Support ability to change ID prefix +* Make the uuid editable on the SAML Messages generated by the toolkit +* [#622](https://github.com/onelogin/ruby-saml/pull/622) Add security setting to more strictly enforce audience validation + +### 1.13.0 (Sept 06, 2021) +* [#611](https://github.com/onelogin/ruby-saml/pull/601) Replace MAX_BYTE_SIZE constant with setting: message_max_bytesize +* [#605](https://github.com/onelogin/ruby-saml/pull/605) :allowed_clock_drift is now bidrectional +* [#614](https://github.com/onelogin/ruby-saml/pull/614) Support :name_id_format option for IdpMetadataParser +* [#611](https://github.com/onelogin/ruby-saml/pull/611) IdpMetadataParser should always set idp_cert_multi, even when there is only one cert +* [#610](https://github.com/onelogin/ruby-saml/pull/610) New IDP sso/slo binding params which deprecate :embed_sign +* [#602](https://github.com/onelogin/ruby-saml/pull/602) Refactor the OneLogin::RubySaml::Metadata class +* [#586](https://github.com/onelogin/ruby-saml/pull/586) Support milliseconds in cacheDuration parsing +* [#585](https://github.com/onelogin/ruby-saml/pull/585) Do not append " | " to StatusCode unnecessarily +* [#607](https://github.com/onelogin/ruby-saml/pull/607) Clean up +* Add warning about the use of IdpMetadataParser class and SSRF +* CI: Migrate from Travis to Github Actions + +### 1.12.2 (Apr 08, 2021) +* [#575](https://github.com/onelogin/ruby-saml/pull/575) Fix SloLogoutresponse bug on LogoutRequest + +### 1.12.1 (Apr 05, 2021) +* Fix XPath typo incompatible with Rexml 3.2.5 +* Refactor GCM support + +### 1.12.0 (Feb 18, 2021) +* Support AES-128-GCM, AES-192-GCM, and AES-256-GCM encryptions +* Parse & return SLO ResponseLocation in IDPMetadataParser & Settings +* Adding idp_sso_service_url and idp_slo_service_url settings +* [#536](https://github.com/onelogin/ruby-saml/pull/536) Adding feth method to be able retrieve attributes based on regex +* Reduce size of built gem by excluding the test folder +* Improve protection on Zlib deflate decompression bomb attack. +* Add ValidUntil and cacheDuration support on Metadata generator +* Add support for cacheDuration at the IdpMetadataParser +* Support customizable statusCode on generated LogoutResponse +* [#545](https://github.com/onelogin/ruby-saml/pull/545) More specific error messages for signature validation +* Support Process Transform +* Raise SettingError if invoking an action with no endpoint defined on the settings +* Made IdpMetadataParser more extensible for subclasses +*[#548](https://github.com/onelogin/ruby-saml/pull/548) Add :skip_audience option +* [#555](https://github.com/onelogin/ruby-saml/pull/555) Define 'soft' variable to prevent exception when doc cert is invalid +* Improve documentation + +### 1.11.0 (Jul 24, 2019) + +* Deprecate settings.issuer in favor of settings.sp_entity_id +* Add support for certification expiration + +### 1.10.2 (Apr 29, 2019) + +* Add valid until, accessor +* Fix Rubygem metadata that requested nokogiri <= 1.5.11 + +### 1.10.1 (Apr 08, 2019) + +* Fix ruby 1.8.7 incompatibilities + +### 1.10.0 (Mar 21, 2019) +* Add Subject support on AuthNRequest to allow SPs provide info to the IdP about the user to be authenticated +* Improves IdpMetadataParser to allow parse multiple IDPSSODescriptors +* Improves format_cert method to accept certs with /\x0d/ +* Forces nokogiri >= 1.8.2 when possible + +### 1.9.0 (Sept 03, 2018) +* [#458](https://github.com/onelogin/ruby-saml/pull/458) Remove ruby 2.4+ warnings +* Improve JRuby support +* [#465](https://github.com/onelogin/ruby-saml/pull/465) Extend Settings initialization with the new keep_security_attributes parameter +* Fix wrong message when SessionNotOnOrAfter expired +* [#471](https://github.com/onelogin/ruby-saml/pull/471) Allow for `allowed_clock_drift` to be set as a string + +### 1.8.0 (April 23, 2018) +* [#437](https://github.com/onelogin/ruby-saml/issues/437) Creating AuthRequests/LogoutRequests/LogoutResponses with nil RelayState should not send empty RelayState URL param +* [#454](https://github.com/onelogin/ruby-saml/pull/454) Added Response available options +* [#453](https://github.com/onelogin/ruby-saml/pull/453) Raise a more descriptive exception if idp_sso_target_url is missing +* [#452](https://github.com/onelogin/ruby-saml/pull/452) Fix behavior of skip_conditions flag on Response +* [#449](https://github.com/onelogin/ruby-saml/pull/449) Add ability to skip authnstatement validation +* Clear cached values to be able to use IdpMetadataParser more than once +* Updated invalid audience error message + +### 1.7.2 (Feb 28, 2018) +* [#446](https://github.com/onelogin/ruby-saml/pull/446) Normalize text returned by OneLogin::RubySaml::Utils.element_text + +### 1.7.1 (Feb 28, 2018) +* [#444](https://github.com/onelogin/ruby-saml/pull/444) Fix audience validation for empty audience restriction + +### 1.7.0 (Feb 27, 2018) +* Fix vulnerability CVE-2017-11428. Process text of nodes properly, ignoring comments + +### 1.6.1 (January 15, 2018) +* [#428](https://github.com/onelogin/ruby-saml/issues/428) Fix a bug on IdPMetadataParser when parsing certificates +* [#426](https://github.com/onelogin/ruby-saml/pull/426) Ensure `Rails` responds to `logger` + +### 1.6.0 (November 27, 2017) +* [#418](https://github.com/onelogin/ruby-saml/pull/418) Improve SAML message signature validation using original encoded parameters instead decoded in order to avoid conflicts (URL-encoding is not canonical, reported issues with ADFS) +* [#420](https://github.com/onelogin/ruby-saml/pull/420) Expose NameID Format on SloLogoutrequest +* [#423](https://github.com/onelogin/ruby-saml/pull/423) Allow format_cert to work with chained certificates +* [#422](https://github.com/onelogin/ruby-saml/pull/422) Use to_s for requested attribute value + + +### 1.5.0 (August 31, 2017) +* [#400](https://github.com/onelogin/ruby-saml/pull/400) When validating Signature use stored IdP certficate if Signature contains no info about Certificate +* [#402](https://github.com/onelogin/ruby-saml/pull/402) Fix validate_response_state method that rejected SAMLResponses when using idp_cert_multi and idp_cert and idp_cert_fingerprint were not provided. +* [#411](https://github.com/onelogin/ruby-saml/pull/411) Allow space in Base64 string +* [#407](https://github.com/onelogin/ruby-saml/issues/407) Improve IdpMetadataParser raising an ArgumentError when parser method receive a metadata string with no IDPSSODescriptor element. +* [#374](https://github.com/onelogin/ruby-saml/issues/374) Support more than one level of StatusCode +* [#405](https://github.com/onelogin/ruby-saml/pull/405) Support ADFS encrypted key (Accept KeyInfo nodes with no ds namespace) + + +### 1.4.3 (May 18, 2017) +* Added SubjectConfirmation Recipient validation +* [#393](https://github.com/onelogin/ruby-saml/pull/393) Implement IdpMetadataParser#parse_to_hash +* Adapt IdP XML metadata parser to take care of multiple IdP certificates and be able to inject the data obtained on the settings. +* Improve binding detection on idp metadata parser +* [#373](https://github.com/onelogin/ruby-saml/pull/373) Allow metadata to be retrieved from source containing data for multiple entities +* Be able to register future SP x509cert on the settings and publish it on SP metadata +* Be able to register more than 1 Identity Provider x509cert, linked with an specific use (signing or encryption. +* Improve regex to detect base64 encoded messages +* Fix binding configuration example in README.md +* Add Fix SLO request. Correct NameQualifier/SPNameQualifier values. +* Validate serial number as string to work around libxml2 limitation +* Propagate isRequired on md:RequestedAttribute when generating SP metadata + +### 1.4.2 (January 11, 2017) +* Improve tests format +* Fix nokogiri requirements based on ruby version +* Only publish `KeyDescriptor[use="encryption"]` at SP metadata if `security[:want_assertions_encrypted]` is true +* Be able to skip destination validation +* Improved inResponse validation on SAMLResponses and LogoutResponses +* [#354](https://github.com/onelogin/ruby-saml/pull/354) Allow scheme and domain to match ignoring case +* [#363](https://github.com/onelogin/ruby-saml/pull/363) Add support for multiple requested attributes + +### 1.4.1 (October 19, 2016) +* [#357](https://github.com/onelogin/ruby-saml/pull/357) Add EncryptedAttribute support. Improve decrypt method +* Allow multiple authn_context_decl_ref in settings +* Allow options[:settings] to be an hash for Settings overrides in IdpMetadataParser#parse +* Recover issuers method + +### 1.4.0 (October 13, 2016) +* Several security improvements: + * Conditions element required and unique. + * AuthnStatement element required and unique. + * SPNameQualifier must math the SP EntityID + * Reject saml:Attribute element with same “Name” attribute + * Reject empty nameID + * Require Issuer element. (Must match IdP EntityID). + * Destination value can't be blank (if present must match ACS URL). + * Check that the EncryptedAssertion element only contains 1 Assertion element. + +* [#335](https://github.com/onelogin/ruby-saml/pull/335) Explicitly parse as XML and fix setting of Nokogiri options. +* [#345](https://github.com/onelogin/ruby-saml/pull/345)Support multiple settings.auth_context +* More tests to prevent XML Signature Wrapping +* [#342](https://github.com/onelogin/ruby-saml/pull/342) Correct the usage of Mutex +* [352](https://github.com/onelogin/ruby-saml/pull/352) Support multiple AttributeStatement tags + + +### 1.3.1 (July 10, 2016) +* Fix response_test.rb of gem 1.3.0 +* Add reference to Security Guidelines +* Update License +* [#334](https://github.com/onelogin/ruby-saml/pull/334) Keep API backward-compatibility on IdpMetadataParser fingerprint method. + +### 1.3.0 (June 24, 2016) +* [Security Fix](https://github.com/onelogin/ruby-saml/commit/a571f52171e6bfd87db59822d1d9e8c38fb3b995) Add extra validations to prevent Signature wrapping attacks +* Fix XMLSecurity SHA256 and SHA512 uris +* [#326](https://github.com/onelogin/ruby-saml/pull/326) Fix Destination validation + +### 1.2.0 (April 29, 2016) +* [#269](https://github.com/onelogin/ruby-saml/pull/269) Refactor error handling; allow collect error messages when soft=true (normal validation stop after find first error) +* [#289](https://github.com/onelogin/ruby-saml/pull/289) Remove uuid gem in favor of SecureRandom +* [#297](https://github.com/onelogin/ruby-saml/pull/297) Implement EncryptedKey RetrievalMethod support +* [#298](https://github.com/onelogin/ruby-saml/pull/298) IDP metadata parsing improved: binding parsing, fingerprint_algorithm support) +* [#299](https://github.com/onelogin/ruby-saml/pull/299) Make 'signing' at KeyDescriptor optional +* [#308](https://github.com/onelogin/ruby-saml/pull/308) Support name_id_format on SAMLResponse +* [#315](https://github.com/onelogin/ruby-saml/pull/315) Support for canonicalization with comments +* [#316](https://github.com/onelogin/ruby-saml/pull/316) Fix Misspelling of transation_id to transaction_id +* [#321](https://github.com/onelogin/ruby-saml/pull/321) Support Attribute Names on IDPSSODescriptor parser +* Changes on empty URI of Signature reference management +* [#320](https://github.com/onelogin/ruby-saml/pull/320) Dont mutate document to fix lack of reference URI +* [#306](https://github.com/onelogin/ruby-saml/pull/306) Support WantAssertionsSigned + +### 1.1.2 (February 15, 2016) +* Improve signature validation. Add tests. + [#302](https://github.com/onelogin/ruby-saml/pull/302) Add Destination validation. +* [#292](https://github.com/onelogin/ruby-saml/pull/292) Improve the error message when validating the audience. +* [#287](https://github.com/onelogin/ruby-saml/pull/287) Keep the extracted certificate when parsing IdP metadata. + +### 1.1.1 (November 10, 2015) +* [#275](https://github.com/onelogin/ruby-saml/pull/275) Fix a bug on signature validations that invalidates valid SAML messages. + +### 1.1.0 (October 27, 2015) +* [#273](https://github.com/onelogin/ruby-saml/pull/273) Support SAMLResponse without ds:x509certificate +* [#270](https://github.com/onelogin/ruby-saml/pull/270) Allow SAML elements to come from any namespace (at decryption process) +* [#261](https://github.com/onelogin/ruby-saml/pull/261) Allow validate_subject_confirmation Response validation to be skipped +* [#258](https://github.com/onelogin/ruby-saml/pull/258) Fix allowed_clock_drift on the validate_session_expiration test +* [#256](https://github.com/onelogin/ruby-saml/pull/256) Separate the create_authentication_xml_doc in two methods. +* [#255](https://github.com/onelogin/ruby-saml/pull/255) Refactor validate signature. +* [#254](https://github.com/onelogin/ruby-saml/pull/254) Handle empty URI references +* [#251](https://github.com/onelogin/ruby-saml/pull/251) Support qualified and unqualified NameID in attributes +* [#234](https://github.com/onelogin/ruby-saml/pull/234) Add explicit support for JRuby + +### 1.0.0 (June 30, 2015) +* [#247](https://github.com/onelogin/ruby-saml/pull/247) Avoid entity expansion (XEE attacks) +* [#246](https://github.com/onelogin/ruby-saml/pull/246) Fix bug generating Logout Response (issuer was at wrong order) +* [#243](https://github.com/onelogin/ruby-saml/issues/243) and [#244](https://github.com/onelogin/ruby-saml/issues/244) Fix metadata builder errors. Fix metadata xsd. +* [#241](https://github.com/onelogin/ruby-saml/pull/241) Add decrypt support (EncryptID and EncryptedAssertion). Improve compatibility with namespaces. +* [#240](https://github.com/onelogin/ruby-saml/pull/240) and [#238](https://github.com/onelogin/ruby-saml/pull/238) Improve test coverage and refactor. +* [#239](https://github.com/onelogin/ruby-saml/pull/239) Improve security: Add more validations to SAMLResponse, LogoutRequest and LogoutResponse. Refactor code and improve tests coverage. +* [#237](https://github.com/onelogin/ruby-saml/pull/237) Don't pretty print metadata by default. +* [#235](https://github.com/onelogin/ruby-saml/pull/235) Remove the soft parameter from validation methods. Now can be configured on the settings and each class read it and store as an attribute of the class. Adding some validations and refactor old ones. +* [#232](https://github.com/onelogin/ruby-saml/pull/232) Improve validations: Store the causes in the errors array, code refactor +* [#231](https://github.com/onelogin/ruby-saml/pull/231) Refactor HTTP-Redirect Sign method, Move test data to right folder +* [#226](https://github.com/onelogin/ruby-saml/pull/226) Ensure IdP certificate is formatted properly +* [#225](https://github.com/onelogin/ruby-saml/pull/225) Add documentation to several methods. Fix xpath injection on xml_security.rb +* [#223](https://github.com/onelogin/ruby-saml/pull/223) Allow logging to be delegated to an arbitrary Logger +* [#222](https://github.com/onelogin/ruby-saml/pull/222) No more silent failure fetching idp metadata (OneLogin::RubySaml::HttpError raised). + +### 0.9.2 (Apr 28, 2015) +* [#216](https://github.com/onelogin/ruby-saml/pull/216) Add fingerprint algorithm support +* [#218](https://github.com/onelogin/ruby-saml/pull/218) Update README.md +* [#214](https://github.com/onelogin/ruby-saml/pull/214) Cleanup `SamlMessage` class +* [#213](https://github.com/onelogin/ruby-saml/pull/213) Add ability to sign metadata. (Improved) +* [#212](https://github.com/onelogin/ruby-saml/pull/212) Rename library entry point +* [#210](https://github.com/onelogin/ruby-saml/pull/210) Call assert in tests +* [#208](https://github.com/onelogin/ruby-saml/pull/208) Update tests and CI for Ruby 2.2.0 +* [#205](https://github.com/onelogin/ruby-saml/pull/205) Allow requirement of single files +* [#204](https://github.com/onelogin/ruby-saml/pull/204) Require ‘net/http’ library +* [#201](https://github.com/onelogin/ruby-saml/pull/201) Freeze and duplicate default security settings hash so that it doesn't get modified. +* [#200](https://github.com/onelogin/ruby-saml/pull/200) Set default SSL certificate store in Ruby 1.8. +* [#199](https://github.com/onelogin/ruby-saml/pull/199) Change Nokogiri's runtime dependency to fix support for Ruby 1.8.7. +* [#179](https://github.com/onelogin/ruby-saml/pull/179) Add support for setting the entity ID and name ID format when parsing metadata +* [#175](https://github.com/onelogin/ruby-saml/pull/175) Introduce thread safety to SAML schema validation +* [#171](https://github.com/onelogin/ruby-saml/pull/171) Fix inconsistent results with using regex matches in decode_raw_saml + +### 0.9.1 (Feb 10, 2015) +* [#194](https://github.com/onelogin/ruby-saml/pull/194) Relax nokogiri gem requirements +* [#191](https://github.com/onelogin/ruby-saml/pull/191) Use Minitest instead of Test::Unit + +### 0.9 (Jan 26, 2015) +* [#169](https://github.com/onelogin/ruby-saml/pull/169) WantAssertionSigned should be either true or false +* [#167](https://github.com/onelogin/ruby-saml/pull/167) (doc update) make unit of clock drift obvious +* [#160](https://github.com/onelogin/ruby-saml/pull/160) Extended solution for Attributes method [] can raise NoMethodError +* [#158](https://github.com/onelogin/ruby-saml/pull/1) Added ability to specify attribute services in metadata +* [#154](https://github.com/onelogin/ruby-saml/pull/154) Fix incorrect gem declaration statement +* [#152](https://github.com/onelogin/ruby-saml/pull/152) Fix the PR #99 +* [#150](https://github.com/onelogin/ruby-saml/pull/150) Nokogiri already in gemspec +* [#147](https://github.com/onelogin/ruby-saml/pull/147) Fix LogoutResponse issuer validation and implement SAML Response issuer validation. +* [#144](https://github.com/onelogin/ruby-saml/pull/144) Fix DigestMethod lookup bug +* [#139](https://github.com/onelogin/ruby-saml/pull/139) Fixes handling of some soft and hard validation failures +* [#138](https://github.com/onelogin/ruby-saml/pull/138) Change logoutrequest.rb to UTC time +* [#136](https://github.com/onelogin/ruby-saml/pull/136) Remote idp metadata +* [#135](https://github.com/onelogin/ruby-saml/pull/135) Restored support for NIL as well as empty AttributeValues +* [#134](https://github.com/onelogin/ruby-saml/pull/134) explicitly require "onelogin/ruby-saml/logging" +* [#133](https://github.com/onelogin/ruby-saml/pull/133) Added license to gemspec +* [#132](https://github.com/onelogin/ruby-saml/pull/132) Support AttributeConsumingServiceIndex in AuthnRequest +* [#131](https://github.com/onelogin/ruby-saml/pull/131) Add ruby 2.1.1 to .travis.yml +* [#122](https://github.com/onelogin/ruby-saml/pull/122) Fixes #112 and #117 in a backwards compatible manner +* [#119](https://github.com/onelogin/ruby-saml/pull/119) Add support for extracting IdP details from metadata xml + +### 0.8.2 (Jan 26, 2015) +* [#183](https://github.com/onelogin/ruby-saml/pull/183) Resolved a security vulnerability where string interpolation in a `REXML::XPath.first()` method call allowed for arbitrary code execution. + +### 0.8.0 (Feb 21, 2014) +**IMPORTANT**: This release changed namespace of the gem from `OneLogin::Saml` to `OneLogin::RubySaml`. Please update your implementations of the gem accordingly. + +* [#111](https://github.com/onelogin/ruby-saml/pull/111) `Onelogin::` is `OneLogin::` +* [#108](https://github.com/onelogin/ruby-saml/pull/108) Change namespacing from `Onelogin::Saml` to `Onelogin::Rubysaml` + + +### 0.7.3 (Feb 20, 2014) +Updated gem dependencies to be compatible with Ruby 1.8.7-p374 and 1.9.3-p448. Removed unnecessary `canonix` gem dependency. + +* [#107](https://github.com/onelogin/ruby-saml/pull/107) Relax nokogiri version requirement to >= 1.5.0 +* [#105](https://github.com/onelogin/ruby-saml/pull/105) Lock Gem versions, fix to resolve possible namespace collision diff --git a/ruby-saml-custom/Gemfile b/ruby-saml-custom/Gemfile new file mode 100644 index 0000000..cc119f9 --- /dev/null +++ b/ruby-saml-custom/Gemfile @@ -0,0 +1,6 @@ +# +# Please keep this file alphabetized and organized +# +source 'https://rubygems.org' + +gemspec diff --git a/ruby-saml-custom/LICENSE b/ruby-saml-custom/LICENSE new file mode 100644 index 0000000..dbbca9c --- /dev/null +++ b/ruby-saml-custom/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2010-2016 OneLogin, Inc. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + diff --git a/ruby-saml-custom/README.md b/ruby-saml-custom/README.md new file mode 100644 index 0000000..2bbb402 --- /dev/null +++ b/ruby-saml-custom/README.md @@ -0,0 +1,908 @@ +# Ruby SAML +[![Build Status](https://github.com/onelogin/ruby-saml/actions/workflows/test.yml/badge.svg?query=branch%3Amaster)](https://github.com/onelogin/ruby-saml/actions/workflows/test.yml?query=branch%3Amaster) +[![Coverage Status](https://coveralls.io/repos/onelogin/ruby-saml/badge.svg?branch=master)](https://coveralls.io/r/onelogin/ruby-saml?branch=master) + +Ruby SAML minor and tiny versions may introduce breaking changes. Please read +[UPGRADING.md](UPGRADING.md) for guidance on upgrading to new Ruby SAML versions. + +## Overview + +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. + +SAML authorization is a two step process and you are expected to implement support for both. + +We created a demo project for Rails 4 that uses the latest version of this library: +[ruby-saml-example](https://github.com/onelogin/ruby-saml-example) + +### Supported Ruby Versions + +The following Ruby versions are covered by CI testing: + +* 2.1.x +* 2.2.x +* 2.3.x +* 2.4.x +* 2.5.x +* 2.6.x +* 2.7.x +* 3.0.x +* JRuby 9.1.x +* JRuby 9.2.x +* TruffleRuby (latest) + +In addition, the following may work but are untested: + +* 1.8.7 +* 1.9.x +* 2.0.x +* JRuby 1.7.x +* JRuby 9.0.x + +## Adding Features, Pull Requests + +* Fork the repository +* Make your feature addition or bug fix +* Add tests for your new features. This is important so we don't break any features in a future version unintentionally. +* Ensure all tests pass by running `bundle exec rake test`. +* Do not change rakefile, version, or history. +* Open a pull request, following [this template](https://gist.github.com/Lordnibbler/11002759). + +## Security Guidelines + +If you believe you have discovered a security vulnerability in this gem, please report it +at https://www.onelogin.com/security with a description. We follow responsible disclosure +guidelines, and will work with you to quickly find a resolution. + +### Security Warning + +Some tools may incorrectly report ruby-saml is a potential security vulnerability. +ruby-saml depends on Nokogiri, and it's possible to use Nokogiri in a dangerous way +(by enabling its DTDLOAD option and disabling its NONET option). +This dangerous Nokogiri configuration, which is sometimes used by other components, +can create an XML External Entity (XXE) vulnerability if the XML data is not trusted. +However, ruby-saml never enables this dangerous Nokogiri configuration; +ruby-saml never enables DTDLOAD, and it never disables NONET. + +The OneLogin::RubySaml::IdpMetadataParser class does not validate in any way the URL +that is introduced in order to be parsed. + +Usually the same administrator that handles the Service Provider also sets the URL to +the IdP, which should be a trusted resource. + +But there are other scenarios, like a SAAS app where the administrator of the app +delegates this functionality to other users. In this case, extra precaution should +be taken in order to validate such URL inputs and avoid attacks like SSRF. + +## Getting Started + +In order to use Ruby SAML you will need to install the gem (either manually or using Bundler), +and require the library in your Ruby application: + +Using `Gemfile` + +```ruby +# latest stable +gem 'ruby-saml', '~> 1.11.0' + +# or track master for bleeding-edge +gem 'ruby-saml', :github => 'onelogin/ruby-saml' +``` + +Using RubyGems + +```sh +gem install ruby-saml +``` + +You may require the entire Ruby SAML gem: + +```ruby +require 'onelogin/ruby-saml' +``` + +or just the required components individually: + +```ruby +require 'onelogin/ruby-saml/authrequest' +``` + +### Installation on Ruby 1.8.7 + +This gem uses Nokogiri as a dependency, which dropped support for Ruby 1.8.x in Nokogiri 1.6. +When installing this gem on Ruby 1.8.7, you will need to make sure a version of Nokogiri +prior to 1.6 is installed or specified if it hasn't been already. + +Using `Gemfile` + +```ruby +gem 'nokogiri', '~> 1.5.10' +``` + +Using RubyGems + +```sh +gem install nokogiri --version '~> 1.5.10' +```` + +### Configuring Logging + +When troubleshooting SAML integration issues, you will find it extremely helpful to examine the +output of this gem's business logic. By default, log messages are emitted to RAILS_DEFAULT_LOGGER +when the gem is used in a Rails context, and to STDOUT when the gem is used outside of Rails. + +To override the default behavior and control the destination of log messages, provide +a ruby Logger object to the gem's logging singleton: + +```ruby +OneLogin::RubySaml::Logging.logger = Logger.new('/var/log/ruby-saml.log') +``` + +## The Initialization Phase + +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 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): + +```ruby +def init + request = OneLogin::RubySaml::Authrequest.new + redirect_to(request.create(saml_settings)) +end +``` + +If the SP knows who should be authenticated in the IdP, then can provide that info as follows: + +```ruby +def init + request = OneLogin::RubySaml::Authrequest.new + saml_settings.name_identifier_value_requested = "testuser@example.com" + saml_settings.name_identifier_format = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" + redirect_to(request.create(saml_settings)) +end +``` + +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 can look something like this (the `authorize_success` and `authorize_failure` +methods are specific to your application): + +```ruby +def consume + response = OneLogin::RubySaml::Response.new(params[:SAMLResponse], :settings => saml_settings) + + # We validate the SAML Response and check if the user already exists in the system + if response.is_valid? + # authorize_success, log the user + session[:userid] = response.nameid + session[:attributes] = response.attributes + else + authorize_failure # This method shows an error message + # List of errors is available in response.errors array + end +end +``` + +In the above there are a few assumptions, one being that `response.nameid` 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: + +``` +response = OneLogin::RubySaml::Response.new(params[:SAMLResponse]) +response.settings = saml_settings +``` + +If the assertion of the SAMLResponse is not encrypted, you can initialize the Response +without the `:settings` parameter and set it later. If the SAMLResponse contains an encrypted +assertion, you need to provide the settings in the initialize method in order to obtain the +decrypted assertion, using the service provider private key in order to decrypt. +If you don't know what expect, always use the former (set the settings on initialize). + +```ruby +def saml_settings + settings = OneLogin::RubySaml::Settings.new + + settings.assertion_consumer_service_url = "http://#{request.host}/saml/consume" + settings.sp_entity_id = "http://#{request.host}/saml/metadata" + settings.idp_entity_id = "https://app.onelogin.com/saml/metadata/#{OneLoginAppId}" + settings.idp_sso_service_url = "https://app.onelogin.com/trust/saml2/http-post/sso/#{OneLoginAppId}" + settings.idp_sso_service_binding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" # or :post, :redirect + settings.idp_slo_service_url = "https://app.onelogin.com/trust/saml2/http-redirect/slo/#{OneLoginAppId}" + settings.idp_slo_service_binding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" # or :post, :redirect + settings.idp_cert_fingerprint = OneLoginAppCertFingerPrint + settings.idp_cert_fingerprint_algorithm = "http://www.w3.org/2000/09/xmldsig#sha1" + settings.name_identifier_format = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" + + # Optional for most SAML IdPs + settings.authn_context = "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport" + # or as an array + settings.authn_context = [ + "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport", + "urn:oasis:names:tc:SAML:2.0:ac:classes:Password" + ] + + # Optional bindings (defaults to Redirect for logout POST for ACS) + settings.single_logout_service_binding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" # or :post, :redirect + settings.assertion_consumer_service_binding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" # or :post, :redirect + + settings +end +``` + +The use of settings.issuer is deprecated in favour of settings.sp_entity_id since version 1.11.0 + +Some assertion validations can be skipped by passing parameters to `OneLogin::RubySaml::Response.new()`. +For example, you can skip the `AuthnStatement`, `Conditions`, `Recipient`, or the `SubjectConfirmation` +validations by initializing the response with different options: + +```ruby +response = OneLogin::RubySaml::Response.new(params[:SAMLResponse], {skip_authnstatement: true}) # skips AuthnStatement +response = OneLogin::RubySaml::Response.new(params[:SAMLResponse], {skip_conditions: true}) # skips conditions +response = OneLogin::RubySaml::Response.new(params[:SAMLResponse], {skip_subject_confirmation: true}) # skips subject confirmation +response = OneLogin::RubySaml::Response.new(params[:SAMLResponse], {skip_recipient_check: true}) # doesn't skip subject confirmation, but skips the recipient check which is a sub check of the subject_confirmation check +response = OneLogin::RubySaml::Response.new(params[:SAMLResponse], {skip_audience: true}) # skips audience check +``` + +All that's left is to wrap everything in a controller and reference it in the initialization and +consumption URLs in OneLogin. A full controller example could look like this: + +```ruby +# This controller expects you to use the URLs /saml/init and /saml/consume in your OneLogin application. +class SamlController < ApplicationController + def init + request = OneLogin::RubySaml::Authrequest.new + redirect_to(request.create(saml_settings)) + end + + def consume + response = OneLogin::RubySaml::Response.new(params[:SAMLResponse]) + response.settings = saml_settings + + # We validate the SAML Response and check if the user already exists in the system + if response.is_valid? + # authorize_success, log the user + session[:userid] = response.nameid + session[:attributes] = response.attributes + else + authorize_failure # This method shows an error message + # List of errors is available in response.errors array + end + end + + private + + def saml_settings + settings = OneLogin::RubySaml::Settings.new + + settings.assertion_consumer_service_url = "http://#{request.host}/saml/consume" + settings.sp_entity_id = "http://#{request.host}/saml/metadata" + settings.idp_sso_service_url = "https://app.onelogin.com/saml/signon/#{OneLoginAppId}" + settings.idp_cert_fingerprint = OneLoginAppCertFingerPrint + settings.name_identifier_format = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" + + # Optional for most SAML IdPs + settings.authn_context = "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport" + + # Optional. Describe according to IdP specification (if supported) which attributes the SP desires to receive in SAMLResponse. + settings.attributes_index = 5 + # Optional. Describe an attribute consuming service for support of additional attributes. + settings.attribute_consuming_service.configure do + service_name "Service" + service_index 5 + add_attribute :name => "Name", :name_format => "Name Format", :friendly_name => "Friendly Name" + end + + settings + end +end +``` + +## Signature Validation + +Ruby SAML allows different ways to validate the signature of the SAMLResponse: +- You can provide the IdP X.509 public certificate at the `idp_cert` setting. +- You can provide the IdP X.509 public certificate in fingerprint format using the + `idp_cert_fingerprint` setting parameter and additionally the `idp_cert_fingerprint_algorithm` parameter. + +When validating the signature of redirect binding, the fingerprint is useless and the certificate +of the IdP is required in order to execute the validation. You can pass the option +`:relax_signature_validation` to `SloLogoutrequest` and `Logoutresponse` if want to avoid signature +validation if no certificate of the IdP is provided. + +In production also we highly recommend to register on the settings the IdP certificate instead +of using the fingerprint method. The fingerprint, is a hash, so at the end is open to a collision +attack that can end on a signature validation bypass. Other SAML toolkits deprecated that mechanism, +we maintain it for compatibility and also to be used on test environment. + +## Handling Multiple IdP Certificates + +If the IdP metadata XML includes multiple certificates, you may specify the `idp_cert_multi` +parameter. When used, the `idp_cert` and `idp_cert_fingerprint` parameters are ignored. +This is useful in the following scenarios: + +* The IdP uses different certificates for signing versus encryption. +* The IdP is undergoing a key rollover and is publishing the old and new certificates in parallel. + +The `idp_cert_multi` must be a `Hash` as follows. The `:signing` and `:encryption` arrays below, +add the IdP X.509 public certificates which were published in the IdP metadata. + +```ruby +{ + :signing => [], + :encryption => [] +} +``` + +## Metadata Based Configuration + +The method above requires a little extra work to manually specify attributes about both the IdP and your SP application. +There's an easier method: use a metadata exchange. Metadata is an XML file that defines the capabilities of both the IdP +and the SP application. It also contains the X.509 public key certificates which add to the trusted relationship. +The IdP administrator can also configure custom settings for an SP based on the metadata. + +Using `IdpMetadataParser#parse_remote`, the IdP metadata will be added to the settings. + +```ruby +def saml_settings + + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + # Returns OneLogin::RubySaml::Settings pre-populated with IdP metadata + settings = idp_metadata_parser.parse_remote("https://example.com/auth/saml2/idp/metadata") + + settings.assertion_consumer_service_url = "http://#{request.host}/saml/consume" + settings.sp_entity_id = "http://#{request.host}/saml/metadata" + settings.name_identifier_format = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" + # Optional for most SAML IdPs + settings.authn_context = "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport" + + settings +end +``` + +The following attributes are set: + * idp_entity_id + * name_identifier_format + * idp_sso_service_url + * idp_slo_service_url + * idp_attribute_names + * idp_cert + * idp_cert_fingerprint + * idp_cert_multi + +### Retrieve one Entity Descriptor when many exist in Metadata + +If the Metadata contains several entities, the relevant Entity +Descriptor can be specified when retrieving the settings from the +IdpMetadataParser by its Entity Id value: + +```ruby + validate_cert = true + settings = idp_metadata_parser.parse_remote( + "https://example.com/auth/saml2/idp/metadata", + validate_cert, + entity_id: "http//example.com/target/entity" + ) +``` + +### Parsing Metadata into an Hash + +The `OneLogin::RubySaml::IdpMetadataParser` also provides the methods `#parse_to_hash` and `#parse_remote_to_hash`. +Those return an Hash instead of a `Settings` object, which may be useful for configuring +[omniauth-saml](https://github.com/omniauth/omniauth-saml), for instance. + +## Retrieving Attributes + +If you are using `saml:AttributeStatement` to transfer data like the username, you can access all the attributes through `response.attributes`. It contains all the `saml:AttributeStatement`s with its 'Name' as an indifferent key and one or more `saml:AttributeValue`s as values. The value returned depends on the value of the +`single_value_compatibility` (when activated, only the first value is returned) + +```ruby +response = OneLogin::RubySaml::Response.new(params[:SAMLResponse]) +response.settings = saml_settings + +response.attributes[:username] +``` + +Imagine this `saml:AttributeStatement` + +```xml + + + demo + + + value1 + value2 + + + role1 + + + role2 + role3 + + + + + + + valuePresent + + + + + usersName + + +``` + +```ruby +pp(response.attributes) # is an OneLogin::RubySaml::Attributes object +# => @attributes= + {"uid"=>["demo"], + "another_value"=>["value1", "value2"], + "role"=>["role1", "role2", "role3"], + "attribute_with_nil_value"=>[nil], + "attribute_with_nils_and_empty_strings"=>["", "valuePresent", nil, nil] + "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname"=>["usersName"]}> + +# Active single_value_compatibility +OneLogin::RubySaml::Attributes.single_value_compatibility = true + +pp(response.attributes[:uid]) +# => "demo" + +pp(response.attributes[:role]) +# => "role1" + +pp(response.attributes.single(:role)) +# => "role1" + +pp(response.attributes.multi(:role)) +# => ["role1", "role2", "role3"] + +pp(response.attributes.fetch(:role)) +# => "role1" + +pp(response.attributes[:attribute_with_nil_value]) +# => nil + +pp(response.attributes[:attribute_with_nils_and_empty_strings]) +# => "" + +pp(response.attributes[:not_exists]) +# => nil + +pp(response.attributes.single(:not_exists)) +# => nil + +pp(response.attributes.multi(:not_exists)) +# => nil + +pp(response.attributes.fetch(/givenname/)) +# => "usersName" + +# Deprecated single_value_compatibility +OneLogin::RubySaml::Attributes.single_value_compatibility = false + +pp(response.attributes[:uid]) +# => ["demo"] + +pp(response.attributes[:role]) +# => ["role1", "role2", "role3"] + +pp(response.attributes.single(:role)) +# => "role1" + +pp(response.attributes.multi(:role)) +# => ["role1", "role2", "role3"] + +pp(response.attributes.fetch(:role)) +# => ["role1", "role2", "role3"] + +pp(response.attributes[:attribute_with_nil_value]) +# => [nil] + +pp(response.attributes[:attribute_with_nils_and_empty_strings]) +# => ["", "valuePresent", nil, nil] + +pp(response.attributes[:not_exists]) +# => nil + +pp(response.attributes.single(:not_exists)) +# => nil + +pp(response.attributes.multi(:not_exists)) +# => nil + +pp(response.attributes.fetch(/givenname/)) +# => ["usersName"] +``` + +The `saml:AuthnContextClassRef` of the AuthNRequest can be provided by `settings.authn_context`; possible values are described at [SAMLAuthnCxt]. The comparison method can be set using `settings.authn_context_comparison` parameter. Possible values include: 'exact', 'better', 'maximum' and 'minimum' (default value is 'exact'). +To add a `saml:AuthnContextDeclRef`, define `settings.authn_context_decl_ref`. + +In a SP-initiated flow, the SP can indicate to the IdP the subject that should be authenticated. This is done by defining the `settings.name_identifier_value_requested` before +building the authrequest object. + +## Service Provider Metadata + +To form a trusted pair relationship with the IdP, the SP (you) need to provide metadata XML +to the IdP for various good reasons. (Caching, certificate lookups, relaying party permissions, etc) + +The class `OneLogin::RubySaml::Metadata` takes care of this by reading the Settings and returning XML. All you have to do is add a controller to return the data, then give this URL to the IdP administrator. + +The metadata will be polled by the IdP every few minutes, so updating your settings should propagate +to the IdP settings. + +```ruby +class SamlController < ApplicationController + # ... the rest of your controller definitions ... + def metadata + settings = Account.get_saml_settings + meta = OneLogin::RubySaml::Metadata.new + render :xml => meta.generate(settings), :content_type => "application/samlmetadata+xml" + end +end +``` + +You can add `ValidUntil` and `CacheDuration` to the SP Metadata XML using instead: + +```ruby + # Valid until => 2 days from now + # Cache duration = 604800s = 1 week + valid_until = Time.now + 172800 + cache_duration = 604800 + meta.generate(settings, false, valid_until, cache_duration) +``` + +## Signing and Decryption + +Ruby SAML supports the following functionality: + +1. Signing your SP Metadata XML +2. Signing your SP SAML messages +3. Decrypting IdP Assertion messages upon receipt (EncryptedAssertion) +4. Verifying signatures on SAML messages and IdP Assertions + +In order to use functions 1-3 above, you must first define your SP public certificate and private key: + +```ruby + settings.certificate = "CERTIFICATE TEXT WITH BEGIN/END HEADER AND FOOTER" + settings.private_key = "PRIVATE KEY TEXT WITH BEGIN/END HEADER AND FOOTER" +``` + +Note that the same certificate (and its associated private key) are used to perform +all decryption and signing-related functions (1-4) above. Ruby SAML does not currently allow +to specify different certificates for each function. + +You may also globally set the SP signature and digest method, to be used in SP signing (functions 1 and 2 above): + +```ruby + settings.security[:digest_method] = XMLSecurity::Document::SHA1 + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 +``` + +#### Signing SP Metadata + +You may add a `` digital signature element to your SP Metadata XML using the following setting: + +```ruby + settings.certificate = "CERTIFICATE TEXT WITH BEGIN/END HEADER AND FOOTER" + settings.private_key = "PRIVATE KEY TEXT WITH BEGIN/END HEADER AND FOOTER" + + settings.security[:metadata_signed] = true # Enable signature on Metadata +``` + +#### Signing SP SAML Messages + +Ruby SAML supports SAML request signing. The Service Provider will sign the +request/responses with its private key. The Identity Provider will then validate the signature +of the received request/responses with the public X.509 cert of the Service Provider. + +To enable, please first set your certificate and private key. This will add `` +to your SP Metadata XML, to be read by the IdP. + +```ruby + settings.certificate = "CERTIFICATE TEXT WITH BEGIN/END HEADER AND FOOTER" + settings.private_key = "PRIVATE KEY TEXT WITH BEGIN/END HEADER AND FOOTER" +``` + +Next, you may specify the specific SP SAML messages you would like to sign: + +```ruby + settings.security[:authn_requests_signed] = true # Enable signature on AuthNRequest + settings.security[:logout_requests_signed] = true # Enable signature on Logout Request + settings.security[:logout_responses_signed] = true # Enable signature on Logout Response +``` + +Signatures will be handled automatically for both `HTTP-Redirect` and `HTTP-Redirect` Binding. +Note that the RelayState parameter is used when creating the Signature on the `HTTP-Redirect` Binding. +Remember to provide it to the Signature builder if you are sending a `GET RelayState` parameter or the +signature validation process will fail at the Identity Provider. + +#### Decrypting IdP SAML Assertions + +Ruby SAML supports EncryptedAssertion. The Identity Provider will encrypt the Assertion with the +public cert of the Service Provider. The Service Provider will decrypt the EncryptedAssertion with its private key. + +You may enable EncryptedAssertion as follows. This will add `` to your +SP Metadata XML, to be read by the IdP. + +```ruby + settings.certificate = "CERTIFICATE TEXT WITH BEGIN/END HEADER AND FOOTER" + settings.private_key = "PRIVATE KEY TEXT WITH BEGIN/END HEADER AND FOOTER" + + settings.security[:want_assertions_encrypted] = true # Invalidate SAML messages without an EncryptedAssertion +``` + +#### Verifying Signature on IdP Assertions + +You may require the IdP to sign its SAML Assertions using the following setting. +With will add `` to your SP Metadata XML. +The signature will be checked against the `` element +present in the IdP's metadata. + +```ruby + settings.security[:want_assertions_signed] = true # Require the IdP to sign its SAML Assertions +``` + +#### Certificate and Signature Validation + +You may require SP and IdP certificates to be non-expired using the following settings: + +```ruby + settings.security[:check_idp_cert_expiration] = true # Raise error if IdP X.509 cert is expired + settings.security[:check_sp_cert_expiration] = true # Raise error SP X.509 cert is expired +``` + +By default, Ruby SAML will raise a `OneLogin::RubySaml::ValidationError` if a signature or certificate +validation fails. You may disable such exceptions using the `settings.security[:soft]` parameter. + +```ruby + settings.security[:soft] = true # Do not raise error on failed signature/certificate validations +``` + +#### Audience Validation + +A service provider should only consider a SAML response valid if the IdP includes an +element containting an element that uniquely identifies the service provider. Unless you specify +the `skip_audience` option, Ruby SAML will validate that each SAML response includes an element +whose contents matches `settings.sp_entity_id`. + +By default, Ruby SAML considers an element containing only empty elements +to be valid. That means an otherwise valid SAML response with a condition like this would be valid: + +```xml + + + +``` + +You may enforce that an element containing only empty elements +is invalid using the `settings.security[:strict_audience_validation]` parameter. + +```ruby +settings.security[:strict_audience_validation] = true +``` + +#### Key Rollover + +To update the SP X.509 certificate and private key without disruption of service, you may define the parameter +`settings.certificate_new`. This will publish the new SP certificate in your metadata so that your IdP counterparties +may cache it in preparation for rollover. + +For example, if you to rollover from `CERT A` to `CERT B`. Before rollover, your settings should look as follows. +Both `CERT A` and `CERT B` will now appear in your SP metadata, however `CERT A` will still be used for signing +and encryption at this time. + +```ruby + settings.certificate = "CERT A" + settings.private_key = "PRIVATE KEY FOR CERT A" + settings.certificate_new = "CERT B" +``` + +After the IdP has cached `CERT B`, you may then change your settings as follows: + +```ruby + settings.certificate = "CERT B" + settings.private_key = "PRIVATE KEY FOR CERT B" +``` + +## Single Log Out + +Ruby SAML supports SP-initiated Single Logout and IdP-Initiated Single Logout. + +Here is an example that we could add to our previous controller to generate and send a SAML Logout Request to the IdP: + +```ruby +# Create a SP initiated SLO +def sp_logout_request + # LogoutRequest accepts plain browser requests w/o paramters + settings = saml_settings + + if settings.idp_slo_service_url.nil? + logger.info "SLO IdP Endpoint not found in settings, executing then a normal logout'" + delete_session + else + + logout_request = OneLogin::RubySaml::Logoutrequest.new + logger.info "New SP SLO for userid '#{session[:userid]}' transactionid '#{logout_request.uuid}'" + + if settings.name_identifier_value.nil? + settings.name_identifier_value = session[:userid] + end + + # Ensure user is logged out before redirect to IdP, in case anything goes wrong during single logout process (as recommended by saml2int [SDP-SP34]) + logged_user = session[:userid] + logger.info "Delete session for '#{session[:userid]}'" + delete_session + + # Save the transaction_id to compare it with the response we get back + session[:transaction_id] = logout_request.uuid + session[:logged_out_user] = logged_user + + relayState = url_for(controller: 'saml', action: 'index') + redirect_to(logout_request.create(settings, :RelayState => relayState)) + end +end +``` + +This method processes the SAML Logout Response sent by the IdP as the reply of the SAML Logout Request: + +```ruby +# After sending an SP initiated LogoutRequest to the IdP, we need to accept +# the LogoutResponse, verify it, then actually delete our session. +def process_logout_response + settings = Account.get_saml_settings + + if session.has_key? :transaction_id + logout_response = OneLogin::RubySaml::Logoutresponse.new(params[:SAMLResponse], settings, :matches_request_id => session[:transaction_id]) + else + logout_response = OneLogin::RubySaml::Logoutresponse.new(params[:SAMLResponse], settings) + end + + logger.info "LogoutResponse is: #{logout_response.to_s}" + + # Validate the SAML Logout Response + if not logout_response.validate + logger.error "The SAML Logout Response is invalid" + else + # Actually log out this session + logger.info "SLO completed for '#{session[:logged_out_user]}'" + delete_session + end +end + +# Delete a user's session. +def delete_session + session[:userid] = nil + session[:attributes] = nil + session[:transaction_id] = nil + session[:logged_out_user] = nil +end +``` + +Here is an example that we could add to our previous controller to process a SAML Logout Request from the IdP and reply with a SAML Logout Response to the IdP: + +```ruby +# Method to handle IdP initiated logouts +def idp_logout_request + settings = Account.get_saml_settings + # ADFS URL-Encodes SAML data as lowercase, and the toolkit by default uses + # uppercase. Turn it True for ADFS compatibility on signature verification + settings.security[:lowercase_url_encoding] = true + + logout_request = OneLogin::RubySaml::SloLogoutrequest.new( + params[:SAMLRequest], settings: settings + ) + if !logout_request.is_valid? + logger.error "IdP initiated LogoutRequest was not valid!" + return render :inline => logger.error + end + logger.info "IdP initiated Logout for #{logout_request.name_id}" + + # Actually log out this session + delete_session + + # Generate a response to the IdP. + logout_request_id = logout_request.id + logout_response = OneLogin::RubySaml::SloLogoutresponse.new.create(settings, logout_request_id, nil, :RelayState => params[:RelayState]) + redirect_to logout_response +end +``` + +All the mentioned methods could be handled in a unique view: + +```ruby +# Trigger SP and IdP initiated Logout requests +def logout + # If we're given a logout request, handle it in the IdP logout initiated method + if params[:SAMLRequest] + return idp_logout_request + # We've been given a response back from the IdP, process it + elsif params[:SAMLResponse] + return process_logout_response + # Initiate SLO (send Logout Request) + else + return sp_logout_request + end +end +``` + +## Clock Drift + +Server clocks tend to drift naturally. If during validation of the response you get the error "Current time is earlier than NotBefore condition", this may be due to clock differences between your system and that of the Identity Provider. + +First, ensure that both systems synchronize their clocks, using for example the industry standard [Network Time Protocol (NTP)](http://en.wikipedia.org/wiki/Network_Time_Protocol). + +Even then you may experience intermittent issues, as the clock of the Identity Provider may drift slightly ahead of your system clocks. To allow for a small amount of clock drift, you can initialize the response by passing in an option named `:allowed_clock_drift`. Its value must be given in a number (and/or fraction) of seconds. The value given is added to the current time at which the response is validated before it's tested against the `NotBefore` assertion. For example: + +```ruby +response = OneLogin::RubySaml::Response.new(params[:SAMLResponse], :allowed_clock_drift => 1.second) +``` + +Make sure to keep the value as comfortably small as possible to keep security risks to a minimum. + +## Deflation Limit + +To protect against decompression bombs (a form of DoS attack), SAML messages are limited to 250,000 bytes by default. +Sometimes legitimate SAML messages will exceed this limit, +for example due to custom claims like including groups a user is a member of. +If you want to customize this limit, you need to provide a different setting when initializing the response object. +Example: + +```ruby +def consume + response = OneLogin::RubySaml::Response.new(params[:SAMLResponse], { settings: saml_settings }) + ... +end + +private + +def saml_settings + OneLogin::RubySaml::Settings.new(message_max_bytesize: 500_000) +end +``` + +## Attribute Service + +To request attributes from the IdP the SP needs to provide an attribute service within it's metadata and reference the index in the assertion. + +```ruby +settings = OneLogin::RubySaml::Settings.new +settings.attributes_index = 5 +settings.attribute_consuming_service.configure do + service_name "Service" + service_index 5 + add_attribute :name => "Name", :name_format => "Name Format", :friendly_name => "Friendly Name" + add_attribute :name => "Another Attribute", :name_format => "Name Format", :friendly_name => "Friendly Name", :attribute_value => "Attribute Value" +end +``` + +The `attribute_value` option additionally accepts an array of possible values. + +## Custom Metadata Fields + +Some IdPs may require to add SPs to add additional fields (Organization, ContactPerson, etc.) +into the SP metadata. This can be achieved by extending the `OneLogin::RubySaml::Metadata` +class and overriding the `#add_extras` method as per the following example: + +```ruby +class MyMetadata < OneLogin::RubySaml::Metadata + def add_extras(root, _settings) + org = root.add_element("md:Organization") + org.add_element("md:OrganizationName", 'xml:lang' => "en-US").text = 'ACME Inc.' + org.add_element("md:OrganizationDisplayName", 'xml:lang' => "en-US").text = 'ACME' + org.add_element("md:OrganizationURL", 'xml:lang' => "en-US").text = 'https://www.acme.com' + + cp = root.add_element("md:ContactPerson", 'contactType' => 'technical') + cp.add_element("md:GivenName").text = 'ACME SAML Team' + cp.add_element("md:EmailAddress").text = 'saml@acme.com' + end +end + +# Output XML with custom metadata +MyMetadata.new.generate(settings) +``` diff --git a/ruby-saml-custom/Rakefile b/ruby-saml-custom/Rakefile new file mode 100644 index 0000000..40fa256 --- /dev/null +++ b/ruby-saml-custom/Rakefile @@ -0,0 +1,27 @@ +require 'rubygems' +require 'rake' + +#not being used yet. +require 'rake/testtask' +Rake::TestTask.new(:test) do |test| + test.libs << 'lib' << 'test' + test.pattern = 'test/**/*_test.rb' + test.verbose = true +end + +begin + require 'rcov/rcovtask' + Rcov::RcovTask.new do |test| + test.libs << 'test' + test.pattern = 'test/**/*_test.rb' + test.verbose = true + end +rescue LoadError + task :rcov do + abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov" + end +end + +task :test + +task :default => :test diff --git a/ruby-saml-custom/UPGRADING.md b/ruby-saml-custom/UPGRADING.md new file mode 100644 index 0000000..fab9397 --- /dev/null +++ b/ruby-saml-custom/UPGRADING.md @@ -0,0 +1,149 @@ +# Ruby SAML Migration Guide + +## Updating from 1.12.x to 1.13.0 + +Version `1.13.0` adds `settings.idp_sso_service_binding` and `settings.idp_slo_service_binding`, and +deprecates `settings.security[:embed_sign]`. If specified, new binding parameters will be used in place of `:embed_sign` +to determine how to handle SAML message signing (`HTTP-POST` embeds signature and `HTTP-Redirect` does not.) + +In addition, the `IdpMetadataParser#parse`, `#parse_to_hash` and `#parse_to_array` methods now retrieve +`idp_sso_service_binding` and `idp_slo_service_binding`. + +Lastly, for convenience you may now use the Symbol aliases `:post` and `:redirect` for any `settings.*_binding` parameter. + +## Upgrading from 1.11.x to 1.12.0 + +Version `1.12.0` adds support for gcm algorithm and +change/adds specific error messages for signature validations + +`idp_sso_target_url` and `idp_slo_target_url` attributes of the Settings class deprecated +in favor of `idp_sso_service_url` and `idp_slo_service_url`. The `IdpMetadataParser#parse`, +`#parse_to_hash` and `#parse_to_array` methods now retrieve SSO URL and SLO URL endpoints with +`idp_sso_service_url` and `idp_slo_service_url` (previously `idp_sso_target_url` and +`idp_slo_target_url` respectively). + +## Upgrading from 1.10.x to 1.11.0 + +Version `1.11.0` deprecates the use of `settings.issuer` in favour of `settings.sp_entity_id`. +There are two new security settings: `settings.security[:check_idp_cert_expiration]` and +`settings.security[:check_sp_cert_expiration]` (both false by default) that check if the +IdP or SP X.509 certificate has expired, respectively. + +Version `1.10.2` includes the `valid_until` attribute in parsed IdP metadata. + +Version `1.10.1` improves Ruby 1.8.7 support. + +## Upgrading from 1.9.0 to 1.10.0 + +Version `1.10.0` improves IdpMetadataParser to allow parse multiple IDPSSODescriptor, +Add Subject support on AuthNRequest to allow SPs provide info to the IdP about the user +to be authenticated and updates the format_cert method to accept certs with /\x0d/ + +## Upgrading from 1.8.0 to 1.9.0 + +Version `1.9.0` better supports Ruby 2.4+ and JRuby 9.2.0.0. `Settings` initialization +now has a second parameter, `keep_security_settings` (default: false), which saves security +settings attributes that are not explicitly overridden, if set to true. + +## Upgrading from 1.7.x to 1.8.0 + +On Version `1.8.0`, creating AuthRequests/LogoutRequests/LogoutResponses with nil RelayState +param will not generate a URL with an empty RelayState parameter anymore. It also changes +the invalid audience error message. + +## Upgrading from 1.6.0 to 1.7.0 + +Version `1.7.0` is a recommended update for all Ruby SAML users as it includes a fix for +the [CVE-2017-11428](https://www.cvedetails.com/cve/CVE-2017-11428/) vulnerability. + +## Upgrading from 1.5.0 to 1.6.0 + +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. + +The new preferred way to provide _SAMLResponse_, _RelayState_, and _SigAlg_ is via the +`options[:raw_get_params]` parameter. For example: + +```ruby +# In this example `query_params` is assumed to contain decoded query parameters, +# and `raw_query_params` is assumed to contain encoded query parameters as sent by the IDP. +settings = { + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + settings.soft = false +} +options = { + get_params: { + "Signature" => query_params["Signature"], + }, + raw_get_params: { + "SAMLRequest" => raw_query_params["SAMLRequest"], + "SigAlg" => raw_query_params["SigAlg"], + "RelayState" => raw_query_params["RelayState"], + }, +} +slo_logout_request = OneLogin::RubySaml::SloLogoutrequest.new(query_params["SAMLRequest"], settings, options) +raise "Invalid Logout Request" unless slo_logout_request.is_valid? +``` + +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. + +## Upgrading from 1.4.2 to 1.4.3 + +Version `1.4.3` introduces Recipient validation of SubjectConfirmation elements. +The 'Recipient' value is compared with the settings.assertion_consumer_service_url +value. + +If you want to skip that validation, add the :skip_recipient_check option to the +initialize method of the Response object. + +Parsing metadata that contains more than one certificate will propagate the +idp_cert_multi property rather than idp_cert. See [signature validation +section](#signature-validation) for details. + +## Upgrading from 1.3.x to 1.4.x + +Version `1.4.0` is a recommended update for all Ruby SAML users as it includes security improvements. + +## Upgrading from 1.2.x to 1.3.x + +Version `1.3.0` is a recommended update for all Ruby SAML users as it includes security fixes. +It adds security improvements in order to prevent Signature wrapping attacks. +[CVE-2016-5697](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5697) + +## Upgrading from 1.1.x to 1.2.x + +Version `1.2` adds IDP metadata parsing improvements, uuid deprecation in favour of SecureRandom, +refactor error handling and some minor improvements. + +There is no compatibility issue detected. + +For more details, please review [CHANGELOG.md](CHANGELOG.md). + +## Upgrading from 1.0.x to 1.1.x + +Version `1.1` adds some improvements on signature validation and solves some namespace conflicts. + +## Upgrading from 0.9.x to 1.0.x + +Version `1.0` is a recommended update for all Ruby SAML users as it includes security fixes. + +Version `1.0` adds security improvements like entity expansion limitation, more SAML message validations, and other important improvements like decrypt support. + +### Important Changes + +Please note the `get_idp_metadata` method raises an exception when it is not able to fetch the idp metadata, so review your integration if you are using this functionality. + +## Upgrading from 0.8.x to 0.9.x + +Version `0.9` adds many new features and improvements. + +## Upgrading from 0.7.x to 0.8.x + +Version `0.8.x` changes the namespace of the gem from `OneLogin::Saml` to `OneLogin::RubySaml`. Please update your implementations of the gem accordingly. diff --git a/ruby-saml-custom/gemfiles/nokogiri-1.5.gemfile b/ruby-saml-custom/gemfiles/nokogiri-1.5.gemfile new file mode 100644 index 0000000..9808b56 --- /dev/null +++ b/ruby-saml-custom/gemfiles/nokogiri-1.5.gemfile @@ -0,0 +1,5 @@ +source 'https://rubygems.org' + +gem "nokogiri", "~> 1.5.10" + +gemspec :path => "../" diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml.rb b/ruby-saml-custom/lib/onelogin/ruby-saml.rb new file mode 100644 index 0000000..61b79b6 --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml.rb @@ -0,0 +1,17 @@ +require 'onelogin/ruby-saml/logging' +require 'onelogin/ruby-saml/saml_message' +require 'onelogin/ruby-saml/authrequest' +require 'onelogin/ruby-saml/logoutrequest' +require 'onelogin/ruby-saml/logoutresponse' +require 'onelogin/ruby-saml/attributes' +require 'onelogin/ruby-saml/slo_logoutrequest' +require 'onelogin/ruby-saml/slo_logoutresponse' +require 'onelogin/ruby-saml/response' +require 'onelogin/ruby-saml/settings' +require 'onelogin/ruby-saml/attribute_service' +require 'onelogin/ruby-saml/http_error' +require 'onelogin/ruby-saml/validation_error' +require 'onelogin/ruby-saml/metadata' +require 'onelogin/ruby-saml/idp_metadata_parser' +require 'onelogin/ruby-saml/utils' +require 'onelogin/ruby-saml/version' diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/attribute_service.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/attribute_service.rb new file mode 100644 index 0000000..1571e7f --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/attribute_service.rb @@ -0,0 +1,57 @@ +module OneLogin + module RubySaml + + # SAML2 AttributeService. Auxiliary class to build the AttributeService of the SP Metadata + # + class AttributeService + attr_reader :attributes + attr_reader :name + attr_reader :index + + # Initializes the AttributeService, set the index value as 1 and an empty array as attributes + # + def initialize + @index = "1" + @attributes = [] + end + + def configure(&block) + instance_eval(&block) + end + + # @return [Boolean] True if the AttributeService object has been initialized and set with the required values + # (has attributes and a name) + def configured? + @attributes.length > 0 && !@name.nil? + end + + # Set a name to the service + # @param name [String] The service name + # + def service_name(name) + @name = name + end + + # Set an index to the service + # @param index [Integer] An index + # + def service_index(index) + @index = index + end + + # Add an AttributeService + # @param options [Hash] AttributeService option values + # add_attribute( + # :name => "Name", + # :name_format => "Name Format", + # :index => 1, + # :friendly_name => "Friendly Name", + # :attribute_value => "Attribute Value" + # ) + # + def add_attribute(options={}) + attributes << options + end + end + end +end diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/attributes.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/attributes.rb new file mode 100644 index 0000000..cb4ad96 --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/attributes.rb @@ -0,0 +1,151 @@ +module OneLogin + module RubySaml + + # SAML2 Attributes. Parse the Attributes from the AttributeStatement of the SAML Response. + # + class Attributes + include Enumerable + + attr_reader :attributes + + # By default Attributes#[] is backwards compatible and + # returns only the first value for the attribute + # Setting this to `false` returns all values for an attribute + @@single_value_compatibility = true + + # @return [Boolean] Get current status of backwards compatibility mode. + # + def self.single_value_compatibility + @@single_value_compatibility + end + + # Sets the backwards compatibility mode on/off. + # @param value [Boolean] + # + def self.single_value_compatibility=(value) + @@single_value_compatibility = value + end + + # @param attrs [Hash] The +attrs+ must be a Hash with attribute names as keys and **arrays** as values: + # Attributes.new({ + # 'name' => ['value1', 'value2'], + # 'mail' => ['value1'], + # }) + # + def initialize(attrs = {}) + @attributes = attrs + end + + + # Iterate over all attributes + # + def each + attributes.each{|name, values| yield name, values} + end + + + # Test attribute presence by name + # @param name [String] The attribute name to be checked + # + def include?(name) + attributes.has_key?(canonize_name(name)) + end + + # Return first value for an attribute + # @param name [String] The attribute name + # @return [String] The value (First occurrence) + # + def single(name) + attributes[canonize_name(name)].first if include?(name) + end + + # Return all values for an attribute + # @param name [String] The attribute name + # @return [Array] Values of the attribute + # + def multi(name) + attributes[canonize_name(name)] + end + + # Retrieve attribute value(s) + # @param name [String] The attribute name + # @return [String|Array] Depending on the single value compatibility status this returns: + # - First value if single_value_compatibility = true + # response.attributes['mail'] # => 'user@example.com' + # - All values if single_value_compatibility = false + # response.attributes['mail'] # => ['user@example.com','user@example.net'] + # + def [](name) + self.class.single_value_compatibility ? single(canonize_name(name)) : multi(canonize_name(name)) + end + + # @return [Hash] Return all attributes as a hash + # + def all + attributes + end + + # @param name [String] The attribute name + # @param values [Array] The values + # + def set(name, values) + attributes[canonize_name(name)] = values + end + alias_method :[]=, :set + + # @param name [String] The attribute name + # @param values [Array] The values + # + def add(name, values = []) + attributes[canonize_name(name)] ||= [] + attributes[canonize_name(name)] += Array(values) + end + + # Make comparable to another Attributes collection based on attributes + # @param other [Attributes] An Attributes object to compare with + # @return [Boolean] True if are contains the same attributes and values + # + def ==(other) + if other.is_a?(Attributes) + all == other.all + else + super + end + end + + # Fetch attribute value using name or regex + # @param name [String|Regexp] The attribute name + # @return [String|Array] Depending on the single value compatibility status this returns: + # - First value if single_value_compatibility = true + # response.attributes['mail'] # => 'user@example.com' + # - All values if single_value_compatibility = false + # response.attributes['mail'] # => ['user@example.com','user@example.net'] + # + def fetch(name) + attributes.each_key do |attribute_key| + if name.is_a?(Regexp) + if name.respond_to? :match? + return self[attribute_key] if name.match?(attribute_key) + else + return self[attribute_key] if name.match(attribute_key) + end + elsif canonize_name(name) == canonize_name(attribute_key) + return self[attribute_key] + end + end + nil + end + + protected + + # stringifies all names so both 'email' and :email return the same result + # @param name [String] The attribute name + # @return [String] stringified name + # + def canonize_name(name) + name.to_s + end + + end + end +end diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/authrequest.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/authrequest.rb new file mode 100644 index 0000000..5e2c7c3 --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/authrequest.rb @@ -0,0 +1,193 @@ +require "rexml/document" + +require "onelogin/ruby-saml/logging" +require "onelogin/ruby-saml/saml_message" +require "onelogin/ruby-saml/utils" +require "onelogin/ruby-saml/setting_error" + +# Only supports SAML 2.0 +module OneLogin + module RubySaml + include REXML + + # SAML2 Authentication. AuthNRequest (SSO SP initiated, Builder) + # + class Authrequest < SamlMessage + + # AuthNRequest ID + attr_accessor :uuid + + # Initializes the AuthNRequest. An Authrequest Object that is an extension of the SamlMessage class. + # Asigns an ID, a random uuid. + # + def initialize + @uuid = OneLogin::RubySaml::Utils.uuid + end + + def request_id + @uuid + end + + # Creates the AuthNRequest string. + # @param settings [OneLogin::RubySaml::Settings|nil] Toolkit settings + # @param params [Hash] Some extra parameters to be added in the GET for example the RelayState + # @return [String] AuthNRequest string that includes the SAMLRequest + # + def create(settings, params = {}) + params = create_params(settings, params) + params_prefix = (settings.idp_sso_service_url =~ /\?/) ? '&' : '?' + saml_request = CGI.escape(params.delete("SAMLRequest")) + request_params = "#{params_prefix}SAMLRequest=#{saml_request}" + params.each_pair do |key, value| + request_params << "&#{key.to_s}=#{CGI.escape(value.to_s)}" + end + raise SettingError.new "Invalid settings, idp_sso_service_url is not set!" if settings.idp_sso_service_url.nil? or settings.idp_sso_service_url.empty? + @login_url = settings.idp_sso_service_url + request_params + end + + # Creates the Get parameters for the request. + # @param settings [OneLogin::RubySaml::Settings|nil] Toolkit settings + # @param params [Hash] Some extra parameters to be added in the GET for example the RelayState + # @return [Hash] Parameters + # + def create_params(settings, params={}) + # The method expects :RelayState but sometimes we get 'RelayState' instead. + # Based on the HashWithIndifferentAccess value in Rails we could experience + # conflicts so this line will solve them. + relay_state = params[:RelayState] || params['RelayState'] + + if relay_state.nil? + params.delete(:RelayState) + params.delete('RelayState') + end + + request_doc = create_authentication_xml_doc(settings) + request_doc.context[:attribute_quote] = :quote if settings.double_quote_xml_attribute_values + + request = "" + request_doc.write(request) + + Logging.debug "Created AuthnRequest: #{request}" + + request = deflate(request) if settings.compress_request + base64_request = encode(request) + request_params = {"SAMLRequest" => base64_request} + + if settings.idp_sso_service_binding == Utils::BINDINGS[:redirect] && settings.security[:authn_requests_signed] && settings.private_key + params['SigAlg'] = settings.security[:signature_method] + url_string = OneLogin::RubySaml::Utils.build_query( + :type => 'SAMLRequest', + :data => base64_request, + :relay_state => relay_state, + :sig_alg => params['SigAlg'] + ) + sign_algorithm = XMLSecurity::BaseDocument.new.algorithm(settings.security[:signature_method]) + signature = settings.get_sp_key.sign(sign_algorithm.new, url_string) + params['Signature'] = encode(signature) + end + + params.each_pair do |key, value| + request_params[key] = value.to_s + end + + request_params + end + + # Creates the SAMLRequest String. + # @param settings [OneLogin::RubySaml::Settings|nil] Toolkit settings + # @return [String] The SAMLRequest String. + # + def create_authentication_xml_doc(settings) + document = create_xml_document(settings) + sign_document(document, settings) + end + + def create_xml_document(settings) + time = Time.now.utc.strftime("%Y-%m-%dT%H:%M:%SZ") + + request_doc = XMLSecurity::Document.new + request_doc.uuid = uuid + + root = request_doc.add_element "samlp:AuthnRequest", { "xmlns:samlp" => "urn:oasis:names:tc:SAML:2.0:protocol", "xmlns:saml" => "urn:oasis:names:tc:SAML:2.0:assertion" } + root.attributes['ID'] = uuid + root.attributes['IssueInstant'] = time + root.attributes['Version'] = "2.0" + root.attributes['Destination'] = settings.idp_sso_service_url unless settings.idp_sso_service_url.nil? or settings.idp_sso_service_url.empty? + root.attributes['IsPassive'] = settings.passive unless settings.passive.nil? + root.attributes['ProtocolBinding'] = settings.protocol_binding unless settings.protocol_binding.nil? + root.attributes["AttributeConsumingServiceIndex"] = settings.attributes_index unless settings.attributes_index.nil? + root.attributes['ForceAuthn'] = settings.force_authn unless settings.force_authn.nil? + + # Conditionally defined elements based on settings + if settings.assertion_consumer_service_url != nil + root.attributes["AssertionConsumerServiceURL"] = settings.assertion_consumer_service_url + end + if settings.sp_entity_id != nil + issuer = root.add_element "saml:Issuer" + issuer.text = settings.sp_entity_id + end + + if settings.name_identifier_value_requested != nil + subject = root.add_element "saml:Subject" + + nameid = subject.add_element "saml:NameID" + nameid.attributes['Format'] = settings.name_identifier_format if settings.name_identifier_format + nameid.text = settings.name_identifier_value_requested + + subject_confirmation = subject.add_element "saml:SubjectConfirmation" + subject_confirmation.attributes['Method'] = "urn:oasis:names:tc:SAML:2.0:cm:bearer" + end + + if settings.name_identifier_format != nil + root.add_element "samlp:NameIDPolicy", { + # Might want to make AllowCreate a setting? + "AllowCreate" => "true", + "Format" => settings.name_identifier_format + } + end + + if settings.authn_context || settings.authn_context_decl_ref + + if settings.authn_context_comparison != nil + comparison = settings.authn_context_comparison + else + comparison = 'exact' + end + + requested_context = root.add_element "samlp:RequestedAuthnContext", { + "Comparison" => comparison, + } + + if settings.authn_context != nil + authn_contexts_class_ref = settings.authn_context.is_a?(Array) ? settings.authn_context : [settings.authn_context] + authn_contexts_class_ref.each do |authn_context_class_ref| + class_ref = requested_context.add_element "saml:AuthnContextClassRef" + class_ref.text = authn_context_class_ref + end + end + + if settings.authn_context_decl_ref != nil + authn_contexts_decl_refs = settings.authn_context_decl_ref.is_a?(Array) ? settings.authn_context_decl_ref : [settings.authn_context_decl_ref] + authn_contexts_decl_refs.each do |authn_context_decl_ref| + decl_ref = requested_context.add_element "saml:AuthnContextDeclRef" + decl_ref.text = authn_context_decl_ref + end + end + end + + request_doc + end + + def sign_document(document, settings) + if settings.idp_sso_service_binding == Utils::BINDINGS[:post] && settings.security[:authn_requests_signed] && settings.private_key && settings.certificate + private_key = settings.get_sp_key + cert = settings.get_sp_cert + document.sign_document(private_key, cert, settings.security[:signature_method], settings.security[:digest_method]) + end + + document + end + + end + end +end diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/error_handling.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/error_handling.rb new file mode 100644 index 0000000..02f0c62 --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/error_handling.rb @@ -0,0 +1,27 @@ +require "onelogin/ruby-saml/validation_error" + +module OneLogin + module RubySaml + module ErrorHandling + attr_accessor :errors + + # Append the cause to the errors array, and based on the value of soft, return false or raise + # an exception. soft_override is provided as a means of overriding the object's notion of + # soft for just this invocation. + def append_error(error_msg, soft_override = nil) + @errors << error_msg + + unless soft_override.nil? ? soft : soft_override + raise ValidationError.new(error_msg) + end + + false + end + + # Reset the errors array + def reset_errors! + @errors = [] + end + end + end +end diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/http_error.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/http_error.rb new file mode 100644 index 0000000..7f77c56 --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/http_error.rb @@ -0,0 +1,7 @@ +module OneLogin + module RubySaml + class HttpError < StandardError + end + end +end + diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/idp_metadata_parser.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/idp_metadata_parser.rb new file mode 100644 index 0000000..d420589 --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/idp_metadata_parser.rb @@ -0,0 +1,473 @@ +require "base64" +require "net/http" +require "net/https" +require "rexml/document" +require "rexml/xpath" + +# Only supports SAML 2.0 +module OneLogin + module RubySaml + include REXML + + # Auxiliary class to retrieve and parse the Identity Provider Metadata + # + # This class does not validate in any way the URL that is introduced, + # make sure to validate it properly before use it in a parse_remote method. + # Read the `Security warning` section of the README.md file to get more info + # + class IdpMetadataParser + + module SamlMetadata + module Vocabulary + METADATA = "urn:oasis:names:tc:SAML:2.0:metadata".freeze + DSIG = "http://www.w3.org/2000/09/xmldsig#".freeze + NAME_FORMAT = "urn:oasis:names:tc:SAML:2.0:attrname-format:*".freeze + SAML_ASSERTION = "urn:oasis:names:tc:SAML:2.0:assertion".freeze + end + + NAMESPACE = { + "md" => Vocabulary::METADATA, + "NameFormat" => Vocabulary::NAME_FORMAT, + "saml" => Vocabulary::SAML_ASSERTION, + "ds" => Vocabulary::DSIG + }.freeze + end + + include SamlMetadata::Vocabulary + attr_reader :document + attr_reader :response + attr_reader :options + + # fetch IdP descriptors from a metadata document + def self.get_idps(metadata_document, only_entity_id=nil) + path = "//md:EntityDescriptor#{only_entity_id && '[@entityID="' + only_entity_id + '"]'}/md:IDPSSODescriptor" + REXML::XPath.match( + metadata_document, + path, + SamlMetadata::NAMESPACE + ) + end + + # Parse the Identity Provider metadata and update the settings with the + # IdP values + # + # @param url [String] Url where the XML of the Identity Provider Metadata is published. + # @param validate_cert [Boolean] If true and the URL is HTTPs, the cert of the domain is checked. + # + # @param options [Hash] options used for parsing the metadata and the returned Settings instance + # @option options [OneLogin::RubySaml::Settings, Hash] :settings the OneLogin::RubySaml::Settings object which gets the parsed metadata merged into or an hash for Settings overrides. + # @option options [String, nil] :entity_id when this is given, the entity descriptor for this ID is used. When omitted, the first entity descriptor is used. + # @option options [String, Array, nil] :sso_binding an ordered list of bindings to detect the single signon URL. The first binding in the list that is included in the metadata will be used. + # @option options [String, Array, nil] :slo_binding an ordered list of bindings to detect the single logout URL. The first binding in the list that is included in the metadata will be used. + # @option options [String, Array, nil] :name_id_format an ordered list of NameIDFormats to detect a desired value. The first NameIDFormat in the list that is included in the metadata will be used. + # + # @return [OneLogin::RubySaml::Settings] + # + # @raise [HttpError] Failure to fetch remote IdP metadata + def parse_remote(url, validate_cert = true, options = {}) + idp_metadata = get_idp_metadata(url, validate_cert) + parse(idp_metadata, options) + end + + # Parse the Identity Provider metadata and return the results as Hash + # + # @param url [String] Url where the XML of the Identity Provider Metadata is published. + # @param validate_cert [Boolean] If true and the URL is HTTPs, the cert of the domain is checked. + # + # @param options [Hash] options used for parsing the metadata + # @option options [String, nil] :entity_id when this is given, the entity descriptor for this ID is used. When omitted, the first entity descriptor is used. + # @option options [String, Array, nil] :sso_binding an ordered list of bindings to detect the single signon URL. The first binding in the list that is included in the metadata will be used. + # @option options [String, Array, nil] :slo_binding an ordered list of bindings to detect the single logout URL. The first binding in the list that is included in the metadata will be used. + # @option options [String, Array, nil] :name_id_format an ordered list of NameIDFormats to detect a desired value. The first NameIDFormat in the list that is included in the metadata will be used. + # + # @return [Hash] + # + # @raise [HttpError] Failure to fetch remote IdP metadata + def parse_remote_to_hash(url, validate_cert = true, options = {}) + parse_remote_to_array(url, validate_cert, options)[0] + end + + # Parse all Identity Provider metadata and return the results as Array + # + # @param url [String] Url where the XML of the Identity Provider Metadata is published. + # @param validate_cert [Boolean] If true and the URL is HTTPs, the cert of the domain is checked. + # + # @param options [Hash] options used for parsing the metadata + # @option options [String, nil] :entity_id when this is given, the entity descriptor for this ID is used. When omitted, all found IdPs are returned. + # @option options [String, Array, nil] :sso_binding an ordered list of bindings to detect the single signon URL. The first binding in the list that is included in the metadata will be used. + # @option options [String, Array, nil] :slo_binding an ordered list of bindings to detect the single logout URL. The first binding in the list that is included in the metadata will be used. + # @option options [String, Array, nil] :name_id_format an ordered list of NameIDFormats to detect a desired value. The first NameIDFormat in the list that is included in the metadata will be used. + # + # @return [Array] + # + # @raise [HttpError] Failure to fetch remote IdP metadata + def parse_remote_to_array(url, validate_cert = true, options = {}) + idp_metadata = get_idp_metadata(url, validate_cert) + parse_to_array(idp_metadata, options) + end + + # Parse the Identity Provider metadata and update the settings with the IdP values + # + # @param idp_metadata [String] + # + # @param options [Hash] :settings to provide the OneLogin::RubySaml::Settings object or an hash for Settings overrides + # @option options [OneLogin::RubySaml::Settings, Hash] :settings the OneLogin::RubySaml::Settings object which gets the parsed metadata merged into or an hash for Settings overrides. + # @option options [String, nil] :entity_id when this is given, the entity descriptor for this ID is used. When omitted, the first entity descriptor is used. + # @option options [String, Array, nil] :sso_binding an ordered list of bindings to detect the single signon URL. The first binding in the list that is included in the metadata will be used. + # @option options [String, Array, nil] :slo_binding an ordered list of bindings to detect the single logout URL. The first binding in the list that is included in the metadata will be used. + # @option options [String, Array, nil] :name_id_format an ordered list of NameIDFormats to detect a desired value. The first NameIDFormat in the list that is included in the metadata will be used. + # + # @return [OneLogin::RubySaml::Settings] + def parse(idp_metadata, options = {}) + parsed_metadata = parse_to_hash(idp_metadata, options) + + unless parsed_metadata[:cache_duration].nil? + cache_valid_until_timestamp = OneLogin::RubySaml::Utils.parse_duration(parsed_metadata[:cache_duration]) + unless cache_valid_until_timestamp.nil? + if parsed_metadata[:valid_until].nil? || cache_valid_until_timestamp < Time.parse(parsed_metadata[:valid_until], Time.now.utc).to_i + parsed_metadata[:valid_until] = Time.at(cache_valid_until_timestamp).utc.strftime("%Y-%m-%dT%H:%M:%SZ") + end + end + end + # Remove the cache_duration because on the settings + # we only gonna suppot valid_until + parsed_metadata.delete(:cache_duration) + + settings = options[:settings] + + if settings.nil? + OneLogin::RubySaml::Settings.new(parsed_metadata) + elsif settings.is_a?(Hash) + OneLogin::RubySaml::Settings.new(settings.merge(parsed_metadata)) + else + merge_parsed_metadata_into(settings, parsed_metadata) + end + end + + # Parse the Identity Provider metadata and return the results as Hash + # + # @param idp_metadata [String] + # + # @param options [Hash] options used for parsing the metadata and the returned Settings instance + # @option options [String, nil] :entity_id when this is given, the entity descriptor for this ID is used. When omitted, the first entity descriptor is used. + # @option options [String, Array, nil] :sso_binding an ordered list of bindings to detect the single signon URL. The first binding in the list that is included in the metadata will be used. + # @option options [String, Array, nil] :slo_binding an ordered list of bindings to detect the single logout URL. The first binding in the list that is included in the metadata will be used. + # @option options [String, Array, nil] :name_id_format an ordered list of NameIDFormats to detect a desired value. The first NameIDFormat in the list that is included in the metadata will be used. + # + # @return [Hash] + def parse_to_hash(idp_metadata, options = {}) + parse_to_array(idp_metadata, options)[0] + end + + # Parse all Identity Provider metadata and return the results as Array + # + # @param idp_metadata [String] + # + # @param options [Hash] options used for parsing the metadata and the returned Settings instance + # @option options [String, nil] :entity_id when this is given, the entity descriptor for this ID is used. When omitted, all found IdPs are returned. + # @option options [String, Array, nil] :sso_binding an ordered list of bindings to detect the single signon URL. The first binding in the list that is included in the metadata will be used. + # @option options [String, Array, nil] :slo_binding an ordered list of bindings to detect the single logout URL. The first binding in the list that is included in the metadata will be used. + # @option options [String, Array, nil] :name_id_format an ordered list of NameIDFormats to detect a desired value. The first NameIDFormat in the list that is included in the metadata will be used. + # + # @return [Array] + def parse_to_array(idp_metadata, options = {}) + parse_to_idp_metadata_array(idp_metadata, options).map { |idp_md| idp_md.to_hash(options) } + end + + def parse_to_idp_metadata_array(idp_metadata, options = {}) + @document = REXML::Document.new(idp_metadata) + @options = options + + idpsso_descriptors = self.class.get_idps(@document, options[:entity_id]) + if !idpsso_descriptors.any? + raise ArgumentError.new("idp_metadata must contain an IDPSSODescriptor element") + end + + idpsso_descriptors.map {|id| IdpMetadata.new(id, id.parent.attributes["entityID"])} + end + + private + + # Retrieve the remote IdP metadata from the URL or a cached copy. + # @param url [String] Url where the XML of the Identity Provider Metadata is published. + # @param validate_cert [Boolean] If true and the URL is HTTPs, the cert of the domain is checked. + # @return [REXML::document] Parsed XML IdP metadata + # @raise [HttpError] Failure to fetch remote IdP metadata + def get_idp_metadata(url, validate_cert) + uri = URI.parse(url) + raise ArgumentError.new("url must begin with http or https") unless /^https?/ =~ uri.scheme + http = Net::HTTP.new(uri.host, uri.port) + + if uri.scheme == "https" + http.use_ssl = true + # Most IdPs will probably use self signed certs + http.verify_mode = validate_cert ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE + + # Net::HTTP in Ruby 1.8 did not set the default certificate store + # automatically when VERIFY_PEER was specified. + if RUBY_VERSION < '1.9' && !http.ca_file && !http.ca_path && !http.cert_store + http.cert_store = OpenSSL::SSL::SSLContext::DEFAULT_CERT_STORE + end + end + + get = Net::HTTP::Get.new(uri.request_uri) + get.basic_auth uri.user, uri.password if uri.user + @response = http.request(get) + return response.body if response.is_a? Net::HTTPSuccess + + raise OneLogin::RubySaml::HttpError.new( + "Failed to fetch idp metadata: #{response.code}: #{response.message}" + ) + end + + class IdpMetadata + attr_reader :idpsso_descriptor, :entity_id + + def initialize(idpsso_descriptor, entity_id) + @idpsso_descriptor = idpsso_descriptor + @entity_id = entity_id + end + + def to_hash(options = {}) + sso_binding = options[:sso_binding] + slo_binding = options[:slo_binding] + { + :idp_entity_id => @entity_id, + :name_identifier_format => idp_name_id_format(options[:name_id_format]), + :idp_sso_service_url => single_signon_service_url(sso_binding), + :idp_sso_service_binding => single_signon_service_binding(sso_binding), + :idp_slo_service_url => single_logout_service_url(slo_binding), + :idp_slo_service_binding => single_logout_service_binding(slo_binding), + :idp_slo_response_service_url => single_logout_response_service_url(slo_binding), + :idp_attribute_names => attribute_names, + :idp_cert => nil, + :idp_cert_fingerprint => nil, + :idp_cert_multi => nil, + :valid_until => valid_until, + :cache_duration => cache_duration, + }.tap do |response_hash| + merge_certificates_into(response_hash) unless certificates.nil? + end + end + + # @return [String|nil] 'validUntil' attribute of metadata + # + def valid_until + root = @idpsso_descriptor.root + root.attributes['validUntil'] if root && root.attributes + end + + # @return [String|nil] 'cacheDuration' attribute of metadata + # + def cache_duration + root = @idpsso_descriptor.root + root.attributes['cacheDuration'] if root && root.attributes + end + + # @param name_id_priority [String|Array] The prioritized list of NameIDFormat values to select. Will select first value if nil. + # @return [String|nil] IdP NameIDFormat value if exists + # + def idp_name_id_format(name_id_priority = nil) + nodes = REXML::XPath.match( + @idpsso_descriptor, + "md:NameIDFormat", + SamlMetadata::NAMESPACE + ) + first_ranked_text(nodes, name_id_priority) + end + + # @param binding_priority [String|Array] The prioritized list of Binding values to select. Will select first value if nil. + # @return [String|nil] SingleSignOnService binding if exists + # + def single_signon_service_binding(binding_priority = nil) + nodes = REXML::XPath.match( + @idpsso_descriptor, + "md:SingleSignOnService/@Binding", + SamlMetadata::NAMESPACE + ) + first_ranked_value(nodes, binding_priority) + end + + # @param binding_priority [String|Array] The prioritized list of Binding values to select. Will select first value if nil. + # @return [String|nil] SingleLogoutService binding if exists + # + def single_logout_service_binding(binding_priority = nil) + nodes = REXML::XPath.match( + @idpsso_descriptor, + "md:SingleLogoutService/@Binding", + SamlMetadata::NAMESPACE + ) + first_ranked_value(nodes, binding_priority) + end + + # @param binding_priority [String|Array] The prioritized list of Binding values to select. Will select first value if nil. + # @return [String|nil] SingleSignOnService endpoint if exists + # + def single_signon_service_url(binding_priority = nil) + binding = single_signon_service_binding(binding_priority) + return if binding.nil? + + node = REXML::XPath.first( + @idpsso_descriptor, + "md:SingleSignOnService[@Binding=\"#{binding}\"]/@Location", + SamlMetadata::NAMESPACE + ) + node.value if node + end + + # @param binding_priority [String|Array] The prioritized list of Binding values to select. Will select first value if nil. + # @return [String|nil] SingleLogoutService endpoint if exists + # + def single_logout_service_url(binding_priority = nil) + binding = single_logout_service_binding(binding_priority) + return if binding.nil? + + node = REXML::XPath.first( + @idpsso_descriptor, + "md:SingleLogoutService[@Binding=\"#{binding}\"]/@Location", + SamlMetadata::NAMESPACE + ) + node.value if node + end + + # @param binding_priority [String|Array] The prioritized list of Binding values to select. Will select first value if nil. + # @return [String|nil] SingleLogoutService response url if exists + # + def single_logout_response_service_url(binding_priority = nil) + binding = single_logout_service_binding(binding_priority) + return if binding.nil? + + node = REXML::XPath.first( + @idpsso_descriptor, + "md:SingleLogoutService[@Binding=\"#{binding}\"]/@ResponseLocation", + SamlMetadata::NAMESPACE + ) + node.value if node + end + + # @return [String|nil] Unformatted Certificate if exists + # + def certificates + @certificates ||= begin + signing_nodes = REXML::XPath.match( + @idpsso_descriptor, + "md:KeyDescriptor[not(contains(@use, 'encryption'))]/ds:KeyInfo/ds:X509Data/ds:X509Certificate", + SamlMetadata::NAMESPACE + ) + + encryption_nodes = REXML::XPath.match( + @idpsso_descriptor, + "md:KeyDescriptor[not(contains(@use, 'signing'))]/ds:KeyInfo/ds:X509Data/ds:X509Certificate", + SamlMetadata::NAMESPACE + ) + + return nil if signing_nodes.empty? && encryption_nodes.empty? + + certs = {} + unless signing_nodes.empty? + certs['signing'] = [] + signing_nodes.each do |cert_node| + certs['signing'] << Utils.element_text(cert_node) + end + end + + unless encryption_nodes.empty? + certs['encryption'] = [] + encryption_nodes.each do |cert_node| + certs['encryption'] << Utils.element_text(cert_node) + end + end + certs + end + end + + # @return [String|nil] the fingerpint of the X509Certificate if it exists + # + def fingerprint(certificate, fingerprint_algorithm = XMLSecurity::Document::SHA1) + @fingerprint ||= begin + return unless certificate + + cert = OpenSSL::X509::Certificate.new(Base64.decode64(certificate)) + + fingerprint_alg = XMLSecurity::BaseDocument.new.algorithm(fingerprint_algorithm).new + fingerprint_alg.hexdigest(cert.to_der).upcase.scan(/../).join(":") + end + end + + # @return [Array] the names of all SAML attributes if any exist + # + def attribute_names + nodes = REXML::XPath.match( + @idpsso_descriptor , + "saml:Attribute/@Name", + SamlMetadata::NAMESPACE + ) + nodes.map(&:value) + end + + def merge_certificates_into(parsed_metadata) + if (certificates.size == 1 && + (certificates_has_one('signing') || certificates_has_one('encryption'))) || + (certificates_has_one('signing') && certificates_has_one('encryption') && + certificates["signing"][0] == certificates["encryption"][0]) + + if certificates.key?("signing") + parsed_metadata[:idp_cert] = certificates["signing"][0] + parsed_metadata[:idp_cert_fingerprint] = fingerprint( + parsed_metadata[:idp_cert], + parsed_metadata[:idp_cert_fingerprint_algorithm] + ) + else + parsed_metadata[:idp_cert] = certificates["encryption"][0] + parsed_metadata[:idp_cert_fingerprint] = fingerprint( + parsed_metadata[:idp_cert], + parsed_metadata[:idp_cert_fingerprint_algorithm] + ) + end + end + + # symbolize keys of certificates and pass it on + parsed_metadata[:idp_cert_multi] = Hash[certificates.map { |k, v| [k.to_sym, v] }] + end + + def certificates_has_one(key) + certificates.key?(key) && certificates[key].size == 1 + end + + private + + def first_ranked_text(nodes, priority = nil) + return unless nodes.any? + + priority = Array(priority) + if priority.any? + values = nodes.map(&:text) + priority.detect { |candidate| values.include?(candidate) } + else + nodes.first.text + end + end + + def first_ranked_value(nodes, priority = nil) + return unless nodes.any? + + priority = Array(priority) + if priority.any? + values = nodes.map(&:value) + priority.detect { |candidate| values.include?(candidate) } + else + nodes.first.value + end + end + end + + def merge_parsed_metadata_into(settings, parsed_metadata) + parsed_metadata.each do |key, value| + settings.send("#{key}=".to_sym, value) + end + + settings + end + end + end +end diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/logging.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/logging.rb new file mode 100644 index 0000000..862fcef --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/logging.rb @@ -0,0 +1,33 @@ +require 'logger' + +# Simplistic log class when we're running in Rails +module OneLogin + module RubySaml + class Logging + DEFAULT_LOGGER = ::Logger.new(STDOUT) + + def self.logger + @logger ||= begin + (defined?(::Rails) && Rails.respond_to?(:logger) && Rails.logger) || + DEFAULT_LOGGER + end + end + + def self.logger=(logger) + @logger = logger + end + + def self.debug(message) + return if !!ENV["ruby-saml/testing"] + + logger.debug message + end + + def self.info(message) + return if !!ENV["ruby-saml/testing"] + + logger.info message + end + end + end +end diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/logoutrequest.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/logoutrequest.rb new file mode 100644 index 0000000..b1ef784 --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/logoutrequest.rb @@ -0,0 +1,151 @@ +require "onelogin/ruby-saml/logging" +require "onelogin/ruby-saml/saml_message" +require "onelogin/ruby-saml/utils" +require "onelogin/ruby-saml/setting_error" + +# Only supports SAML 2.0 +module OneLogin + module RubySaml + + # SAML2 Logout Request (SLO SP initiated, Builder) + # + class Logoutrequest < SamlMessage + + # Logout Request ID + attr_accessor :uuid + + # Initializes the Logout Request. A Logoutrequest Object that is an extension of the SamlMessage class. + # Asigns an ID, a random uuid. + # + def initialize + @uuid = OneLogin::RubySaml::Utils.uuid + end + + def request_id + @uuid + end + + # Creates the Logout Request string. + # @param settings [OneLogin::RubySaml::Settings|nil] Toolkit settings + # @param params [Hash] Some extra parameters to be added in the GET for example the RelayState + # @return [String] Logout Request string that includes the SAMLRequest + # + def create(settings, params={}) + params = create_params(settings, params) + params_prefix = (settings.idp_slo_service_url =~ /\?/) ? '&' : '?' + saml_request = CGI.escape(params.delete("SAMLRequest")) + request_params = "#{params_prefix}SAMLRequest=#{saml_request}" + params.each_pair do |key, value| + request_params << "&#{key.to_s}=#{CGI.escape(value.to_s)}" + end + raise SettingError.new "Invalid settings, idp_slo_service_url is not set!" if settings.idp_slo_service_url.nil? or settings.idp_slo_service_url.empty? + @logout_url = settings.idp_slo_service_url + request_params + end + + # Creates the Get parameters for the logout request. + # @param settings [OneLogin::RubySaml::Settings|nil] Toolkit settings + # @param params [Hash] Some extra parameters to be added in the GET for example the RelayState + # @return [Hash] Parameters + # + def create_params(settings, params={}) + # The method expects :RelayState but sometimes we get 'RelayState' instead. + # Based on the HashWithIndifferentAccess value in Rails we could experience + # conflicts so this line will solve them. + relay_state = params[:RelayState] || params['RelayState'] + + if relay_state.nil? + params.delete(:RelayState) + params.delete('RelayState') + end + + request_doc = create_logout_request_xml_doc(settings) + request_doc.context[:attribute_quote] = :quote if settings.double_quote_xml_attribute_values + + request = "" + request_doc.write(request) + + Logging.debug "Created SLO Logout Request: #{request}" + + request = deflate(request) if settings.compress_request + base64_request = encode(request) + request_params = {"SAMLRequest" => base64_request} + + if settings.idp_slo_service_binding == Utils::BINDINGS[:redirect] && settings.security[:logout_requests_signed] && settings.private_key + params['SigAlg'] = settings.security[:signature_method] + url_string = OneLogin::RubySaml::Utils.build_query( + :type => 'SAMLRequest', + :data => base64_request, + :relay_state => relay_state, + :sig_alg => params['SigAlg'] + ) + sign_algorithm = XMLSecurity::BaseDocument.new.algorithm(settings.security[:signature_method]) + signature = settings.get_sp_key.sign(sign_algorithm.new, url_string) + params['Signature'] = encode(signature) + end + + params.each_pair do |key, value| + request_params[key] = value.to_s + end + + request_params + end + + # Creates the SAMLRequest String. + # @param settings [OneLogin::RubySaml::Settings|nil] Toolkit settings + # @return [String] The SAMLRequest String. + # + def create_logout_request_xml_doc(settings) + document = create_xml_document(settings) + sign_document(document, settings) + end + + def create_xml_document(settings) + time = Time.now.utc.strftime("%Y-%m-%dT%H:%M:%SZ") + + request_doc = XMLSecurity::Document.new + request_doc.uuid = uuid + + root = request_doc.add_element "samlp:LogoutRequest", { "xmlns:samlp" => "urn:oasis:names:tc:SAML:2.0:protocol", "xmlns:saml" => "urn:oasis:names:tc:SAML:2.0:assertion" } + root.attributes['ID'] = uuid + root.attributes['IssueInstant'] = time + root.attributes['Version'] = "2.0" + root.attributes['Destination'] = settings.idp_slo_service_url unless settings.idp_slo_service_url.nil? or settings.idp_slo_service_url.empty? + + if settings.sp_entity_id + issuer = root.add_element "saml:Issuer" + issuer.text = settings.sp_entity_id + end + + nameid = root.add_element "saml:NameID" + if settings.name_identifier_value + nameid.attributes['NameQualifier'] = settings.idp_name_qualifier if settings.idp_name_qualifier + nameid.attributes['SPNameQualifier'] = settings.sp_name_qualifier if settings.sp_name_qualifier + nameid.attributes['Format'] = settings.name_identifier_format if settings.name_identifier_format + nameid.text = settings.name_identifier_value + else + # If no NameID is present in the settings we generate one + nameid.text = OneLogin::RubySaml::Utils.uuid + nameid.attributes['Format'] = 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient' + end + + if settings.sessionindex + sessionindex = root.add_element "samlp:SessionIndex" + sessionindex.text = settings.sessionindex + end + + request_doc + end + + def sign_document(document, settings) + # embed signature + if settings.idp_slo_service_binding == Utils::BINDINGS[:post] && settings.security[:logout_requests_signed] && settings.private_key && settings.certificate + private_key = settings.get_sp_key + cert = settings.get_sp_cert + document.sign_document(private_key, cert, settings.security[:signature_method], settings.security[:digest_method]) + end + + document + end + end + end +end diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/logoutresponse.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/logoutresponse.rb new file mode 100644 index 0000000..51a30c0 --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/logoutresponse.rb @@ -0,0 +1,281 @@ +require "xml_security" +require "onelogin/ruby-saml/saml_message" + +require "time" + +# Only supports SAML 2.0 +module OneLogin + module RubySaml + + # SAML2 Logout Response (SLO IdP initiated, Parser) + # + class Logoutresponse < SamlMessage + include ErrorHandling + + # OneLogin::RubySaml::Settings Toolkit settings + attr_accessor :settings + + attr_reader :document + attr_reader :response + attr_reader :options + + attr_accessor :soft + + # Constructs the Logout Response. A Logout Response Object that is an extension of the SamlMessage class. + # @param response [String] A UUEncoded logout response from the IdP. + # @param settings [OneLogin::RubySaml::Settings|nil] Toolkit settings + # @param options [Hash] Extra parameters. + # :matches_request_id It will validate that the logout response matches the ID of the request. + # :get_params GET Parameters, including the SAMLResponse + # :relax_signature_validation to accept signatures if no idp certificate registered on settings + # + # @raise [ArgumentError] if response is nil + # + def initialize(response, settings = nil, options = {}) + @errors = [] + raise ArgumentError.new("Logoutresponse cannot be nil") if response.nil? + @settings = settings + + if settings.nil? || settings.soft.nil? + @soft = true + else + @soft = settings.soft + end + + @options = options + @response = decode_raw_saml(response, settings) + @document = XMLSecurity::SignedDocument.new(@response) + end + + def response_id + id(document) + end + + # Checks if the Status has the "Success" code + # @return [Boolean] True if the StatusCode is Sucess + # @raise [ValidationError] if soft == false and validation fails + # + def success? + return status_code == "urn:oasis:names:tc:SAML:2.0:status:Success" + end + + # @return [String|nil] Gets the InResponseTo attribute from the Logout Response if exists. + # + def in_response_to + @in_response_to ||= begin + node = REXML::XPath.first( + document, + "/p:LogoutResponse", + { "p" => PROTOCOL } + ) + node.nil? ? nil : node.attributes['InResponseTo'] + end + end + + # @return [String] Gets the Issuer from the Logout Response. + # + def issuer + @issuer ||= begin + node = REXML::XPath.first( + document, + "/p:LogoutResponse/a:Issuer", + { "p" => PROTOCOL, "a" => ASSERTION } + ) + Utils.element_text(node) + end + end + + # @return [String] Gets the StatusCode from a Logout Response. + # + def status_code + @status_code ||= begin + node = REXML::XPath.first(document, "/p:LogoutResponse/p:Status/p:StatusCode", { "p" => PROTOCOL }) + node.nil? ? nil : node.attributes["Value"] + end + end + + def status_message + @status_message ||= begin + node = REXML::XPath.first( + document, + "/p:LogoutResponse/p:Status/p:StatusMessage", + { "p" => PROTOCOL } + ) + Utils.element_text(node) + end + end + + # Aux function to validate the Logout Response + # @param collect_errors [Boolean] Stop validation when first error appears or keep validating. (if soft=true) + # @return [Boolean] TRUE if the SAML Response is valid + # @raise [ValidationError] if soft == false and validation fails + # + def validate(collect_errors = false) + reset_errors! + + validations = [ + :valid_state?, + :validate_success_status, + :validate_structure, + :valid_in_response_to?, + :valid_issuer?, + :validate_signature + ] + + if collect_errors + validations.each { |validation| send(validation) } + @errors.empty? + else + validations.all? { |validation| send(validation) } + end + end + + private + + # Validates the Status of the Logout Response + # If fails, the error is added to the errors array, including the StatusCode returned and the Status Message. + # @return [Boolean] True if the Logout Response contains a Success code, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def validate_success_status + return true if success? + + error_msg = 'The status code of the Logout Response was not Success' + status_error_msg = OneLogin::RubySaml::Utils.status_error_msg(error_msg, status_code, status_message) + append_error(status_error_msg) + end + + # Validates the Logout Response against the specified schema. + # @return [Boolean] True if the XML is valid, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def validate_structure + unless valid_saml?(document, soft) + return append_error("Invalid SAML Logout Response. Not match the saml-schema-protocol-2.0.xsd") + end + + true + end + + # Validates that the Logout Response provided in the initialization is not empty, + # also check that the setting and the IdP cert were also provided + # @return [Boolean] True if the required info is found, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def valid_state? + return append_error("Blank logout response") if response.empty? + + return append_error("No settings on logout response") if settings.nil? + + return append_error("No sp_entity_id in settings of the logout response") if settings.sp_entity_id.nil? + + if settings.idp_cert_fingerprint.nil? && settings.idp_cert.nil? && settings.idp_cert_multi.nil? + return append_error("No fingerprint or certificate on settings of the logout response") + end + + true + end + + # Validates if a provided :matches_request_id matchs the inResponseTo value. + # @param soft [String|nil] request_id The ID of the Logout Request sent by this SP to the IdP (if was sent any) + # @return [Boolean] True if there is no request_id or it match, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def valid_in_response_to? + return true unless options.has_key? :matches_request_id + return true if options[:matches_request_id].nil? + return true unless options[:matches_request_id] != in_response_to + + error_msg = "The InResponseTo of the Logout Response: #{in_response_to}, does not match the ID of the Logout Request sent by the SP: #{options[:matches_request_id]}" + append_error(error_msg) + end + + # Validates the Issuer of the Logout Response + # @return [Boolean] True if the Issuer matchs the IdP entityId, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def valid_issuer? + return true if settings.idp_entity_id.nil? || issuer.nil? + + unless OneLogin::RubySaml::Utils.uri_match?(issuer, settings.idp_entity_id) + return append_error("Doesn't match the issuer, expected: <#{settings.idp_entity_id}>, but was: <#{issuer}>") + end + true + end + + # Validates the Signature if it exists and the GET parameters are provided + # @return [Boolean] True if not contains a Signature or if the Signature is valid, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def validate_signature + return true unless !options.nil? + return true unless options.has_key? :get_params + return true unless options[:get_params].has_key? 'Signature' + + options[:raw_get_params] = OneLogin::RubySaml::Utils.prepare_raw_get_params(options[:raw_get_params], options[:get_params], settings.security[:lowercase_url_encoding]) + + if options[:get_params]['SigAlg'].nil? && !options[:raw_get_params]['SigAlg'].nil? + options[:get_params]['SigAlg'] = CGI.unescape(options[:raw_get_params]['SigAlg']) + end + + idp_cert = settings.get_idp_cert + idp_certs = settings.get_idp_cert_multi + + if idp_cert.nil? && (idp_certs.nil? || idp_certs[:signing].empty?) + return options.has_key? :relax_signature_validation + end + + query_string = OneLogin::RubySaml::Utils.build_query_from_raw_parts( + :type => 'SAMLResponse', + :raw_data => options[:raw_get_params]['SAMLResponse'], + :raw_relay_state => options[:raw_get_params]['RelayState'], + :raw_sig_alg => options[:raw_get_params]['SigAlg'] + ) + + expired = false + if idp_certs.nil? || idp_certs[:signing].empty? + valid = OneLogin::RubySaml::Utils.verify_signature( + :cert => idp_cert, + :sig_alg => options[:get_params]['SigAlg'], + :signature => options[:get_params]['Signature'], + :query_string => query_string + ) + if valid && settings.security[:check_idp_cert_expiration] + if OneLogin::RubySaml::Utils.is_cert_expired(idp_cert) + expired = true + end + end + else + valid = false + idp_certs[:signing].each do |signing_idp_cert| + valid = OneLogin::RubySaml::Utils.verify_signature( + :cert => signing_idp_cert, + :sig_alg => options[:get_params]['SigAlg'], + :signature => options[:get_params]['Signature'], + :query_string => query_string + ) + if valid + if settings.security[:check_idp_cert_expiration] + if OneLogin::RubySaml::Utils.is_cert_expired(signing_idp_cert) + expired = true + end + end + break + end + end + end + + if expired + error_msg = "IdP x509 certificate expired" + return append_error(error_msg) + end + unless valid + error_msg = "Invalid Signature on Logout Response" + return append_error(error_msg) + end + true + end + + end + end +end diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/metadata.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/metadata.rb new file mode 100644 index 0000000..a6adcf8 --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/metadata.rb @@ -0,0 +1,177 @@ +require "uri" + +require "onelogin/ruby-saml/logging" +require "onelogin/ruby-saml/utils" + +# Only supports SAML 2.0 +module OneLogin + module RubySaml + + # SAML2 Metadata. XML Metadata Builder + # + class Metadata + + # Return SP metadata based on the settings. + # @param settings [OneLogin::RubySaml::Settings|nil] Toolkit settings + # @param pretty_print [Boolean] Pretty print or not the response + # (No pretty print if you gonna validate the signature) + # @param valid_until [DateTime] Metadata's valid time + # @param cache_duration [Integer] Duration of the cache in seconds + # @return [String] XML Metadata of the Service Provider + # + def generate(settings, pretty_print=false, valid_until=nil, cache_duration=nil) + meta_doc = XMLSecurity::Document.new + add_xml_declaration(meta_doc) + root = add_root_element(meta_doc, settings, valid_until, cache_duration) + sp_sso = add_sp_sso_element(root, settings) + add_sp_certificates(sp_sso, settings) + add_sp_service_elements(sp_sso, settings) + add_extras(root, settings) + embed_signature(meta_doc, settings) + output_xml(meta_doc, pretty_print) + end + + protected + + def add_xml_declaration(meta_doc) + meta_doc << REXML::XMLDecl.new('1.0', 'UTF-8') + end + + def add_root_element(meta_doc, settings, valid_until, cache_duration) + namespaces = { + "xmlns:md" => "urn:oasis:names:tc:SAML:2.0:metadata" + } + + if settings.attribute_consuming_service.configured? + namespaces["xmlns:saml"] = "urn:oasis:names:tc:SAML:2.0:assertion" + end + + root = meta_doc.add_element("md:EntityDescriptor", namespaces) + root.attributes["ID"] = OneLogin::RubySaml::Utils.uuid + root.attributes["entityID"] = settings.sp_entity_id if settings.sp_entity_id + root.attributes["validUntil"] = valid_until.strftime('%Y-%m-%dT%H:%M:%S%z') if valid_until + root.attributes["cacheDuration"] = "PT" + cache_duration.to_s + "S" if cache_duration + root + end + + def add_sp_sso_element(root, settings) + root.add_element "md:SPSSODescriptor", { + "protocolSupportEnumeration" => "urn:oasis:names:tc:SAML:2.0:protocol", + "AuthnRequestsSigned" => settings.security[:authn_requests_signed], + "WantAssertionsSigned" => settings.security[:want_assertions_signed], + } + end + + # Add KeyDescriptor if messages will be signed / encrypted + # with SP certificate, and new SP certificate if any + def add_sp_certificates(sp_sso, settings) + cert = settings.get_sp_cert + cert_new = settings.get_sp_cert_new + + for sp_cert in [cert, cert_new] + if sp_cert + cert_text = Base64.encode64(sp_cert.to_der).gsub("\n", '') + kd = sp_sso.add_element "md:KeyDescriptor", { "use" => "signing" } + ki = kd.add_element "ds:KeyInfo", {"xmlns:ds" => "http://www.w3.org/2000/09/xmldsig#"} + xd = ki.add_element "ds:X509Data" + xc = xd.add_element "ds:X509Certificate" + xc.text = cert_text + + if settings.security[:want_assertions_encrypted] + kd2 = sp_sso.add_element "md:KeyDescriptor", { "use" => "encryption" } + ki2 = kd2.add_element "ds:KeyInfo", {"xmlns:ds" => "http://www.w3.org/2000/09/xmldsig#"} + xd2 = ki2.add_element "ds:X509Data" + xc2 = xd2.add_element "ds:X509Certificate" + xc2.text = cert_text + end + end + end + + sp_sso + end + + def add_sp_service_elements(sp_sso, settings) + if settings.single_logout_service_url + sp_sso.add_element "md:SingleLogoutService", { + "Binding" => settings.single_logout_service_binding, + "Location" => settings.single_logout_service_url, + "ResponseLocation" => settings.single_logout_service_url + } + end + + if settings.name_identifier_format + nameid = sp_sso.add_element "md:NameIDFormat" + nameid.text = settings.name_identifier_format + end + + if settings.assertion_consumer_service_url + sp_sso.add_element "md:AssertionConsumerService", { + "Binding" => settings.assertion_consumer_service_binding, + "Location" => settings.assertion_consumer_service_url, + "isDefault" => true, + "index" => 0 + } + end + + if settings.attribute_consuming_service.configured? + sp_acs = sp_sso.add_element "md:AttributeConsumingService", { + "isDefault" => "true", + "index" => settings.attribute_consuming_service.index + } + srv_name = sp_acs.add_element "md:ServiceName", { + "xml:lang" => "en" + } + srv_name.text = settings.attribute_consuming_service.name + settings.attribute_consuming_service.attributes.each do |attribute| + sp_req_attr = sp_acs.add_element "md:RequestedAttribute", { + "NameFormat" => attribute[:name_format], + "Name" => attribute[:name], + "FriendlyName" => attribute[:friendly_name], + "isRequired" => attribute[:is_required] || false + } + unless attribute[:attribute_value].nil? + Array(attribute[:attribute_value]).each do |value| + sp_attr_val = sp_req_attr.add_element "saml:AttributeValue" + sp_attr_val.text = value.to_s + end + end + end + end + + # With OpenSSO, it might be required to also include + # + # + + sp_sso + end + + # can be overridden in subclass + def add_extras(root, _settings) + root + end + + def embed_signature(meta_doc, settings) + return unless settings.security[:metadata_signed] + + private_key = settings.get_sp_key + cert = settings.get_sp_cert + return unless private_key && cert + + meta_doc.sign_document(private_key, cert, settings.security[:signature_method], settings.security[:digest_method]) + end + + def output_xml(meta_doc, pretty_print) + ret = '' + + # pretty print the XML so IdP administrators can easily see what the SP supports + if pretty_print + meta_doc.write(ret, 1) + else + ret = meta_doc.to_s + end + + ret + end + end + end +end diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/response.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/response.rb new file mode 100644 index 0000000..73e7e52 --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/response.rb @@ -0,0 +1,1071 @@ +require "xml_security" +require "onelogin/ruby-saml/attributes" + +require "time" +require "nokogiri" + +# Only supports SAML 2.0 +module OneLogin + module RubySaml + + # SAML2 Authentication Response. SAML Response + # + class Response < SamlMessage + include ErrorHandling + + ASSERTION = "urn:oasis:names:tc:SAML:2.0:assertion" + PROTOCOL = "urn:oasis:names:tc:SAML:2.0:protocol" + DSIG = "http://www.w3.org/2000/09/xmldsig#" + XENC = "http://www.w3.org/2001/04/xmlenc#" + + # TODO: Settings should probably be initialized too... WDYT? + + # OneLogin::RubySaml::Settings Toolkit settings + attr_accessor :settings + + attr_reader :document + attr_reader :decrypted_document + attr_reader :response + attr_reader :options + + attr_accessor :soft + + # Response available options + # This is not a whitelist to allow people extending OneLogin::RubySaml:Response + # and pass custom options + AVAILABLE_OPTIONS = [ + :allowed_clock_drift, :check_duplicated_attributes, :matches_request_id, :settings, :skip_audience, :skip_authnstatement, :skip_conditions, + :skip_destination, :skip_recipient_check, :skip_subject_confirmation + ] + # TODO: Update the comment on initialize to describe every option + + # Constructs the SAML Response. A Response Object that is an extension of the SamlMessage class. + # @param response [String] A UUEncoded SAML response from the IdP. + # @param options [Hash] :settings to provide the OneLogin::RubySaml::Settings object + # Or some options for the response validation process like skip the conditions validation + # with the :skip_conditions, or allow a clock_drift when checking dates with :allowed_clock_drift + # or :matches_request_id that will validate that the response matches the ID of the request, + # or skip the subject confirmation validation with the :skip_subject_confirmation option + # or skip the recipient validation of the subject confirmation element with :skip_recipient_check option + # or skip the audience validation with :skip_audience option + # + def initialize(response, options = {}) + raise ArgumentError.new("Response cannot be nil") if response.nil? + + @errors = [] + + @options = options + @soft = true + unless options[:settings].nil? + @settings = options[:settings] + unless @settings.soft.nil? + @soft = @settings.soft + end + end + + @response = decode_raw_saml(response, settings) + @document = XMLSecurity::SignedDocument.new(@response, @errors) + + if assertion_encrypted? + @decrypted_document = generate_decrypted_document + end + end + + # Validates the SAML Response with the default values (soft = true) + # @param collect_errors [Boolean] Stop validation when first error appears or keep validating. (if soft=true) + # @return [Boolean] TRUE if the SAML Response is valid + # + def is_valid?(collect_errors = false) + validate(collect_errors) + end + + # @return [String] the NameID provided by the SAML response from the IdP. + # + def name_id + @name_id ||= Utils.element_text(name_id_node) + end + + alias_method :nameid, :name_id + + # @return [String] the NameID Format provided by the SAML response from the IdP. + # + def name_id_format + @name_id_format ||= + if name_id_node && name_id_node.attribute("Format") + name_id_node.attribute("Format").value + end + end + + alias_method :nameid_format, :name_id_format + + # @return [String] the NameID SPNameQualifier provided by the SAML response from the IdP. + # + def name_id_spnamequalifier + @name_id_spnamequalifier ||= + if name_id_node && name_id_node.attribute("SPNameQualifier") + name_id_node.attribute("SPNameQualifier").value + end + end + + # @return [String] the NameID NameQualifier provided by the SAML response from the IdP. + # + def name_id_namequalifier + @name_id_namequalifier ||= + if name_id_node && name_id_node.attribute("NameQualifier") + name_id_node.attribute("NameQualifier").value + end + end + + # Gets the SessionIndex from the AuthnStatement. + # Could be used to be stored in the local session in order + # to be used in a future Logout Request that the SP could + # send to the IdP, to set what specific session must be deleted + # @return [String] SessionIndex Value + # + def sessionindex + @sessionindex ||= begin + node = xpath_first_from_signed_assertion('/a:AuthnStatement') + node.nil? ? nil : node.attributes['SessionIndex'] + end + end + + # Gets the Attributes from the AttributeStatement element. + # + # All attributes can be iterated over +attributes.each+ or returned as array by +attributes.all+ + # For backwards compatibility ruby-saml returns by default only the first value for a given attribute with + # attributes['name'] + # To get all of the attributes, use: + # attributes.multi('name') + # Or turn off the compatibility: + # OneLogin::RubySaml::Attributes.single_value_compatibility = false + # Now this will return an array: + # attributes['name'] + # + # @return [Attributes] OneLogin::RubySaml::Attributes enumerable collection. + # @raise [ValidationError] if there are 2+ Attribute with the same Name + # + def attributes + @attr_statements ||= begin + attributes = Attributes.new + + stmt_elements = xpath_from_signed_assertion('/a:AttributeStatement') + stmt_elements.each do |stmt_element| + stmt_element.elements.each do |attr_element| + if attr_element.name == "EncryptedAttribute" + node = decrypt_attribute(attr_element.dup) + else + node = attr_element + end + + name = node.attributes["Name"] + + if options[:check_duplicated_attributes] && attributes.include?(name) + raise ValidationError.new("Found an Attribute element with duplicated Name") + end + + values = node.elements.collect{|e| + if (e.elements.nil? || e.elements.size == 0) + # SAMLCore requires that nil AttributeValues MUST contain xsi:nil XML attribute set to "true" or "1" + # otherwise the value is to be regarded as empty. + ["true", "1"].include?(e.attributes['xsi:nil']) ? nil : Utils.element_text(e) + # explicitly support saml2:NameID with saml2:NameQualifier if supplied in attributes + # this is useful for allowing eduPersonTargetedId to be passed as an opaque identifier to use to + # identify the subject in an SP rather than email or other less opaque attributes + # NameQualifier, if present is prefixed with a "/" to the value + else + REXML::XPath.match(e,'a:NameID', { "a" => ASSERTION }).collect do |n| + base_path = n.attributes['NameQualifier'] ? "#{n.attributes['NameQualifier']}/" : '' + "#{base_path}#{Utils.element_text(n)}" + end + end + } + + attributes.add(name, values.flatten) + end + end + attributes + end + end + + # Gets the SessionNotOnOrAfter from the AuthnStatement. + # Could be used to set the local session expiration (expire at latest) + # @return [String] The SessionNotOnOrAfter value + # + def session_expires_at + @expires_at ||= begin + node = xpath_first_from_signed_assertion('/a:AuthnStatement') + node.nil? ? nil : parse_time(node, "SessionNotOnOrAfter") + end + end + + # Checks if the Status has the "Success" code + # @return [Boolean] True if the StatusCode is Sucess + # + def success? + status_code == "urn:oasis:names:tc:SAML:2.0:status:Success" + end + + # @return [String] StatusCode value from a SAML Response. + # + def status_code + @status_code ||= begin + nodes = REXML::XPath.match( + document, + "/p:Response/p:Status/p:StatusCode", + { "p" => PROTOCOL } + ) + if nodes.size == 1 + node = nodes[0] + code = node.attributes["Value"] if node && node.attributes + + unless code == "urn:oasis:names:tc:SAML:2.0:status:Success" + nodes = REXML::XPath.match( + document, + "/p:Response/p:Status/p:StatusCode/p:StatusCode", + { "p" => PROTOCOL } + ) + statuses = nodes.collect do |inner_node| + inner_node.attributes["Value"] + end + + code = [code, statuses].flatten.join(" | ") + end + + code + end + end + end + + # @return [String] the StatusMessage value from a SAML Response. + # + def status_message + @status_message ||= begin + nodes = REXML::XPath.match( + document, + "/p:Response/p:Status/p:StatusMessage", + { "p" => PROTOCOL } + ) + if nodes.size == 1 + Utils.element_text(nodes.first) + end + end + end + + # Gets the Condition Element of the SAML Response if exists. + # (returns the first node that matches the supplied xpath) + # @return [REXML::Element] Conditions Element if exists + # + def conditions + @conditions ||= xpath_first_from_signed_assertion('/a:Conditions') + end + + # Gets the NotBefore Condition Element value. + # @return [Time] The NotBefore value in Time format + # + def not_before + @not_before ||= parse_time(conditions, "NotBefore") + end + + # Gets the NotOnOrAfter Condition Element value. + # @return [Time] The NotOnOrAfter value in Time format + # + def not_on_or_after + @not_on_or_after ||= parse_time(conditions, "NotOnOrAfter") + end + + # Gets the Issuers (from Response and Assertion). + # (returns the first node that matches the supplied xpath from the Response and from the Assertion) + # @return [Array] Array with the Issuers (REXML::Element) + # + def issuers + @issuers ||= begin + issuer_response_nodes = REXML::XPath.match( + document, + "/p:Response/a:Issuer", + { "p" => PROTOCOL, "a" => ASSERTION } + ) + + unless issuer_response_nodes.size == 1 + error_msg = "Issuer of the Response not found or multiple." + raise ValidationError.new(error_msg) + end + + issuer_assertion_nodes = xpath_from_signed_assertion("/a:Issuer") + unless issuer_assertion_nodes.size == 1 + error_msg = "Issuer of the Assertion not found or multiple." + raise ValidationError.new(error_msg) + end + + nodes = issuer_response_nodes + issuer_assertion_nodes + nodes.map { |node| Utils.element_text(node) }.compact.uniq + end + end + + # @return [String|nil] The InResponseTo attribute from the SAML Response. + # + def in_response_to + @in_response_to ||= begin + node = REXML::XPath.first( + document, + "/p:Response", + { "p" => PROTOCOL } + ) + node.nil? ? nil : node.attributes['InResponseTo'] + end + end + + # @return [String|nil] Destination attribute from the SAML Response. + # + def destination + @destination ||= begin + node = REXML::XPath.first( + document, + "/p:Response", + { "p" => PROTOCOL } + ) + node.nil? ? nil : node.attributes['Destination'] + end + end + + # @return [Array] The Audience elements from the Contitions of the SAML Response. + # + def audiences + @audiences ||= begin + nodes = xpath_from_signed_assertion('/a:Conditions/a:AudienceRestriction/a:Audience') + nodes.map { |node| Utils.element_text(node) }.reject(&:empty?) + end + end + + # returns the allowed clock drift on timing validation + # @return [Float] + def allowed_clock_drift + options[:allowed_clock_drift].to_f.abs + Float::EPSILON + end + + # Checks if the SAML Response contains or not an EncryptedAssertion element + # @return [Boolean] True if the SAML Response contains an EncryptedAssertion element + # + def assertion_encrypted? + ! REXML::XPath.first( + document, + "(/p:Response/EncryptedAssertion/)|(/p:Response/a:EncryptedAssertion/)", + { "p" => PROTOCOL, "a" => ASSERTION } + ).nil? + end + + def response_id + id(document) + end + + def assertion_id + @assertion_id ||= begin + node = xpath_first_from_signed_assertion("") + node.nil? ? nil : node.attributes['ID'] + end + end + + private + + # Validates the SAML Response (calls several validation methods) + # @param collect_errors [Boolean] Stop validation when first error appears or keep validating. (if soft=true) + # @return [Boolean] True if the SAML Response is valid, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def validate(collect_errors = false) + reset_errors! + return false unless validate_response_state + + validations = [ + :validate_version, + :validate_id, + :validate_success_status, + :validate_num_assertion, + :validate_no_duplicated_attributes, + :validate_signed_elements, + :validate_structure, + :validate_in_response_to, + :validate_one_conditions, + :validate_conditions, + :validate_one_authnstatement, + :validate_audience, + :validate_destination, + :validate_issuer, + :validate_session_expiration, + :validate_subject_confirmation, + :validate_name_id, + :validate_signature + ] + + if collect_errors + validations.each { |validation| send(validation) } + @errors.empty? + else + validations.all? { |validation| send(validation) } + end + end + + + # Validates the Status of the SAML Response + # @return [Boolean] True if the SAML Response contains a Success code, otherwise False if soft == false + # @raise [ValidationError] if soft == false and validation fails + # + def validate_success_status + return true if success? + + error_msg = 'The status code of the Response was not Success' + status_error_msg = OneLogin::RubySaml::Utils.status_error_msg(error_msg, status_code, status_message) + append_error(status_error_msg) + end + + # Validates the SAML Response against the specified schema. + # @return [Boolean] True if the XML is valid, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def validate_structure + structure_error_msg = "Invalid SAML Response. Not match the saml-schema-protocol-2.0.xsd" + unless valid_saml?(document, soft) + return append_error(structure_error_msg) + end + + unless decrypted_document.nil? + unless valid_saml?(decrypted_document, soft) + return append_error(structure_error_msg) + end + end + + true + end + + # Validates that the SAML Response provided in the initialization is not empty, + # also check that the setting and the IdP cert were also provided + # @return [Boolean] True if the required info is found, false otherwise + # + def validate_response_state + return append_error("Blank response") if response.nil? || response.empty? + + return append_error("No settings on response") if settings.nil? + + if settings.idp_cert_fingerprint.nil? && settings.idp_cert.nil? && settings.idp_cert_multi.nil? + return append_error("No fingerprint or certificate on settings") + end + + true + end + + # Validates that the SAML Response contains an ID + # If fails, the error is added to the errors array. + # @return [Boolean] True if the SAML Response contains an ID, otherwise returns False + # + def validate_id + unless response_id + return append_error("Missing ID attribute on SAML Response") + end + + true + end + + # Validates the SAML version (2.0) + # If fails, the error is added to the errors array. + # @return [Boolean] True if the SAML Response is 2.0, otherwise returns False + # + def validate_version + unless version(document) == "2.0" + return append_error("Unsupported SAML version") + end + + true + end + + # Validates that the SAML Response only contains a single Assertion (encrypted or not). + # If fails, the error is added to the errors array. + # @return [Boolean] True if the SAML Response contains one unique Assertion, otherwise False + # + def validate_num_assertion + error_msg = "SAML Response must contain 1 assertion" + assertions = REXML::XPath.match( + document, + "//a:Assertion", + { "a" => ASSERTION } + ) + encrypted_assertions = REXML::XPath.match( + document, + "//a:EncryptedAssertion", + { "a" => ASSERTION } + ) + + unless assertions.size + encrypted_assertions.size == 1 + return append_error(error_msg) + end + + unless decrypted_document.nil? + assertions = REXML::XPath.match( + decrypted_document, + "//a:Assertion", + { "a" => ASSERTION } + ) + unless assertions.size == 1 + return append_error(error_msg) + end + end + + true + end + + # Validates that there are not duplicated attributes + # If fails, the error is added to the errors array + # @return [Boolean] True if there are no duplicated attribute elements, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def validate_no_duplicated_attributes + if options[:check_duplicated_attributes] + begin + attributes + rescue ValidationError => e + return append_error(e.message) + end + end + + true + end + + # Validates the Signed elements + # If fails, the error is added to the errors array + # @return [Boolean] True if there is 1 or 2 Elements signed in the SAML Response + # an are a Response or an Assertion Element, otherwise False if soft=True + # + def validate_signed_elements + signature_nodes = REXML::XPath.match( + decrypted_document.nil? ? document : decrypted_document, + "//ds:Signature", + {"ds"=>DSIG} + ) + signed_elements = [] + verified_seis = [] + verified_ids = [] + signature_nodes.each do |signature_node| + signed_element = signature_node.parent.name + if signed_element != 'Response' && signed_element != 'Assertion' + return append_error("Invalid Signature Element '#{signed_element}'. SAML Response rejected") + end + + if signature_node.parent.attributes['ID'].nil? + return append_error("Signed Element must contain an ID. SAML Response rejected") + end + + id = signature_node.parent.attributes.get_attribute("ID").value + if verified_ids.include?(id) + return append_error("Duplicated ID. SAML Response rejected") + end + verified_ids.push(id) + + # Check that reference URI matches the parent ID and no duplicate References or IDs + ref = REXML::XPath.first(signature_node, ".//ds:Reference", {"ds"=>DSIG}) + if ref + uri = ref.attributes.get_attribute("URI") + if uri && !uri.value.empty? + sei = uri.value[1..-1] + + unless sei == id + return append_error("Found an invalid Signed Element. SAML Response rejected") + end + + if verified_seis.include?(sei) + return append_error("Duplicated Reference URI. SAML Response rejected") + end + + verified_seis.push(sei) + end + end + + signed_elements << signed_element + end + + unless signature_nodes.length < 3 && !signed_elements.empty? + return append_error("Found an unexpected number of Signature Element. SAML Response rejected") + end + + if settings.security[:want_assertions_signed] && !(signed_elements.include? "Assertion") + return append_error("The Assertion of the Response is not signed and the SP requires it") + end + + true + end + + # Validates if the provided request_id match the inResponseTo value. + # If fails, the error is added to the errors array + # @return [Boolean] True if there is no request_id or it match, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def validate_in_response_to + return true unless options.has_key? :matches_request_id + return true if options[:matches_request_id].nil? + return true unless options[:matches_request_id] != in_response_to + + error_msg = "The InResponseTo of the Response: #{in_response_to}, does not match the ID of the AuthNRequest sent by the SP: #{options[:matches_request_id]}" + append_error(error_msg) + end + + # Validates the Audience, (If the Audience match the Service Provider EntityID) + # If the response was initialized with the :skip_audience option, this validation is skipped, + # If fails, the error is added to the errors array + # @return [Boolean] True if there is an Audience Element that match the Service Provider EntityID, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def validate_audience + return true if options[:skip_audience] + return true if settings.sp_entity_id.nil? || settings.sp_entity_id.empty? + + if audiences.empty? + return true unless settings.security[:strict_audience_validation] + return append_error("Invalid Audiences. The element contained only empty elements. Expected audience #{settings.sp_entity_id}.") + end + + unless audiences.include? settings.sp_entity_id + s = audiences.count > 1 ? 's' : ''; + error_msg = "Invalid Audience#{s}. The audience#{s} #{audiences.join(',')}, did not match the expected audience #{settings.sp_entity_id}" + return append_error(error_msg) + end + + true + end + + # Validates the Destination, (If the SAML Response is received where expected). + # If the response was initialized with the :skip_destination option, this validation is skipped, + # If fails, the error is added to the errors array + # @return [Boolean] True if there is a Destination element that matches the Consumer Service URL, otherwise False + # + def validate_destination + return true if destination.nil? + return true if options[:skip_destination] + + if destination.empty? + error_msg = "The response has an empty Destination value" + return append_error(error_msg) + end + + return true if settings.assertion_consumer_service_url.nil? || settings.assertion_consumer_service_url.empty? + + unless OneLogin::RubySaml::Utils.uri_match?(destination, settings.assertion_consumer_service_url) + error_msg = "The response was received at #{destination} instead of #{settings.assertion_consumer_service_url}" + return append_error(error_msg) + end + + true + end + + # Checks that the samlp:Response/saml:Assertion/saml:Conditions element exists and is unique. + # (If the response was initialized with the :skip_conditions option, this validation is skipped) + # If fails, the error is added to the errors array + # @return [Boolean] True if there is a conditions element and is unique + # + def validate_one_conditions + return true if options[:skip_conditions] + + conditions_nodes = xpath_from_signed_assertion('/a:Conditions') + unless conditions_nodes.size == 1 + error_msg = "The Assertion must include one Conditions element" + return append_error(error_msg) + end + + true + end + + # Checks that the samlp:Response/saml:Assertion/saml:AuthnStatement element exists and is unique. + # If fails, the error is added to the errors array + # @return [Boolean] True if there is a authnstatement element and is unique + # + def validate_one_authnstatement + return true if options[:skip_authnstatement] + + authnstatement_nodes = xpath_from_signed_assertion('/a:AuthnStatement') + unless authnstatement_nodes.size == 1 + error_msg = "The Assertion must include one AuthnStatement element" + return append_error(error_msg) + end + + true + end + + # Validates the Conditions. (If the response was initialized with the :skip_conditions option, this validation is skipped, + # If the response was initialized with the :allowed_clock_drift option, the timing validations are relaxed by the allowed_clock_drift value) + # @return [Boolean] True if satisfies the conditions, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def validate_conditions + return true if conditions.nil? + return true if options[:skip_conditions] + + now = Time.now.utc + + if not_before && now < (not_before - allowed_clock_drift) + error_msg = "Current time is earlier than NotBefore condition (#{now} < #{not_before}#{" - #{allowed_clock_drift.ceil}s" if allowed_clock_drift > 0})" + return append_error(error_msg) + end + + if not_on_or_after && now >= (not_on_or_after + allowed_clock_drift) + error_msg = "Current time is on or after NotOnOrAfter condition (#{now} >= #{not_on_or_after}#{" + #{allowed_clock_drift.ceil}s" if allowed_clock_drift > 0})" + return append_error(error_msg) + end + + true + end + + # Validates the Issuer (Of the SAML Response and the SAML Assertion) + # @param soft [Boolean] soft Enable or Disable the soft mode (In order to raise exceptions when the response is invalid or not) + # @return [Boolean] True if the Issuer matchs the IdP entityId, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def validate_issuer + return true if settings.idp_entity_id.nil? + + begin + obtained_issuers = issuers + rescue ValidationError => e + return append_error(e.message) + end + + obtained_issuers.each do |issuer| + unless OneLogin::RubySaml::Utils.uri_match?(issuer, settings.idp_entity_id) + error_msg = "Doesn't match the issuer, expected: <#{settings.idp_entity_id}>, but was: <#{issuer}>" + return append_error(error_msg) + end + end + + true + end + + # Validates that the Session haven't expired (If the response was initialized with the :allowed_clock_drift option, + # this time validation is relaxed by the allowed_clock_drift value) + # If fails, the error is added to the errors array + # @param soft [Boolean] soft Enable or Disable the soft mode (In order to raise exceptions when the response is invalid or not) + # @return [Boolean] True if the SessionNotOnOrAfter of the AuthnStatement is valid, otherwise (when expired) False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def validate_session_expiration(soft = true) + return true if session_expires_at.nil? + + now = Time.now.utc + unless now < (session_expires_at + allowed_clock_drift) + error_msg = "The attributes have expired, based on the SessionNotOnOrAfter of the AuthnStatement of this Response" + return append_error(error_msg) + end + + true + end + + # Validates if exists valid SubjectConfirmation (If the response was initialized with the :allowed_clock_drift option, + # timimg validation are relaxed by the allowed_clock_drift value. If the response was initialized with the + # :skip_subject_confirmation option, this validation is skipped) + # There is also an optional Recipient check + # If fails, the error is added to the errors array + # @return [Boolean] True if exists a valid SubjectConfirmation, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def validate_subject_confirmation + return true if options[:skip_subject_confirmation] + valid_subject_confirmation = false + + subject_confirmation_nodes = xpath_from_signed_assertion('/a:Subject/a:SubjectConfirmation') + + now = Time.now.utc + subject_confirmation_nodes.each do |subject_confirmation| + if subject_confirmation.attributes.include? "Method" and subject_confirmation.attributes['Method'] != 'urn:oasis:names:tc:SAML:2.0:cm:bearer' + next + end + + confirmation_data_node = REXML::XPath.first( + subject_confirmation, + 'a:SubjectConfirmationData', + { "a" => ASSERTION } + ) + + next unless confirmation_data_node + + attrs = confirmation_data_node.attributes + next if (attrs.include? "InResponseTo" and attrs['InResponseTo'] != in_response_to) || + (attrs.include? "NotBefore" and now < (parse_time(confirmation_data_node, "NotBefore") - allowed_clock_drift)) || + (attrs.include? "NotOnOrAfter" and now >= (parse_time(confirmation_data_node, "NotOnOrAfter") + allowed_clock_drift)) || + (attrs.include? "Recipient" and !options[:skip_recipient_check] and settings and attrs['Recipient'] != settings.assertion_consumer_service_url) + + valid_subject_confirmation = true + break + end + + if !valid_subject_confirmation + error_msg = "A valid SubjectConfirmation was not found on this Response" + return append_error(error_msg) + end + + true + end + + # Validates the NameID element + def validate_name_id + if name_id_node.nil? + if settings.security[:want_name_id] + return append_error("No NameID element found in the assertion of the Response") + end + else + if name_id.nil? || name_id.empty? + return append_error("An empty NameID value found") + end + + unless settings.sp_entity_id.nil? || settings.sp_entity_id.empty? || name_id_spnamequalifier.nil? || name_id_spnamequalifier.empty? + if name_id_spnamequalifier != settings.sp_entity_id + return append_error("The SPNameQualifier value mistmatch the SP entityID value.") + end + end + end + + true + end + + # Validates the Signature + # @return [Boolean] True if not contains a Signature or if the Signature is valid, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def validate_signature + error_msg = "Invalid Signature on SAML Response" + + # If the response contains the signature, and the assertion was encrypted, validate the original SAML Response + # otherwise, review if the decrypted assertion contains a signature + sig_elements = REXML::XPath.match( + document, + "/p:Response[@ID=$id]/ds:Signature", + { "p" => PROTOCOL, "ds" => DSIG }, + { 'id' => document.signed_element_id } + ) + + use_original = sig_elements.size == 1 || decrypted_document.nil? + doc = use_original ? document : decrypted_document + + # Check signature nodes + if sig_elements.nil? || sig_elements.size == 0 + sig_elements = REXML::XPath.match( + doc, + "/p:Response/a:Assertion[@ID=$id]/ds:Signature", + {"p" => PROTOCOL, "a" => ASSERTION, "ds"=>DSIG}, + { 'id' => doc.signed_element_id } + ) + end + + if sig_elements.size != 1 + if sig_elements.size == 0 + append_error("Signed element id ##{doc.signed_element_id} is not found") + else + append_error("Signed element id ##{doc.signed_element_id} is found more than once") + end + return append_error(error_msg) + end + + old_errors = @errors.clone + + idp_certs = settings.get_idp_cert_multi + if idp_certs.nil? || idp_certs[:signing].empty? + opts = {} + opts[:fingerprint_alg] = settings.idp_cert_fingerprint_algorithm + idp_cert = settings.get_idp_cert + fingerprint = settings.get_fingerprint + opts[:cert] = idp_cert + + if fingerprint && doc.validate_document(fingerprint, @soft, opts) + if settings.security[:check_idp_cert_expiration] + if OneLogin::RubySaml::Utils.is_cert_expired(idp_cert) + error_msg = "IdP x509 certificate expired" + return append_error(error_msg) + end + end + else + return append_error(error_msg) + end + else + valid = false + expired = false + idp_certs[:signing].each do |idp_cert| + valid = doc.validate_document_with_cert(idp_cert, true) + if valid + if settings.security[:check_idp_cert_expiration] + if OneLogin::RubySaml::Utils.is_cert_expired(idp_cert) + expired = true + end + end + + # At least one certificate is valid, restore the old accumulated errors + @errors = old_errors + break + end + + end + if expired + error_msg = "IdP x509 certificate expired" + return append_error(error_msg) + end + unless valid + # Remove duplicated errors + @errors = @errors.uniq + return append_error(error_msg) + end + end + + true + end + + def name_id_node + @name_id_node ||= + begin + encrypted_node = xpath_first_from_signed_assertion('/a:Subject/a:EncryptedID') + if encrypted_node + node = decrypt_nameid(encrypted_node) + else + node = xpath_first_from_signed_assertion('/a:Subject/a:NameID') + end + end + end + + # Extracts the first appearance that matchs the subelt (pattern) + # Search on any Assertion that is signed, or has a Response parent signed + # @param subelt [String] The XPath pattern + # @return [REXML::Element | nil] If any matches, return the Element + # + def xpath_first_from_signed_assertion(subelt=nil) + doc = decrypted_document.nil? ? document : decrypted_document + node = REXML::XPath.first( + doc, + "/p:Response/a:Assertion[@ID=$id]#{subelt}", + { "p" => PROTOCOL, "a" => ASSERTION }, + { 'id' => doc.signed_element_id } + ) + node ||= REXML::XPath.first( + doc, + "/p:Response[@ID=$id]/a:Assertion#{subelt}", + { "p" => PROTOCOL, "a" => ASSERTION }, + { 'id' => doc.signed_element_id } + ) + node + end + + # Extracts all the appearances that matchs the subelt (pattern) + # Search on any Assertion that is signed, or has a Response parent signed + # @param subelt [String] The XPath pattern + # @return [Array of REXML::Element] Return all matches + # + def xpath_from_signed_assertion(subelt=nil) + doc = decrypted_document.nil? ? document : decrypted_document + node = REXML::XPath.match( + doc, + "/p:Response/a:Assertion[@ID=$id]#{subelt}", + { "p" => PROTOCOL, "a" => ASSERTION }, + { 'id' => doc.signed_element_id } + ) + node.concat( REXML::XPath.match( + doc, + "/p:Response[@ID=$id]/a:Assertion#{subelt}", + { "p" => PROTOCOL, "a" => ASSERTION }, + { 'id' => doc.signed_element_id } + )) + end + + # Generates the decrypted_document + # @return [XMLSecurity::SignedDocument] The SAML Response with the assertion decrypted + # + def generate_decrypted_document + if settings.nil? || !settings.get_sp_key + raise ValidationError.new('An EncryptedAssertion found and no SP private key found on the settings to decrypt it. Be sure you provided the :settings parameter at the initialize method') + end + + # Marshal at Ruby 1.8.7 throw an Exception + if RUBY_VERSION < "1.9" + document_copy = XMLSecurity::SignedDocument.new(response, errors) + else + document_copy = Marshal.load(Marshal.dump(document)) + end + + decrypt_assertion_from_document(document_copy) + end + + # Obtains a SAML Response with the EncryptedAssertion element decrypted + # @param document_copy [XMLSecurity::SignedDocument] A copy of the original SAML Response with the encrypted assertion + # @return [XMLSecurity::SignedDocument] The SAML Response with the assertion decrypted + # + def decrypt_assertion_from_document(document_copy) + response_node = REXML::XPath.first( + document_copy, + "/p:Response/", + { "p" => PROTOCOL } + ) + encrypted_assertion_node = REXML::XPath.first( + document_copy, + "(/p:Response/EncryptedAssertion/)|(/p:Response/a:EncryptedAssertion/)", + { "p" => PROTOCOL, "a" => ASSERTION } + ) + response_node.add(decrypt_assertion(encrypted_assertion_node)) + encrypted_assertion_node.remove + XMLSecurity::SignedDocument.new(response_node.to_s) + end + + # Decrypts an EncryptedAssertion element + # @param encrypted_assertion_node [REXML::Element] The EncryptedAssertion element + # @return [REXML::Document] The decrypted EncryptedAssertion element + # + def decrypt_assertion(encrypted_assertion_node) + decrypt_element(encrypted_assertion_node, /(.*<\/(\w+:)?Assertion>)/m) + end + + # Decrypts an EncryptedID element + # @param encryptedid_node [REXML::Element] The EncryptedID element + # @return [REXML::Document] The decrypted EncrypedtID element + # + def decrypt_nameid(encryptedid_node) + decrypt_element(encryptedid_node, /(.*<\/(\w+:)?NameID>)/m) + end + + # Decrypts an EncryptedID element + # @param encryptedid_node [REXML::Element] The EncryptedID element + # @return [REXML::Document] The decrypted EncrypedtID element + # + def decrypt_attribute(encryptedattribute_node) + decrypt_element(encryptedattribute_node, /(.*<\/(\w+:)?Attribute>)/m) + end + + # Decrypt an element + # @param encryptedid_node [REXML::Element] The encrypted element + # @param rgrex string Regex + # @return [REXML::Document] The decrypted element + # + def decrypt_element(encrypt_node, rgrex) + if settings.nil? || !settings.get_sp_key + raise ValidationError.new('An ' + encrypt_node.name + ' found and no SP private key found on the settings to decrypt it') + end + + + if encrypt_node.name == 'EncryptedAttribute' + node_header = '' + else + node_header = '' + end + + elem_plaintext = OneLogin::RubySaml::Utils.decrypt_data(encrypt_node, settings.get_sp_key) + # If we get some problematic noise in the plaintext after decrypting. + # This quick regexp parse will grab only the Element and discard the noise. + elem_plaintext = elem_plaintext.match(rgrex)[0] + + # To avoid namespace errors if saml namespace is not defined + # create a parent node first with the namespace defined + elem_plaintext = node_header + elem_plaintext + '' + doc = REXML::Document.new(elem_plaintext) + doc.root[0] + end + + # Parse the attribute of a given node in Time format + # @param node [REXML:Element] The node + # @param attribute [String] The attribute name + # @return [Time|nil] The parsed value + # + def parse_time(node, attribute) + if node && node.attributes[attribute] + Time.parse(node.attributes[attribute]) + end + end + end + end +end diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/saml_message.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/saml_message.rb new file mode 100644 index 0000000..d09f55e --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/saml_message.rb @@ -0,0 +1,161 @@ +require 'cgi' +require 'zlib' +require 'base64' +require 'nokogiri' +require 'rexml/document' +require 'rexml/xpath' +require 'thread' +require "onelogin/ruby-saml/error_handling" + +# Only supports SAML 2.0 +module OneLogin + module RubySaml + + # SAML2 Message + # + class SamlMessage + include REXML + + ASSERTION = "urn:oasis:names:tc:SAML:2.0:assertion".freeze + PROTOCOL = "urn:oasis:names:tc:SAML:2.0:protocol".freeze + + BASE64_FORMAT = %r(\A([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?\Z) + @@mutex = Mutex.new + + # @return [Nokogiri::XML::Schema] Gets the schema object of the SAML 2.0 Protocol schema + # + def self.schema + @@mutex.synchronize do + Dir.chdir(File.expand_path("../../../schemas", __FILE__)) do + ::Nokogiri::XML::Schema(File.read("saml-schema-protocol-2.0.xsd")) + end + end + end + + # @return [String|nil] Gets the Version attribute from the SAML Message if exists. + # + def version(document) + @version ||= begin + node = REXML::XPath.first( + document, + "/p:AuthnRequest | /p:Response | /p:LogoutResponse | /p:LogoutRequest", + { "p" => PROTOCOL } + ) + node.nil? ? nil : node.attributes['Version'] + end + end + + # @return [String|nil] Gets the ID attribute from the SAML Message if exists. + # + def id(document) + @id ||= begin + node = REXML::XPath.first( + document, + "/p:AuthnRequest | /p:Response | /p:LogoutResponse | /p:LogoutRequest", + { "p" => PROTOCOL } + ) + node.nil? ? nil : node.attributes['ID'] + end + end + + # Validates the SAML Message against the specified schema. + # @param document [REXML::Document] The message that will be validated + # @param soft [Boolean] soft Enable or Disable the soft mode (In order to raise exceptions when the message is invalid or not) + # @return [Boolean] True if the XML is valid, otherwise False, if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def valid_saml?(document, soft = true) + begin + xml = Nokogiri::XML(document.to_s) do |config| + config.options = XMLSecurity::BaseDocument::NOKOGIRI_OPTIONS + end + rescue Exception => error + return false if soft + raise ValidationError.new("XML load failed: #{error.message}") + end + + SamlMessage.schema.validate(xml).map do |schema_error| + return false if soft + raise ValidationError.new("#{schema_error.message}\n\n#{xml.to_s}") + end + end + + private + + # Base64 decode and try also to inflate a SAML Message + # @param saml [String] The deflated and encoded SAML Message + # @return [String] The plain SAML Message + # + def decode_raw_saml(saml, settings = nil) + return saml unless base64_encoded?(saml) + + settings = OneLogin::RubySaml::Settings.new if settings.nil? + if saml.bytesize > settings.message_max_bytesize + raise ValidationError.new("Encoded SAML Message exceeds " + settings.message_max_bytesize.to_s + " bytes, so was rejected") + end + + decoded = decode(saml) + begin + inflate(decoded) + rescue + decoded + end + end + + # Deflate, base64 encode and url-encode a SAML Message (To be used in the HTTP-redirect binding) + # @param saml [String] The plain SAML Message + # @param settings [OneLogin::RubySaml::Settings|nil] Toolkit settings + # @return [String] The deflated and encoded SAML Message (encoded if the compression is requested) + # + def encode_raw_saml(saml, settings) + saml = deflate(saml) if settings.compress_request + + CGI.escape(encode(saml)) + end + + # Base 64 decode method + # @param string [String] The string message + # @return [String] The decoded string + # + def decode(string) + Base64.decode64(string) + end + + # Base 64 encode method + # @param string [String] The string + # @return [String] The encoded string + # + def encode(string) + if Base64.respond_to?('strict_encode64') + Base64.strict_encode64(string) + else + Base64.encode64(string).gsub(/\n/, "") + end + end + + # Check if a string is base64 encoded + # @param string [String] string to check the encoding of + # @return [true, false] whether or not the string is base64 encoded + # + def base64_encoded?(string) + !!string.gsub(/[\r\n]|\\r|\\n|\s/, "").match(BASE64_FORMAT) + end + + # Inflate method + # @param deflated [String] The string + # @return [String] The inflated string + # + def inflate(deflated) + Zlib::Inflate.new(-Zlib::MAX_WBITS).inflate(deflated) + end + + # Deflate method + # @param inflated [String] The string + # @return [String] The deflated string + # + def deflate(inflated) + Zlib::Deflate.deflate(inflated, 9)[2..-5] + end + end + end +end diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/setting_error.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/setting_error.rb new file mode 100644 index 0000000..847766b --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/setting_error.rb @@ -0,0 +1,6 @@ +module OneLogin + module RubySaml + class SettingError < StandardError + end + end +end \ No newline at end of file diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/settings.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/settings.rb new file mode 100644 index 0000000..ba49821 --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/settings.rb @@ -0,0 +1,290 @@ +require "xml_security" +require "onelogin/ruby-saml/attribute_service" +require "onelogin/ruby-saml/utils" +require "onelogin/ruby-saml/validation_error" + +# Only supports SAML 2.0 +module OneLogin + module RubySaml + + # SAML2 Toolkit Settings + # + class Settings + def initialize(overrides = {}, keep_security_attributes = false) + if keep_security_attributes + security_attributes = overrides.delete(:security) || {} + config = DEFAULTS.merge(overrides) + config[:security] = DEFAULTS[:security].merge(security_attributes) + else + config = DEFAULTS.merge(overrides) + end + + config.each do |k,v| + acc = "#{k.to_s}=".to_sym + if respond_to? acc + value = v.is_a?(Hash) ? v.dup : v + send(acc, value) + end + end + @attribute_consuming_service = AttributeService.new + end + + # IdP Data + attr_accessor :idp_entity_id + attr_writer :idp_sso_service_url + attr_writer :idp_slo_service_url + attr_accessor :idp_slo_response_service_url + attr_accessor :idp_cert + attr_accessor :idp_cert_fingerprint + attr_accessor :idp_cert_fingerprint_algorithm + attr_accessor :idp_cert_multi + attr_accessor :idp_attribute_names + attr_accessor :idp_name_qualifier + attr_accessor :valid_until + # SP Data + attr_writer :sp_entity_id + attr_accessor :assertion_consumer_service_url + attr_reader :assertion_consumer_service_binding + attr_writer :single_logout_service_url + attr_accessor :sp_name_qualifier + attr_accessor :name_identifier_format + attr_accessor :name_identifier_value + attr_accessor :name_identifier_value_requested + attr_accessor :sessionindex + attr_accessor :compress_request + attr_accessor :compress_response + attr_accessor :double_quote_xml_attribute_values + attr_accessor :message_max_bytesize + attr_accessor :passive + attr_reader :protocol_binding + attr_accessor :attributes_index + attr_accessor :force_authn + attr_accessor :certificate + attr_accessor :certificate_new + attr_accessor :private_key + attr_accessor :authn_context + attr_accessor :authn_context_comparison + attr_accessor :authn_context_decl_ref + attr_reader :attribute_consuming_service + # Work-flow + attr_accessor :security + attr_accessor :soft + # Deprecated + attr_accessor :assertion_consumer_logout_service_url + attr_reader :assertion_consumer_logout_service_binding + attr_accessor :issuer + attr_accessor :idp_sso_target_url + attr_accessor :idp_slo_target_url + + # @return [String] IdP Single Sign On Service URL + # + def idp_sso_service_url + @idp_sso_service_url || @idp_sso_target_url + end + + # @return [String] IdP Single Logout Service URL + # + def idp_slo_service_url + @idp_slo_service_url || @idp_slo_target_url + end + + # @return [String] IdP Single Sign On Service Binding + # + def idp_sso_service_binding + @idp_sso_service_binding || idp_binding_from_embed_sign + end + + # Setter for IdP Single Sign On Service Binding + # @param value [String, Symbol]. + # + def idp_sso_service_binding=(value) + @idp_sso_service_binding = get_binding(value) + end + + # @return [String] IdP Single Logout Service Binding + # + def idp_slo_service_binding + @idp_slo_service_binding || idp_binding_from_embed_sign + end + + # Setter for IdP Single Logout Service Binding + # @param value [String, Symbol]. + # + def idp_slo_service_binding=(value) + @idp_slo_service_binding = get_binding(value) + end + + # @return [String] SP Entity ID + # + def sp_entity_id + @sp_entity_id || @issuer + end + + # Setter for SP Protocol Binding + # @param value [String, Symbol]. + # + def protocol_binding=(value) + @protocol_binding = get_binding(value) + end + + # Setter for SP Assertion Consumer Service Binding + # @param value [String, Symbol]. + # + def assertion_consumer_service_binding=(value) + @assertion_consumer_service_binding = get_binding(value) + end + + # @return [String] Single Logout Service URL. + # + def single_logout_service_url + @single_logout_service_url || @assertion_consumer_logout_service_url + end + + # @return [String] Single Logout Service Binding. + # + def single_logout_service_binding + @single_logout_service_binding || @assertion_consumer_logout_service_binding + end + + # Setter for Single Logout Service Binding. + # + # (Currently we only support "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect") + # @param value [String, Symbol] + # + def single_logout_service_binding=(value) + @single_logout_service_binding = get_binding(value) + end + + # @deprecated Setter for legacy Single Logout Service Binding parameter. + # + # (Currently we only support "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect") + # @param value [String, Symbol] + # + def assertion_consumer_logout_service_binding=(value) + @assertion_consumer_logout_service_binding = get_binding(value) + end + + # Calculates the fingerprint of the IdP x509 certificate. + # @return [String] The fingerprint + # + def get_fingerprint + idp_cert_fingerprint || begin + idp_cert = get_idp_cert + if idp_cert + fingerprint_alg = XMLSecurity::BaseDocument.new.algorithm(idp_cert_fingerprint_algorithm).new + fingerprint_alg.hexdigest(idp_cert.to_der).upcase.scan(/../).join(":") + end + end + end + + # @return [OpenSSL::X509::Certificate|nil] Build the IdP certificate from the settings (previously format it) + # + def get_idp_cert + return nil if idp_cert.nil? || idp_cert.empty? + + formatted_cert = OneLogin::RubySaml::Utils.format_cert(idp_cert) + OpenSSL::X509::Certificate.new(formatted_cert) + end + + # @return [Hash with 2 arrays of OpenSSL::X509::Certificate] Build multiple IdP certificates from the settings. + # + def get_idp_cert_multi + return nil if idp_cert_multi.nil? || idp_cert_multi.empty? + + raise ArgumentError.new("Invalid value for idp_cert_multi") if not idp_cert_multi.is_a?(Hash) + + certs = {:signing => [], :encryption => [] } + + if idp_cert_multi.key?(:signing) and not idp_cert_multi[:signing].empty? + idp_cert_multi[:signing].each do |idp_cert| + formatted_cert = OneLogin::RubySaml::Utils.format_cert(idp_cert) + certs[:signing].push(OpenSSL::X509::Certificate.new(formatted_cert)) + end + end + + if idp_cert_multi.key?(:encryption) and not idp_cert_multi[:encryption].empty? + idp_cert_multi[:encryption].each do |idp_cert| + formatted_cert = OneLogin::RubySaml::Utils.format_cert(idp_cert) + certs[:encryption].push(OpenSSL::X509::Certificate.new(formatted_cert)) + end + end + + certs + end + + # @return [OpenSSL::X509::Certificate|nil] Build the SP certificate from the settings (previously format it) + # + def get_sp_cert + return nil if certificate.nil? || certificate.empty? + + formatted_cert = OneLogin::RubySaml::Utils.format_cert(certificate) + cert = OpenSSL::X509::Certificate.new(formatted_cert) + + if security[:check_sp_cert_expiration] + if OneLogin::RubySaml::Utils.is_cert_expired(cert) + raise OneLogin::RubySaml::ValidationError.new("The SP certificate expired.") + end + end + + cert + end + + # @return [OpenSSL::X509::Certificate|nil] Build the New SP certificate from the settings (previously format it) + # + def get_sp_cert_new + return nil if certificate_new.nil? || certificate_new.empty? + + formatted_cert = OneLogin::RubySaml::Utils.format_cert(certificate_new) + OpenSSL::X509::Certificate.new(formatted_cert) + end + + # @return [OpenSSL::PKey::RSA] Build the SP private from the settings (previously format it) + # + def get_sp_key + return nil if private_key.nil? || private_key.empty? + + formatted_private_key = OneLogin::RubySaml::Utils.format_private_key(private_key) + OpenSSL::PKey::RSA.new(formatted_private_key) + end + + private + + def idp_binding_from_embed_sign + security[:embed_sign] ? Utils::BINDINGS[:post] : Utils::BINDINGS[:redirect] + end + + def get_binding(value) + return unless value + + Utils::BINDINGS[value.to_sym] || value + end + + DEFAULTS = { + :assertion_consumer_service_binding => Utils::BINDINGS[:post], + :single_logout_service_binding => Utils::BINDINGS[:redirect], + :idp_cert_fingerprint_algorithm => XMLSecurity::Document::SHA1, + :compress_request => true, + :compress_response => true, + :message_max_bytesize => 250000, + :soft => true, + :double_quote_xml_attribute_values => false, + :security => { + :authn_requests_signed => false, + :logout_requests_signed => false, + :logout_responses_signed => false, + :want_assertions_signed => false, + :want_assertions_encrypted => false, + :want_name_id => false, + :metadata_signed => false, + :embed_sign => false, # Deprecated + :digest_method => XMLSecurity::Document::SHA1, + :signature_method => XMLSecurity::Document::RSA_SHA1, + :check_idp_cert_expiration => false, + :check_sp_cert_expiration => false, + :strict_audience_validation => false, + :lowercase_url_encoding => false + }.freeze + }.freeze + end + end +end diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/slo_logoutrequest.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/slo_logoutrequest.rb new file mode 100644 index 0000000..7bd1aa0 --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/slo_logoutrequest.rb @@ -0,0 +1,316 @@ +require 'zlib' +require 'time' +require 'nokogiri' + +require "onelogin/ruby-saml/saml_message" + +# Only supports SAML 2.0 +module OneLogin + module RubySaml + + # SAML2 Logout Request (SLO IdP initiated, Parser) + # + class SloLogoutrequest < SamlMessage + include ErrorHandling + + # OneLogin::RubySaml::Settings Toolkit settings + attr_accessor :settings + + attr_reader :document + attr_reader :request + attr_reader :options + + attr_accessor :soft + + # Constructs the Logout Request. A Logout Request Object that is an extension of the SamlMessage class. + # @param request [String] A UUEncoded Logout Request from the IdP. + # @param options [Hash] :settings to provide the OneLogin::RubySaml::Settings object + # Or :allowed_clock_drift for the logout request validation process to allow a clock drift when checking dates with + # Or :relax_signature_validation to accept signatures if no idp certificate registered on settings + # + # @raise [ArgumentError] If Request is nil + # + def initialize(request, options = {}) + raise ArgumentError.new("Request cannot be nil") if request.nil? + + @errors = [] + @options = options + @soft = true + unless options[:settings].nil? + @settings = options[:settings] + unless @settings.soft.nil? + @soft = @settings.soft + end + end + + @request = decode_raw_saml(request, settings) + @document = REXML::Document.new(@request) + end + + def request_id + id(document) + end + + # Validates the Logout Request with the default values (soft = true) + # @param collect_errors [Boolean] Stop validation when first error appears or keep validating. + # @return [Boolean] TRUE if the Logout Request is valid + # + def is_valid?(collect_errors = false) + validate(collect_errors) + end + + # @return [String] Gets the NameID of the Logout Request. + # + def name_id + @name_id ||= begin + node = REXML::XPath.first(document, "/p:LogoutRequest/a:NameID", { "p" => PROTOCOL, "a" => ASSERTION }) + Utils.element_text(node) + end + end + + alias_method :nameid, :name_id + + # @return [String] Gets the NameID Format of the Logout Request. + # + def name_id_format + @name_id_node ||= REXML::XPath.first(document, "/p:LogoutRequest/a:NameID", { "p" => PROTOCOL, "a" => ASSERTION }) + @name_id_format ||= + if @name_id_node && @name_id_node.attribute("Format") + @name_id_node.attribute("Format").value + end + end + + alias_method :nameid_format, :name_id_format + + # @return [String|nil] Gets the ID attribute from the Logout Request. if exists. + # + def id + super(document) + end + + # @return [String] Gets the Issuer from the Logout Request. + # + def issuer + @issuer ||= begin + node = REXML::XPath.first( + document, + "/p:LogoutRequest/a:Issuer", + { "p" => PROTOCOL, "a" => ASSERTION } + ) + Utils.element_text(node) + end + end + + # @return [Time|nil] Gets the NotOnOrAfter Attribute value if exists. + # + def not_on_or_after + @not_on_or_after ||= begin + node = REXML::XPath.first( + document, + "/p:LogoutRequest", + { "p" => PROTOCOL } + ) + if node && node.attributes["NotOnOrAfter"] + Time.parse(node.attributes["NotOnOrAfter"]) + end + end + end + + # @return [Array] Gets the SessionIndex if exists (Supported multiple values). Empty Array if none found + # + def session_indexes + nodes = REXML::XPath.match( + document, + "/p:LogoutRequest/p:SessionIndex", + { "p" => PROTOCOL } + ) + + nodes.map { |node| Utils.element_text(node) } + end + + private + + # returns the allowed clock drift on timing validation + # @return [Float] + def allowed_clock_drift + options[:allowed_clock_drift].to_f.abs + Float::EPSILON + end + + # Hard aux function to validate the Logout Request + # @param collect_errors [Boolean] Stop validation when first error appears or keep validating. (if soft=true) + # @return [Boolean] TRUE if the Logout Request is valid + # @raise [ValidationError] if soft == false and validation fails + # + def validate(collect_errors = false) + reset_errors! + + validations = [ + :validate_request_state, + :validate_id, + :validate_version, + :validate_structure, + :validate_not_on_or_after, + :validate_issuer, + :validate_signature + ] + + if collect_errors + validations.each { |validation| send(validation) } + @errors.empty? + else + validations.all? { |validation| send(validation) } + end + end + + # Validates that the Logout Request contains an ID + # If fails, the error is added to the errors array. + # @return [Boolean] True if the Logout Request contains an ID, otherwise returns False + # + def validate_id + unless id + return append_error("Missing ID attribute on Logout Request") + end + + true + end + + # Validates the SAML version (2.0) + # If fails, the error is added to the errors array. + # @return [Boolean] True if the Logout Request is 2.0, otherwise returns False + # + def validate_version + unless version(document) == "2.0" + return append_error("Unsupported SAML version") + end + + true + end + + # Validates the time. (If the logout request was initialized with the :allowed_clock_drift + # option, the timing validations are relaxed by the allowed_clock_drift value) + # If fails, the error is added to the errors array + # @return [Boolean] True if satisfies the conditions, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def validate_not_on_or_after + now = Time.now.utc + + if not_on_or_after && now >= (not_on_or_after + allowed_clock_drift) + return append_error("Current time is on or after NotOnOrAfter (#{now} >= #{not_on_or_after}#{" + #{allowed_clock_drift.ceil}s" if allowed_clock_drift > 0})") + end + + true + end + + # Validates the Logout Request against the specified schema. + # @return [Boolean] True if the XML is valid, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def validate_structure + unless valid_saml?(document, soft) + return append_error("Invalid SAML Logout Request. Not match the saml-schema-protocol-2.0.xsd") + end + + true + end + + # Validates that the Logout Request provided in the initialization is not empty, + # @return [Boolean] True if the required info is found, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def validate_request_state + return append_error("Blank logout request") if request.nil? || request.empty? + + true + end + + # Validates the Issuer of the Logout Request + # If fails, the error is added to the errors array + # @return [Boolean] True if the Issuer matchs the IdP entityId, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def validate_issuer + return true if settings.nil? || settings.idp_entity_id.nil? || issuer.nil? + + unless OneLogin::RubySaml::Utils.uri_match?(issuer, settings.idp_entity_id) + return append_error("Doesn't match the issuer, expected: <#{settings.idp_entity_id}>, but was: <#{issuer}>") + end + + true + end + + # Validates the Signature if exists and GET parameters are provided + # @return [Boolean] True if not contains a Signature or if the Signature is valid, otherwise False if soft=True + # @raise [ValidationError] if soft == false and validation fails + # + def validate_signature + return true if options.nil? + return true unless options.has_key? :get_params + return true unless options[:get_params].has_key? 'Signature' + + options[:raw_get_params] = OneLogin::RubySaml::Utils.prepare_raw_get_params(options[:raw_get_params], options[:get_params], settings.security[:lowercase_url_encoding]) + + if options[:get_params]['SigAlg'].nil? && !options[:raw_get_params]['SigAlg'].nil? + options[:get_params]['SigAlg'] = CGI.unescape(options[:raw_get_params]['SigAlg']) + end + + idp_cert = settings.get_idp_cert + idp_certs = settings.get_idp_cert_multi + + if idp_cert.nil? && (idp_certs.nil? || idp_certs[:signing].empty?) + return options.has_key? :relax_signature_validation + end + + query_string = OneLogin::RubySaml::Utils.build_query_from_raw_parts( + :type => 'SAMLRequest', + :raw_data => options[:raw_get_params]['SAMLRequest'], + :raw_relay_state => options[:raw_get_params]['RelayState'], + :raw_sig_alg => options[:raw_get_params]['SigAlg'] + ) + + expired = false + if idp_certs.nil? || idp_certs[:signing].empty? + valid = OneLogin::RubySaml::Utils.verify_signature( + :cert => idp_cert, + :sig_alg => options[:get_params]['SigAlg'], + :signature => options[:get_params]['Signature'], + :query_string => query_string + ) + if valid && settings.security[:check_idp_cert_expiration] + if OneLogin::RubySaml::Utils.is_cert_expired(idp_cert) + expired = true + end + end + else + valid = false + idp_certs[:signing].each do |signing_idp_cert| + valid = OneLogin::RubySaml::Utils.verify_signature( + :cert => signing_idp_cert, + :sig_alg => options[:get_params]['SigAlg'], + :signature => options[:get_params]['Signature'], + :query_string => query_string + ) + if valid + if settings.security[:check_idp_cert_expiration] + if OneLogin::RubySaml::Utils.is_cert_expired(signing_idp_cert) + expired = true + end + end + break + end + end + end + + if expired + error_msg = "IdP x509 certificate expired" + return append_error(error_msg) + end + unless valid + return append_error("Invalid Signature on Logout Request") + end + + true + end + end + end +end diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/slo_logoutresponse.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/slo_logoutresponse.rb new file mode 100644 index 0000000..838c1ca --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/slo_logoutresponse.rb @@ -0,0 +1,164 @@ +require "onelogin/ruby-saml/logging" + +require "onelogin/ruby-saml/saml_message" +require "onelogin/ruby-saml/utils" +require "onelogin/ruby-saml/setting_error" + +# Only supports SAML 2.0 +module OneLogin + module RubySaml + + # SAML2 Logout Response (SLO SP initiated, Parser) + # + class SloLogoutresponse < SamlMessage + + # Logout Response ID + attr_accessor :uuid + + # Initializes the Logout Response. A SloLogoutresponse Object that is an extension of the SamlMessage class. + # Asigns an ID, a random uuid. + # + def initialize + @uuid = OneLogin::RubySaml::Utils.uuid + end + + def response_id + @uuid + end + + # Creates the Logout Response string. + # @param settings [OneLogin::RubySaml::Settings|nil] Toolkit settings + # @param request_id [String] The ID of the LogoutRequest sent by this SP to the IdP. That ID will be placed as the InResponseTo in the logout response + # @param logout_message [String] The Message to be placed as StatusMessage in the logout response + # @param params [Hash] Some extra parameters to be added in the GET for example the RelayState + # @param logout_status_code [String] The StatusCode to be placed as StatusMessage in the logout response + # @return [String] Logout Request string that includes the SAMLRequest + # + def create(settings, request_id = nil, logout_message = nil, params = {}, logout_status_code = nil) + params = create_params(settings, request_id, logout_message, params, logout_status_code) + params_prefix = (settings.idp_slo_service_url =~ /\?/) ? '&' : '?' + url = settings.idp_slo_response_service_url || settings.idp_slo_service_url + saml_response = CGI.escape(params.delete("SAMLResponse")) + response_params = "#{params_prefix}SAMLResponse=#{saml_response}" + params.each_pair do |key, value| + response_params << "&#{key.to_s}=#{CGI.escape(value.to_s)}" + end + + raise SettingError.new "Invalid settings, idp_slo_service_url is not set!" if url.nil? or url.empty? + @logout_url = url + response_params + end + + # Creates the Get parameters for the logout response. + # @param settings [OneLogin::RubySaml::Settings|nil] Toolkit settings + # @param request_id [String] The ID of the LogoutRequest sent by this SP to the IdP. That ID will be placed as the InResponseTo in the logout response + # @param logout_message [String] The Message to be placed as StatusMessage in the logout response + # @param params [Hash] Some extra parameters to be added in the GET for example the RelayState + # @param logout_status_code [String] The StatusCode to be placed as StatusMessage in the logout response + # @return [Hash] Parameters + # + def create_params(settings, request_id = nil, logout_message = nil, params = {}, logout_status_code = nil) + # The method expects :RelayState but sometimes we get 'RelayState' instead. + # Based on the HashWithIndifferentAccess value in Rails we could experience + # conflicts so this line will solve them. + relay_state = params[:RelayState] || params['RelayState'] + + if relay_state.nil? + params.delete(:RelayState) + params.delete('RelayState') + end + + response_doc = create_logout_response_xml_doc(settings, request_id, logout_message, logout_status_code) + response_doc.context[:attribute_quote] = :quote if settings.double_quote_xml_attribute_values + + response = "" + response_doc.write(response) + + Logging.debug "Created SLO Logout Response: #{response}" + + response = deflate(response) if settings.compress_response + base64_response = encode(response) + response_params = {"SAMLResponse" => base64_response} + + if settings.idp_slo_service_binding == Utils::BINDINGS[:redirect] && settings.security[:logout_responses_signed] && settings.private_key + params['SigAlg'] = settings.security[:signature_method] + url_string = OneLogin::RubySaml::Utils.build_query( + :type => 'SAMLResponse', + :data => base64_response, + :relay_state => relay_state, + :sig_alg => params['SigAlg'] + ) + sign_algorithm = XMLSecurity::BaseDocument.new.algorithm(settings.security[:signature_method]) + signature = settings.get_sp_key.sign(sign_algorithm.new, url_string) + params['Signature'] = encode(signature) + end + + params.each_pair do |key, value| + response_params[key] = value.to_s + end + + response_params + end + + # Creates the SAMLResponse String. + # @param settings [OneLogin::RubySaml::Settings|nil] Toolkit settings + # @param request_id [String] The ID of the LogoutRequest sent by this SP to the IdP. That ID will be placed as the InResponseTo in the logout response + # @param logout_message [String] The Message to be placed as StatusMessage in the logout response + # @param logout_status_code [String] The StatusCode to be placed as StatusMessage in the logout response + # @return [String] The SAMLResponse String. + # + def create_logout_response_xml_doc(settings, request_id = nil, logout_message = nil, logout_status_code = nil) + document = create_xml_document(settings, request_id, logout_message, logout_status_code) + sign_document(document, settings) + end + + def create_xml_document(settings, request_id = nil, logout_message = nil, status_code = nil) + time = Time.now.utc.strftime('%Y-%m-%dT%H:%M:%SZ') + + response_doc = XMLSecurity::Document.new + response_doc.uuid = uuid + + destination = settings.idp_slo_response_service_url || settings.idp_slo_service_url + + + root = response_doc.add_element 'samlp:LogoutResponse', { 'xmlns:samlp' => 'urn:oasis:names:tc:SAML:2.0:protocol', "xmlns:saml" => "urn:oasis:names:tc:SAML:2.0:assertion" } + root.attributes['ID'] = uuid + root.attributes['IssueInstant'] = time + root.attributes['Version'] = '2.0' + root.attributes['InResponseTo'] = request_id unless request_id.nil? + root.attributes['Destination'] = destination unless destination.nil? or destination.empty? + + if settings.sp_entity_id != nil + issuer = root.add_element "saml:Issuer" + issuer.text = settings.sp_entity_id + end + + # add status + status = root.add_element 'samlp:Status' + + # status code + status_code ||= 'urn:oasis:names:tc:SAML:2.0:status:Success' + status_code_elem = status.add_element 'samlp:StatusCode' + status_code_elem.attributes['Value'] = status_code + + # status message + logout_message ||= 'Successfully Signed Out' + status_message = status.add_element 'samlp:StatusMessage' + status_message.text = logout_message + + response_doc + end + + def sign_document(document, settings) + # embed signature + if settings.idp_slo_service_binding == Utils::BINDINGS[:post] && settings.private_key && settings.certificate + private_key = settings.get_sp_key + cert = settings.get_sp_cert + document.sign_document(private_key, cert, settings.security[:signature_method], settings.security[:digest_method]) + end + + document + end + + end + end +end diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/utils.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/utils.rb new file mode 100644 index 0000000..3a5915b --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/utils.rb @@ -0,0 +1,389 @@ +if RUBY_VERSION < '1.9' + require 'uuid' +else + require 'securerandom' +end +require "openssl" + +module OneLogin + module RubySaml + + # SAML2 Auxiliary class + # + class Utils + @@uuid_generator = UUID.new if RUBY_VERSION < '1.9' + + BINDINGS = { :post => "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST".freeze, + :redirect => "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect".freeze }.freeze + DSIG = "http://www.w3.org/2000/09/xmldsig#".freeze + XENC = "http://www.w3.org/2001/04/xmlenc#".freeze + DURATION_FORMAT = %r(^ + (-?)P # 1: Duration sign + (?: + (?:(\d+)Y)? # 2: Years + (?:(\d+)M)? # 3: Months + (?:(\d+)D)? # 4: Days + (?:T + (?:(\d+)H)? # 5: Hours + (?:(\d+)M)? # 6: Minutes + (?:(\d+(?:[.,]\d+)?)S)? # 7: Seconds + )? + | + (\d+)W # 8: Weeks + ) + $)x.freeze + UUID_PREFIX = '_' + + # Checks if the x509 cert provided is expired + # + # @param cert [Certificate] The x509 certificate + # + def self.is_cert_expired(cert) + if cert.is_a?(String) + cert = OpenSSL::X509::Certificate.new(cert) + end + + return cert.not_after < Time.now + end + + # Interprets a ISO8601 duration value relative to a given timestamp. + # + # @param duration [String] The duration, as a string. + # @param timestamp [Integer] The unix timestamp we should apply the + # duration to. Optional, default to the + # current time. + # + # @return [Integer] The new timestamp, after the duration is applied. + # + def self.parse_duration(duration, timestamp=Time.now.utc) + return nil if RUBY_VERSION < '1.9' # 1.8.7 not supported + + matches = duration.match(DURATION_FORMAT) + + if matches.nil? + raise Exception.new("Invalid ISO 8601 duration") + end + + sign = matches[1] == '-' ? -1 : 1 + + durYears, durMonths, durDays, durHours, durMinutes, durSeconds, durWeeks = + matches[2..8].map { |match| match ? sign * match.tr(',', '.').to_f : 0.0 } + + initial_datetime = Time.at(timestamp).utc.to_datetime + final_datetime = initial_datetime.next_year(durYears) + final_datetime = final_datetime.next_month(durMonths) + final_datetime = final_datetime.next_day((7*durWeeks) + durDays) + final_timestamp = final_datetime.to_time.utc.to_i + (durHours * 3600) + (durMinutes * 60) + durSeconds + return final_timestamp + end + + # Return a properly formatted x509 certificate + # + # @param cert [String] The original certificate + # @return [String] The formatted certificate + # + def self.format_cert(cert) + # don't try to format an encoded certificate or if is empty or nil + if cert.respond_to?(:ascii_only?) + return cert if cert.nil? || cert.empty? || !cert.ascii_only? + else + return cert if cert.nil? || cert.empty? || cert.match(/\x0d/) + end + + if cert.scan(/BEGIN CERTIFICATE/).length > 1 + formatted_cert = [] + cert.scan(/-{5}BEGIN CERTIFICATE-{5}[\n\r]?.*?-{5}END CERTIFICATE-{5}[\n\r]?/m) {|c| + formatted_cert << format_cert(c) + } + formatted_cert.join("\n") + else + cert = cert.gsub(/\-{5}\s?(BEGIN|END) CERTIFICATE\s?\-{5}/, "") + cert = cert.gsub(/\r/, "") + cert = cert.gsub(/\n/, "") + cert = cert.gsub(/\s/, "") + cert = cert.scan(/.{1,64}/) + cert = cert.join("\n") + "-----BEGIN CERTIFICATE-----\n#{cert}\n-----END CERTIFICATE-----" + end + end + + # Return a properly formatted private key + # + # @param key [String] The original private key + # @return [String] The formatted private key + # + def self.format_private_key(key) + # don't try to format an encoded private key or if is empty + return key if key.nil? || key.empty? || key.match(/\x0d/) + + # is this an rsa key? + rsa_key = key.match("RSA PRIVATE KEY") + key = key.gsub(/\-{5}\s?(BEGIN|END)( RSA)? PRIVATE KEY\s?\-{5}/, "") + key = key.gsub(/\n/, "") + key = key.gsub(/\r/, "") + key = key.gsub(/\s/, "") + key = key.scan(/.{1,64}/) + key = key.join("\n") + key_label = rsa_key ? "RSA PRIVATE KEY" : "PRIVATE KEY" + "-----BEGIN #{key_label}-----\n#{key}\n-----END #{key_label}-----" + end + + # Build the Query String signature that will be used in the HTTP-Redirect binding + # to generate the Signature + # @param params [Hash] Parameters to build the Query String + # @option params [String] :type 'SAMLRequest' or 'SAMLResponse' + # @option params [String] :data Base64 encoded SAMLRequest or SAMLResponse + # @option params [String] :relay_state The RelayState parameter + # @option params [String] :sig_alg The SigAlg parameter + # @return [String] The Query String + # + def self.build_query(params) + type, data, relay_state, sig_alg = [:type, :data, :relay_state, :sig_alg].map { |k| params[k]} + + url_string = "#{type}=#{CGI.escape(data)}" + url_string << "&RelayState=#{CGI.escape(relay_state)}" if relay_state + url_string << "&SigAlg=#{CGI.escape(sig_alg)}" + end + + # Reconstruct a canonical query string from raw URI-encoded parts, to be used in verifying a signature + # + # @param params [Hash] Parameters to build the Query String + # @option params [String] :type 'SAMLRequest' or 'SAMLResponse' + # @option params [String] :raw_data URI-encoded, base64 encoded SAMLRequest or SAMLResponse, as sent by IDP + # @option params [String] :raw_relay_state URI-encoded RelayState parameter, as sent by IDP + # @option params [String] :raw_sig_alg URI-encoded SigAlg parameter, as sent by IDP + # @return [String] The Query String + # + def self.build_query_from_raw_parts(params) + type, raw_data, raw_relay_state, raw_sig_alg = [:type, :raw_data, :raw_relay_state, :raw_sig_alg].map { |k| params[k]} + + url_string = "#{type}=#{raw_data}" + url_string << "&RelayState=#{raw_relay_state}" if raw_relay_state + url_string << "&SigAlg=#{raw_sig_alg}" + end + + # Prepare raw GET parameters (build them from normal parameters + # if not provided). + # + # @param rawparams [Hash] Raw GET Parameters + # @param params [Hash] GET Parameters + # @param lowercase_url_encoding [bool] Lowercase URL Encoding (For ADFS urlencode compatiblity) + # @return [Hash] New raw parameters + # + def self.prepare_raw_get_params(rawparams, params, lowercase_url_encoding=false) + rawparams ||= {} + + if rawparams['SAMLRequest'].nil? && !params['SAMLRequest'].nil? + rawparams['SAMLRequest'] = escape_request_param(params['SAMLRequest'], lowercase_url_encoding) + end + if rawparams['SAMLResponse'].nil? && !params['SAMLResponse'].nil? + rawparams['SAMLResponse'] = escape_request_param(params['SAMLResponse'], lowercase_url_encoding) + end + if rawparams['RelayState'].nil? && !params['RelayState'].nil? + rawparams['RelayState'] = escape_request_param(params['RelayState'], lowercase_url_encoding) + end + if rawparams['SigAlg'].nil? && !params['SigAlg'].nil? + rawparams['SigAlg'] = escape_request_param(params['SigAlg'], lowercase_url_encoding) + end + + rawparams + end + + def self.escape_request_param(param, lowercase_url_encoding) + CGI.escape(param).tap do |escaped| + next unless lowercase_url_encoding + + escaped.gsub!(/%[A-Fa-f0-9]{2}/) { |match| match.downcase } + end + end + + # Validate the Signature parameter sent on the HTTP-Redirect binding + # @param params [Hash] Parameters to be used in the validation process + # @option params [OpenSSL::X509::Certificate] cert The Identity provider public certtificate + # @option params [String] sig_alg The SigAlg parameter + # @option params [String] signature The Signature parameter (base64 encoded) + # @option params [String] query_string The full GET Query String to be compared + # @return [Boolean] True if the Signature is valid, False otherwise + # + def self.verify_signature(params) + cert, sig_alg, signature, query_string = [:cert, :sig_alg, :signature, :query_string].map { |k| params[k]} + signature_algorithm = XMLSecurity::BaseDocument.new.algorithm(sig_alg) + return cert.public_key.verify(signature_algorithm.new, Base64.decode64(signature), query_string) + end + + # Build the status error message + # @param status_code [String] StatusCode value + # @param status_message [Strig] StatusMessage value + # @return [String] The status error message + def self.status_error_msg(error_msg, raw_status_code = nil, status_message = nil) + unless raw_status_code.nil? + if raw_status_code.include? "|" + status_codes = raw_status_code.split(' | ') + values = status_codes.collect do |status_code| + status_code.split(':').last + end + printable_code = values.join(" => ") + else + printable_code = raw_status_code.split(':').last + end + error_msg << ', was ' + printable_code + end + + unless status_message.nil? + error_msg << ' -> ' + status_message + end + + error_msg + end + + # Obtains the decrypted string from an Encrypted node element in XML + # @param encrypted_node [REXML::Element] The Encrypted element + # @param private_key [OpenSSL::PKey::RSA] The Service provider private key + # @return [String] The decrypted data + def self.decrypt_data(encrypted_node, private_key) + encrypt_data = REXML::XPath.first( + encrypted_node, + "./xenc:EncryptedData", + { 'xenc' => XENC } + ) + symmetric_key = retrieve_symmetric_key(encrypt_data, private_key) + cipher_value = REXML::XPath.first( + encrypt_data, + "./xenc:CipherData/xenc:CipherValue", + { 'xenc' => XENC } + ) + node = Base64.decode64(element_text(cipher_value)) + encrypt_method = REXML::XPath.first( + encrypt_data, + "./xenc:EncryptionMethod", + { 'xenc' => XENC } + ) + algorithm = encrypt_method.attributes['Algorithm'] + retrieve_plaintext(node, symmetric_key, algorithm) + end + + # Obtains the symmetric key from the EncryptedData element + # @param encrypt_data [REXML::Element] The EncryptedData element + # @param private_key [OpenSSL::PKey::RSA] The Service provider private key + # @return [String] The symmetric key + def self.retrieve_symmetric_key(encrypt_data, private_key) + encrypted_key = REXML::XPath.first( + encrypt_data, + "./ds:KeyInfo/xenc:EncryptedKey | ./KeyInfo/xenc:EncryptedKey | //xenc:EncryptedKey[@Id=$id]", + { "ds" => DSIG, "xenc" => XENC }, + { "id" => self.retrieve_symetric_key_reference(encrypt_data) } + ) + + encrypted_symmetric_key_element = REXML::XPath.first( + encrypted_key, + "./xenc:CipherData/xenc:CipherValue", + "xenc" => XENC + ) + + cipher_text = Base64.decode64(element_text(encrypted_symmetric_key_element)) + + encrypt_method = REXML::XPath.first( + encrypted_key, + "./xenc:EncryptionMethod", + "xenc" => XENC + ) + + algorithm = encrypt_method.attributes['Algorithm'] + retrieve_plaintext(cipher_text, private_key, algorithm) + end + + def self.retrieve_symetric_key_reference(encrypt_data) + REXML::XPath.first( + encrypt_data, + "substring-after(./ds:KeyInfo/ds:RetrievalMethod/@URI, '#')", + { "ds" => DSIG } + ) + end + + # Obtains the deciphered text + # @param cipher_text [String] The ciphered text + # @param symmetric_key [String] The symetric key used to encrypt the text + # @param algorithm [String] The encrypted algorithm + # @return [String] The deciphered text + def self.retrieve_plaintext(cipher_text, symmetric_key, algorithm) + case algorithm + when 'http://www.w3.org/2001/04/xmlenc#tripledes-cbc' then cipher = OpenSSL::Cipher.new('DES-EDE3-CBC').decrypt + when 'http://www.w3.org/2001/04/xmlenc#aes128-cbc' then cipher = OpenSSL::Cipher.new('AES-128-CBC').decrypt + when 'http://www.w3.org/2001/04/xmlenc#aes192-cbc' then cipher = OpenSSL::Cipher.new('AES-192-CBC').decrypt + when 'http://www.w3.org/2001/04/xmlenc#aes256-cbc' then cipher = OpenSSL::Cipher.new('AES-256-CBC').decrypt + when 'http://www.w3.org/2009/xmlenc11#aes128-gcm' then auth_cipher = OpenSSL::Cipher::AES.new(128, :GCM).decrypt + when 'http://www.w3.org/2009/xmlenc11#aes192-gcm' then auth_cipher = OpenSSL::Cipher::AES.new(192, :GCM).decrypt + when 'http://www.w3.org/2009/xmlenc11#aes256-gcm' then auth_cipher = OpenSSL::Cipher::AES.new(256, :GCM).decrypt + when 'http://www.w3.org/2001/04/xmlenc#rsa-1_5' then rsa = symmetric_key + when 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p' then oaep = symmetric_key + end + + if cipher + iv_len = cipher.iv_len + data = cipher_text[iv_len..-1] + cipher.padding, cipher.key, cipher.iv = 0, symmetric_key, cipher_text[0..iv_len-1] + assertion_plaintext = cipher.update(data) + assertion_plaintext << cipher.final + elsif auth_cipher + iv_len, text_len, tag_len = auth_cipher.iv_len, cipher_text.length, 16 + data = cipher_text[iv_len..text_len-1-tag_len] + auth_cipher.padding = 0 + auth_cipher.key = symmetric_key + auth_cipher.iv = cipher_text[0..iv_len-1] + auth_cipher.auth_data = '' + auth_cipher.auth_tag = cipher_text[text_len-tag_len..-1] + assertion_plaintext = auth_cipher.update(data) + assertion_plaintext << auth_cipher.final + elsif rsa + rsa.private_decrypt(cipher_text) + elsif oaep + oaep.private_decrypt(cipher_text, OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING) + else + cipher_text + end + end + + def self.set_prefix(value) + UUID_PREFIX.replace value + end + + def self.uuid + "#{UUID_PREFIX}" + (RUBY_VERSION < '1.9' ? "#{@@uuid_generator.generate}" : "#{SecureRandom.uuid}") + end + + # Given two strings, attempt to match them as URIs using Rails' parse method. If they can be parsed, + # then the fully-qualified domain name and the host should performa a case-insensitive match, per the + # RFC for URIs. If Rails can not parse the string in to URL pieces, return a boolean match of the + # two strings. This maintains the previous functionality. + # @return [Boolean] + def self.uri_match?(destination_url, settings_url) + dest_uri = URI.parse(destination_url) + acs_uri = URI.parse(settings_url) + + if dest_uri.scheme.nil? || acs_uri.scheme.nil? || dest_uri.host.nil? || acs_uri.host.nil? + raise URI::InvalidURIError + else + dest_uri.scheme.downcase == acs_uri.scheme.downcase && + dest_uri.host.downcase == acs_uri.host.downcase && + dest_uri.path == acs_uri.path && + dest_uri.query == acs_uri.query + end + rescue URI::InvalidURIError + original_uri_match?(destination_url, settings_url) + end + + # If Rails' URI.parse can't match to valid URL, default back to the original matching service. + # @return [Boolean] + def self.original_uri_match?(destination_url, settings_url) + destination_url == settings_url + end + + # Given a REXML::Element instance, return the concatenation of all child text nodes. Assumes + # that there all children other than text nodes can be ignored (e.g. comments). If nil is + # passed, nil will be returned. + def self.element_text(element) + element.texts.map(&:value).join if element + end + end + end +end diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/validation_error.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/validation_error.rb new file mode 100644 index 0000000..0f777b8 --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/validation_error.rb @@ -0,0 +1,7 @@ +module OneLogin + module RubySaml + class ValidationError < StandardError + end + end +end + diff --git a/ruby-saml-custom/lib/onelogin/ruby-saml/version.rb b/ruby-saml-custom/lib/onelogin/ruby-saml/version.rb new file mode 100644 index 0000000..4ec6097 --- /dev/null +++ b/ruby-saml-custom/lib/onelogin/ruby-saml/version.rb @@ -0,0 +1,5 @@ +module OneLogin + module RubySaml + VERSION = '1.14.0' + end +end diff --git a/ruby-saml-custom/lib/ruby-saml-custom.rb b/ruby-saml-custom/lib/ruby-saml-custom.rb new file mode 100644 index 0000000..282e549 --- /dev/null +++ b/ruby-saml-custom/lib/ruby-saml-custom.rb @@ -0,0 +1 @@ +require 'onelogin/ruby-saml' diff --git a/ruby-saml-custom/lib/schemas/saml-schema-assertion-2.0.xsd b/ruby-saml-custom/lib/schemas/saml-schema-assertion-2.0.xsd new file mode 100644 index 0000000..2b2f7b8 --- /dev/null +++ b/ruby-saml-custom/lib/schemas/saml-schema-assertion-2.0.xsd @@ -0,0 +1,283 @@ + + + + + + + Document identifier: saml-schema-assertion-2.0 + Location: http://docs.oasis-open.org/security/saml/v2.0/ + Revision history: + V1.0 (November, 2002): + Initial Standard Schema. + V1.1 (September, 2003): + Updates within the same V1.0 namespace. + V2.0 (March, 2005): + New assertion schema for SAML V2.0 namespace. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ruby-saml-custom/lib/schemas/saml-schema-authn-context-2.0.xsd b/ruby-saml-custom/lib/schemas/saml-schema-authn-context-2.0.xsd new file mode 100644 index 0000000..e4754fa --- /dev/null +++ b/ruby-saml-custom/lib/schemas/saml-schema-authn-context-2.0.xsd @@ -0,0 +1,23 @@ + + + + + + Document identifier: saml-schema-authn-context-2.0 + Location: http://docs.oasis-open.org/security/saml/v2.0/ + Revision history: + V2.0 (March, 2005): + New core authentication context schema for SAML V2.0. + This is just an include of all types from the schema + referred to in the include statement below. + + + + + + \ No newline at end of file diff --git a/ruby-saml-custom/lib/schemas/saml-schema-authn-context-types-2.0.xsd b/ruby-saml-custom/lib/schemas/saml-schema-authn-context-types-2.0.xsd new file mode 100644 index 0000000..8513959 --- /dev/null +++ b/ruby-saml-custom/lib/schemas/saml-schema-authn-context-types-2.0.xsd @@ -0,0 +1,821 @@ + + + + + + Document identifier: saml-schema-authn-context-types-2.0 + Location: http://docs.oasis-open.org/security/saml/v2.0/ + Revision history: + V2.0 (March, 2005): + New core authentication context schema types for SAML V2.0. + + + + + + + A particular assertion on an identity + provider's part with respect to the authentication + context associated with an authentication assertion. + + + + + + + + Refers to those characteristics that describe the + processes and mechanisms + the Authentication Authority uses to initially create + an association between a Principal + and the identity (or name) by which the Principal will + be known + + + + + + + + This element indicates that identification has been + performed in a physical + face-to-face meeting with the principal and not in an + online manner. + + + + + + + + + + + + + + + + + + + + Refers to those characterstics that describe how the + 'secret' (the knowledge or possession + of which allows the Principal to authenticate to the + Authentication Authority) is kept secure + + + + + + + + This element indicates the types and strengths of + facilities + of a UA used to protect a shared secret key from + unauthorized access and/or use. + + + + + + + + This element indicates the types and strengths of + facilities + of a UA used to protect a private key from + unauthorized access and/or use. + + + + + + + The actions that must be performed + before the private key can be used. + + + + + + Whether or not the private key is shared + with the certificate authority. + + + + + + + In which medium is the key stored. + memory - the key is stored in memory. + smartcard - the key is stored in a smartcard. + token - the key is stored in a hardware token. + MobileDevice - the key is stored in a mobile device. + MobileAuthCard - the key is stored in a mobile + authentication card. + + + + + + + + + + + This element indicates that a password (or passphrase) + has been used to + authenticate the Principal to a remote system. + + + + + + + + This element indicates that a Pin (Personal + Identification Number) has been used to authenticate the Principal to + some local system in order to activate a key. + + + + + + + + This element indicates that a hardware or software + token is used + as a method of identifying the Principal. + + + + + + + + This element indicates that a time synchronization + token is used to identify the Principal. hardware - + the time synchonization + token has been implemented in hardware. software - the + time synchronization + token has been implemented in software. SeedLength - + the length, in bits, of the + random seed used in the time synchronization token. + + + + + + + + This element indicates that a smartcard is used to + identity the Principal. + + + + + + + + This element indicates the minimum and/or maximum + ASCII length of the password which is enforced (by the UA or the + IdP). In other words, this is the minimum and/or maximum number of + ASCII characters required to represent a valid password. + min - the minimum number of ASCII characters required + in a valid password, as enforced by the UA or the IdP. + max - the maximum number of ASCII characters required + in a valid password, as enforced by the UA or the IdP. + + + + + + + + This element indicates the length of time for which an + PIN-based authentication is valid. + + + + + + + + Indicates whether the password was chosen by the + Principal or auto-supplied by the Authentication Authority. + principalchosen - the Principal is allowed to choose + the value of the password. This is true even if + the initial password is chosen at random by the UA or + the IdP and the Principal is then free to change + the password. + automatic - the password is chosen by the UA or the + IdP to be cryptographically strong in some sense, + or to satisfy certain password rules, and that the + Principal is not free to change it or to choose a new password. + + + + + + + + + + + + + + + + + + + Refers to those characteristics that define the + mechanisms by which the Principal authenticates to the Authentication + Authority. + + + + + + + + The method that a Principal employs to perform + authentication to local system components. + + + + + + + + The method applied to validate a principal's + authentication across a network + + + + + + + + Supports Authenticators with nested combinations of + additional complexity. + + + + + + + + Indicates that the Principal has been strongly + authenticated in a previous session during which the IdP has set a + cookie in the UA. During the present session the Principal has only + been authenticated by the UA returning the cookie to the IdP. + + + + + + + + Rather like PreviousSession but using stronger + security. A secret that was established in a previous session with + the Authentication Authority has been cached by the local system and + is now re-used (e.g. a Master Secret is used to derive new session + keys in TLS, SSL, WTLS). + + + + + + + + This element indicates that the Principal has been + authenticated by a zero knowledge technique as specified in ISO/IEC + 9798-5. + + + + + + + + + + This element indicates that the Principal has been + authenticated by a challenge-response protocol utilizing shared secret + keys and symmetric cryptography. + + + + + + + + + + + + This element indicates that the Principal has been + authenticated by a mechanism which involves the Principal computing a + digital signature over at least challenge data provided by the IdP. + + + + + + + + The local system has a private key but it is used + in decryption mode, rather than signature mode. For example, the + Authentication Authority generates a secret and encrypts it using the + local system's public key: the local system then proves it has + decrypted the secret. + + + + + + + + The local system has a private key and uses it for + shared secret key agreement with the Authentication Authority (e.g. + via Diffie Helman). + + + + + + + + + + + + + + + This element indicates that the Principal has been + authenticated through connection from a particular IP address. + + + + + + + + The local system and Authentication Authority + share a secret key. The local system uses this to encrypt a + randomised string to pass to the Authentication Authority. + + + + + + + + The protocol across which Authenticator information is + transferred to an Authentication Authority verifier. + + + + + + + + This element indicates that the Authenticator has been + transmitted using bare HTTP utilizing no additional security + protocols. + + + + + + + + This element indicates that the Authenticator has been + transmitted using a transport mechanism protected by an IPSEC session. + + + + + + + + This element indicates that the Authenticator has been + transmitted using a transport mechanism protected by a WTLS session. + + + + + + + + This element indicates that the Authenticator has been + transmitted solely across a mobile network using no additional + security mechanism. + + + + + + + + + + + This element indicates that the Authenticator has been + transmitted using a transport mechnanism protected by an SSL or TLS + session. + + + + + + + + + + + + Refers to those characteristics that describe + procedural security controls employed by the Authentication Authority. + + + + + + + + + + + + Provides a mechanism for linking to external (likely + human readable) documents in which additional business agreements, + (e.g. liability constraints, obligations, etc) can be placed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This attribute indicates whether or not the + Identification mechanisms allow the actions of the Principal to be + linked to an actual end user. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element indicates that the Key Activation Limit is + defined as a specific duration of time. + + + + + + + + This element indicates that the Key Activation Limit is + defined as a number of usages. + + + + + + + + This element indicates that the Key Activation Limit is + the session. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ruby-saml-custom/lib/schemas/saml-schema-metadata-2.0.xsd b/ruby-saml-custom/lib/schemas/saml-schema-metadata-2.0.xsd new file mode 100644 index 0000000..b656d4f --- /dev/null +++ b/ruby-saml-custom/lib/schemas/saml-schema-metadata-2.0.xsd @@ -0,0 +1,337 @@ + + + + + + + + + Document identifier: saml-schema-metadata-2.0 + Location: http://docs.oasis-open.org/security/saml/v2.0/ + Revision history: + V2.0 (March, 2005): + Schema for SAML metadata, first published in SAML 2.0. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ruby-saml-custom/lib/schemas/saml-schema-protocol-2.0.xsd b/ruby-saml-custom/lib/schemas/saml-schema-protocol-2.0.xsd new file mode 100644 index 0000000..7fa6f48 --- /dev/null +++ b/ruby-saml-custom/lib/schemas/saml-schema-protocol-2.0.xsd @@ -0,0 +1,302 @@ + + + + + + + Document identifier: saml-schema-protocol-2.0 + Location: http://docs.oasis-open.org/security/saml/v2.0/ + Revision history: + V1.0 (November, 2002): + Initial Standard Schema. + V1.1 (September, 2003): + Updates within the same V1.0 namespace. + V2.0 (March, 2005): + New protocol schema based in a SAML V2.0 namespace. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ruby-saml-custom/lib/schemas/sstc-metadata-attr.xsd b/ruby-saml-custom/lib/schemas/sstc-metadata-attr.xsd new file mode 100644 index 0000000..f23e462 --- /dev/null +++ b/ruby-saml-custom/lib/schemas/sstc-metadata-attr.xsd @@ -0,0 +1,35 @@ + + + + + + Document title: SAML V2.0 Metadata Extention for Entity Attributes Schema + Document identifier: sstc-metadata-attr.xsd + Location: http://www.oasis-open.org/committees/documents.php?wg_abbrev=security + Revision history: + V1.0 (November 2008): + Initial version. + + + + + + + + + + + + + + + diff --git a/ruby-saml-custom/lib/schemas/sstc-saml-attribute-ext.xsd b/ruby-saml-custom/lib/schemas/sstc-saml-attribute-ext.xsd new file mode 100644 index 0000000..ad309c1 --- /dev/null +++ b/ruby-saml-custom/lib/schemas/sstc-saml-attribute-ext.xsd @@ -0,0 +1,25 @@ + + + + + + Document title: SAML V2.0 Attribute Extension Schema + Document identifier: sstc-saml-attribute-ext.xsd + Location: http://www.oasis-open.org/committees/documents.php?wg_abbrev=security + Revision history: + V1.0 (October 2008): + Initial version. + + + + + + + + diff --git a/ruby-saml-custom/lib/schemas/sstc-saml-metadata-algsupport-v1.0.xsd b/ruby-saml-custom/lib/schemas/sstc-saml-metadata-algsupport-v1.0.xsd new file mode 100644 index 0000000..3236ffc --- /dev/null +++ b/ruby-saml-custom/lib/schemas/sstc-saml-metadata-algsupport-v1.0.xsd @@ -0,0 +1,41 @@ + + + + + + Document title: Metadata Extension Schema for SAML V2.0 Metadata Profile for Algorithm Support Version 1.0 + Document identifier: sstc-saml-metadata-algsupport.xsd + Location: http://docs.oasis-open.org/security/saml/Post2.0/ + Revision history: + V1.0 (June 2010): + Initial version. + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ruby-saml-custom/lib/schemas/sstc-saml-metadata-ui-v1.0.xsd b/ruby-saml-custom/lib/schemas/sstc-saml-metadata-ui-v1.0.xsd new file mode 100644 index 0000000..a9f718e --- /dev/null +++ b/ruby-saml-custom/lib/schemas/sstc-saml-metadata-ui-v1.0.xsd @@ -0,0 +1,89 @@ + + + + + + Document title: Metadata Extension Schema for SAML V2.0 Metadata Extensions for Login and Discovery User Interface Version 1.0 + Document identifier: sstc-saml-metadata-ui-v1.0.xsd + Location: http://docs.oasis-open.org/security/saml/Post2.0/ + Revision history: + 16 November 2010: + Added Keywords element/type. + 01 November 2010 + Changed filename. + September 2010: + Initial version. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ruby-saml-custom/lib/schemas/xenc-schema.xsd b/ruby-saml-custom/lib/schemas/xenc-schema.xsd new file mode 100644 index 0000000..d6d7910 --- /dev/null +++ b/ruby-saml-custom/lib/schemas/xenc-schema.xsd @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ruby-saml-custom/lib/schemas/xml.xsd b/ruby-saml-custom/lib/schemas/xml.xsd new file mode 100644 index 0000000..aea7d0d --- /dev/null +++ b/ruby-saml-custom/lib/schemas/xml.xsd @@ -0,0 +1,287 @@ + + + + + + +
+

About the XML namespace

+ +
+

+ This schema document describes the XML namespace, in a form + suitable for import by other schema documents. +

+

+ See + http://www.w3.org/XML/1998/namespace.html and + + http://www.w3.org/TR/REC-xml for information + about this namespace. +

+

+ Note that local names in this namespace are intended to be + defined only by the World Wide Web Consortium or its subgroups. + The names currently defined in this namespace are listed below. + They should not be used with conflicting semantics by any Working + Group, specification, or document instance. +

+

+ See further below in this document for more information about how to refer to this schema document from your own + XSD schema documents and about the + namespace-versioning policy governing this schema document. +

+
+
+
+
+ + + + +
+ +

lang (as an attribute name)

+

+ denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification.

+ +
+
+

Notes

+

+ Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. +

+

+ See BCP 47 at + http://www.rfc-editor.org/rfc/bcp/bcp47.txt + and the IANA language subtag registry at + + http://www.iana.org/assignments/language-subtag-registry + for further information. +

+

+ The union allows for the 'un-declaration' of xml:lang with + the empty string. +

+
+
+
+ + + + + + + + + +
+ + + + +
+ +

space (as an attribute name)

+

+ denotes an attribute whose + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification.

+ +
+
+
+ + + + + + +
+ + + +
+ +

base (as an attribute name)

+

+ denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification.

+ +

+ See http://www.w3.org/TR/xmlbase/ + for information about this attribute. +

+
+
+
+
+ + + + +
+ +

id (as an attribute name)

+

+ denotes an attribute whose value + should be interpreted as if declared to be of type ID. + This name is reserved by virtue of its definition in the + xml:id specification.

+ +

+ See http://www.w3.org/TR/xml-id/ + for information about this attribute. +

+
+
+
+
+ + + + + + + + + + +
+ +

Father (in any context at all)

+ +
+

+ denotes Jon Bosak, the chair of + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: +

+
+

+ In appreciation for his vision, leadership and + dedication the W3C XML Plenary on this 10th day of + February, 2000, reserves for Jon Bosak in perpetuity + the XML name "xml:Father". +

+
+
+
+
+
+ + + +
+

About this schema document

+ +
+

+ This schema defines attributes and an attribute group suitable + for use by schemas wishing to allow xml:base, + xml:lang, xml:space or + xml:id attributes on elements they define. +

+

+ To enable this, such a schema must import this schema for + the XML namespace, e.g. as follows: +

+
+          <schema . . .>
+           . . .
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+     
+

+ or +

+
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
+     
+

+ Subsequently, qualified reference to any of the attributes or the + group defined below will have the desired effect, e.g. +

+
+          <type . . .>
+           . . .
+           <attributeGroup ref="xml:specialAttrs"/>
+     
+

+ will define a type which will schema-validate an instance element + with any of those attributes. +

+
+
+
+
+ + + +
+

Versioning policy for this schema document

+
+

+ In keeping with the XML Schema WG's standard versioning + policy, this schema document will persist at + + http://www.w3.org/2009/01/xml.xsd. +

+

+ At the date of issue it can also be found at + + http://www.w3.org/2001/xml.xsd. +

+

+ The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML + Schema itself, or with the XML namespace itself. In other words, + if the XML Schema or XML namespaces change, the version of this + document at + http://www.w3.org/2001/xml.xsd + + will change accordingly; the version at + + http://www.w3.org/2009/01/xml.xsd + + will not change. +

+

+ Previous dated (and unchanging) versions of this schema + document are at: +

+ +
+
+
+
+ +
+ diff --git a/ruby-saml-custom/lib/schemas/xmldsig-core-schema.xsd b/ruby-saml-custom/lib/schemas/xmldsig-core-schema.xsd new file mode 100644 index 0000000..63d7819 --- /dev/null +++ b/ruby-saml-custom/lib/schemas/xmldsig-core-schema.xsd @@ -0,0 +1,309 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ruby-saml-custom/lib/xml_security.rb b/ruby-saml-custom/lib/xml_security.rb new file mode 100644 index 0000000..3d9e662 --- /dev/null +++ b/ruby-saml-custom/lib/xml_security.rb @@ -0,0 +1,421 @@ +# The contents of this file are subject to the terms +# of the Common Development and Distribution License +# (the License). You may not use this file except in +# compliance with the License. +# +# You can obtain a copy of the License at +# https://opensso.dev.java.net/public/CDDLv1.0.html or +# opensso/legal/CDDLv1.0.txt +# See the License for the specific language governing +# permission and limitations under the License. +# +# When distributing Covered Code, include this CDDL +# Header Notice in each file and include the License file +# at opensso/legal/CDDLv1.0.txt. +# If applicable, add the following below the CDDL Header, +# with the fields enclosed by brackets [] replaced by +# your own identifying information: +# "Portions Copyrighted [year] [name of copyright owner]" +# +# $Id: xml_sec.rb,v 1.6 2007/10/24 00:28:41 todddd Exp $ +# +# Copyright 2007 Sun Microsystems Inc. All Rights Reserved +# Portions Copyrighted 2007 Todd W Saxton. + +require 'rubygems' +require "rexml/document" +require "rexml/xpath" +require "openssl" +require 'nokogiri' +require "digest/sha1" +require "digest/sha2" +require "onelogin/ruby-saml/utils" +require "onelogin/ruby-saml/error_handling" + +module XMLSecurity + + class BaseDocument < REXML::Document + REXML::Document::entity_expansion_limit = 0 + + C14N = "http://www.w3.org/2001/10/xml-exc-c14n#" + DSIG = "http://www.w3.org/2000/09/xmldsig#" + NOKOGIRI_OPTIONS = Nokogiri::XML::ParseOptions::STRICT | + Nokogiri::XML::ParseOptions::NONET + + def canon_algorithm(element) + algorithm = element + if algorithm.is_a?(REXML::Element) + algorithm = element.attribute('Algorithm').value + end + + case algorithm + when "http://www.w3.org/TR/2001/REC-xml-c14n-20010315", + "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" + Nokogiri::XML::XML_C14N_1_0 + when "http://www.w3.org/2006/12/xml-c14n11", + "http://www.w3.org/2006/12/xml-c14n11#WithComments" + Nokogiri::XML::XML_C14N_1_1 + else + Nokogiri::XML::XML_C14N_EXCLUSIVE_1_0 + end + end + + def algorithm(element) + algorithm = element + if algorithm.is_a?(REXML::Element) + algorithm = element.attribute("Algorithm").value + end + + algorithm = algorithm && algorithm =~ /(rsa-)?sha(.*?)$/i && $2.to_i + + case algorithm + when 256 then OpenSSL::Digest::SHA256 + when 384 then OpenSSL::Digest::SHA384 + when 512 then OpenSSL::Digest::SHA512 + else + OpenSSL::Digest::SHA1 + end + end + + end + + class Document < BaseDocument + RSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" + RSA_SHA256 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" + RSA_SHA384 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384" + RSA_SHA512 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512" + SHA1 = "http://www.w3.org/2000/09/xmldsig#sha1" + SHA256 = 'http://www.w3.org/2001/04/xmlenc#sha256' + SHA384 = "http://www.w3.org/2001/04/xmldsig-more#sha384" + SHA512 = 'http://www.w3.org/2001/04/xmlenc#sha512' + ENVELOPED_SIG = "http://www.w3.org/2000/09/xmldsig#enveloped-signature" + INC_PREFIX_LIST = "#default samlp saml ds xs xsi md" + + attr_writer :uuid + + def uuid + @uuid ||= begin + document.root.nil? ? nil : document.root.attributes['ID'] + end + end + + # + # + # + # + # + # + # + # + # + # etc. + # + # + # + # + # + def sign_document(private_key, certificate, signature_method = RSA_SHA1, digest_method = SHA1) + noko = Nokogiri::XML(self.to_s) do |config| + config.options = XMLSecurity::BaseDocument::NOKOGIRI_OPTIONS + end + + signature_element = REXML::Element.new("ds:Signature").add_namespace('ds', DSIG) + signed_info_element = signature_element.add_element("ds:SignedInfo") + signed_info_element.add_element("ds:CanonicalizationMethod", {"Algorithm" => C14N}) + signed_info_element.add_element("ds:SignatureMethod", {"Algorithm"=>signature_method}) + + # Add Reference + reference_element = signed_info_element.add_element("ds:Reference", {"URI" => "##{uuid}"}) + + # Add Transforms + transforms_element = reference_element.add_element("ds:Transforms") + transforms_element.add_element("ds:Transform", {"Algorithm" => ENVELOPED_SIG}) + c14element = transforms_element.add_element("ds:Transform", {"Algorithm" => C14N}) + c14element.add_element("ec:InclusiveNamespaces", {"xmlns:ec" => C14N, "PrefixList" => INC_PREFIX_LIST}) + + digest_method_element = reference_element.add_element("ds:DigestMethod", {"Algorithm" => digest_method}) + inclusive_namespaces = INC_PREFIX_LIST.split(" ") + canon_doc = noko.canonicalize(canon_algorithm(C14N), inclusive_namespaces) + reference_element.add_element("ds:DigestValue").text = compute_digest(canon_doc, algorithm(digest_method_element)) + + # add SignatureValue + noko_sig_element = Nokogiri::XML(signature_element.to_s) do |config| + config.options = XMLSecurity::BaseDocument::NOKOGIRI_OPTIONS + end + + noko_signed_info_element = noko_sig_element.at_xpath('//ds:Signature/ds:SignedInfo', 'ds' => DSIG) + canon_string = noko_signed_info_element.canonicalize(canon_algorithm(C14N)) + + signature = compute_signature(private_key, algorithm(signature_method).new, canon_string) + signature_element.add_element("ds:SignatureValue").text = signature + + # add KeyInfo + key_info_element = signature_element.add_element("ds:KeyInfo") + x509_element = key_info_element.add_element("ds:X509Data") + x509_cert_element = x509_element.add_element("ds:X509Certificate") + if certificate.is_a?(String) + certificate = OpenSSL::X509::Certificate.new(certificate) + end + x509_cert_element.text = Base64.encode64(certificate.to_der).gsub(/\n/, "") + + # add the signature + issuer_element = elements["//saml:Issuer"] + if issuer_element + root.insert_after(issuer_element, signature_element) + elsif first_child = root.children[0] + root.insert_before(first_child, signature_element) + else + root.add_element(signature_element) + end + end + + protected + + def compute_signature(private_key, signature_algorithm, document) + Base64.encode64(private_key.sign(signature_algorithm, document)).gsub(/\n/, "") + end + + def compute_digest(document, digest_algorithm) + digest = digest_algorithm.digest(document) + Base64.encode64(digest).strip! + end + + end + + class SignedDocument < BaseDocument + include OneLogin::RubySaml::ErrorHandling + + attr_writer :signed_element_id + + def initialize(response, errors = []) + super(response) + @errors = errors + end + + def signed_element_id + @signed_element_id ||= extract_signed_element_id + end + + def validate_document(idp_cert_fingerprint, soft = true, options = {}) + # get cert from response + cert_element = REXML::XPath.first( + self, + "//ds:X509Certificate", + { "ds"=>DSIG } + ) + + if cert_element + base64_cert = OneLogin::RubySaml::Utils.element_text(cert_element) + cert_text = Base64.decode64(base64_cert) + begin + cert = OpenSSL::X509::Certificate.new(cert_text) + rescue OpenSSL::X509::CertificateError => _e + return append_error("Document Certificate Error", soft) + end + + if options[:fingerprint_alg] + fingerprint_alg = XMLSecurity::BaseDocument.new.algorithm(options[:fingerprint_alg]).new + else + fingerprint_alg = OpenSSL::Digest::SHA1.new + end + fingerprint = fingerprint_alg.hexdigest(cert.to_der) + + # check cert matches registered idp cert + if fingerprint != idp_cert_fingerprint.gsub(/[^a-zA-Z0-9]/,"").downcase + return append_error("Fingerprint mismatch", soft) + end + else + if options[:cert] + base64_cert = Base64.encode64(options[:cert].to_pem) + else + if soft + return false + else + return append_error("Certificate element missing in response (ds:X509Certificate) and not cert provided at settings", soft) + end + end + end + validate_signature(base64_cert, soft) + end + + def validate_document_with_cert(idp_cert, soft = true) + # get cert from response + cert_element = REXML::XPath.first( + self, + "//ds:X509Certificate", + { "ds"=>DSIG } + ) + + if cert_element + base64_cert = OneLogin::RubySaml::Utils.element_text(cert_element) + cert_text = Base64.decode64(base64_cert) + begin + cert = OpenSSL::X509::Certificate.new(cert_text) + rescue OpenSSL::X509::CertificateError => _e + return append_error("Document Certificate Error", soft) + end + + # check saml response cert matches provided idp cert + if idp_cert.to_pem != cert.to_pem + return append_error("Certificate of the Signature element does not match provided certificate", soft) + end + else + base64_cert = Base64.encode64(idp_cert.to_pem) + end + validate_signature(base64_cert, true) + end + + def validate_signature(base64_cert, soft = true) + + document = Nokogiri::XML(self.to_s) do |config| + config.options = XMLSecurity::BaseDocument::NOKOGIRI_OPTIONS + end + + # create a rexml document + @working_copy ||= REXML::Document.new(self.to_s).root + + # get signature node + sig_element = REXML::XPath.first( + @working_copy, + "//ds:Signature", + {"ds"=>DSIG} + ) + + # signature method + sig_alg_value = REXML::XPath.first( + sig_element, + "./ds:SignedInfo/ds:SignatureMethod", + {"ds"=>DSIG} + ) + signature_algorithm = algorithm(sig_alg_value) + + # get signature + base64_signature = REXML::XPath.first( + sig_element, + "./ds:SignatureValue", + {"ds" => DSIG} + ) + signature = Base64.decode64(OneLogin::RubySaml::Utils.element_text(base64_signature)) + + # canonicalization method + canon_algorithm = canon_algorithm REXML::XPath.first( + sig_element, + './ds:SignedInfo/ds:CanonicalizationMethod', + 'ds' => DSIG + ) + + noko_sig_element = document.at_xpath('//ds:Signature', 'ds' => DSIG) + noko_signed_info_element = noko_sig_element.at_xpath('./ds:SignedInfo', 'ds' => DSIG) + + canon_string = noko_signed_info_element.canonicalize(canon_algorithm) + noko_sig_element.remove + + # get inclusive namespaces + inclusive_namespaces = extract_inclusive_namespaces + + # check digests + ref = REXML::XPath.first(sig_element, "//ds:Reference", {"ds"=>DSIG}) + + hashed_element = document.at_xpath("//*[@ID=$id]", nil, { 'id' => extract_signed_element_id }) + + canon_algorithm = canon_algorithm REXML::XPath.first( + ref, + '//ds:CanonicalizationMethod', + { "ds" => DSIG } + ) + + canon_algorithm = process_transforms(ref, canon_algorithm) + + canon_hashed_element = hashed_element.canonicalize(canon_algorithm, inclusive_namespaces) + + digest_algorithm = algorithm(REXML::XPath.first( + ref, + "//ds:DigestMethod", + { "ds" => DSIG } + )) + hash = digest_algorithm.digest(canon_hashed_element) + encoded_digest_value = REXML::XPath.first( + ref, + "//ds:DigestValue", + { "ds" => DSIG } + ) + digest_value = Base64.decode64(OneLogin::RubySaml::Utils.element_text(encoded_digest_value)) + + unless digests_match?(hash, digest_value) + return append_error("Digest mismatch", soft) + end + + # get certificate object + cert_text = Base64.decode64(base64_cert) + cert = OpenSSL::X509::Certificate.new(cert_text) + + # verify signature + unless cert.public_key.verify(signature_algorithm.new, signature, canon_string) + return append_error("Key validation error", soft) + end + + return true + end + + private + + def process_transforms(ref, canon_algorithm) + transforms = REXML::XPath.match( + ref, + "//ds:Transforms/ds:Transform", + { "ds" => DSIG } + ) + + transforms.each do |transform_element| + if transform_element.attributes && transform_element.attributes["Algorithm"] + algorithm = transform_element.attributes["Algorithm"] + case algorithm + when "http://www.w3.org/TR/2001/REC-xml-c14n-20010315", + "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" + canon_algorithm = Nokogiri::XML::XML_C14N_1_0 + when "http://www.w3.org/2006/12/xml-c14n11", + "http://www.w3.org/2006/12/xml-c14n11#WithComments" + canon_algorithm = Nokogiri::XML::XML_C14N_1_1 + when "http://www.w3.org/2001/10/xml-exc-c14n#", + "http://www.w3.org/2001/10/xml-exc-c14n#WithComments" + canon_algorithm = Nokogiri::XML::XML_C14N_EXCLUSIVE_1_0 + end + end + end + + canon_algorithm + end + + def digests_match?(hash, digest_value) + hash == digest_value + end + + def extract_signed_element_id + reference_element = REXML::XPath.first( + self, + "//ds:Signature/ds:SignedInfo/ds:Reference", + {"ds"=>DSIG} + ) + + return nil if reference_element.nil? + + sei = reference_element.attribute("URI").value[1..-1] + sei.nil? ? reference_element.parent.parent.parent.attribute("ID").value : sei + end + + def extract_inclusive_namespaces + element = REXML::XPath.first( + self, + "//ec:InclusiveNamespaces", + { "ec" => C14N } + ) + if element + prefix_list = element.attributes.get_attribute("PrefixList").value + prefix_list.split(" ") + else + nil + end + end + + end +end diff --git a/ruby-saml-custom/ruby-saml-custom.gemspec b/ruby-saml-custom/ruby-saml-custom.gemspec new file mode 100644 index 0000000..f79ea90 --- /dev/null +++ b/ruby-saml-custom/ruby-saml-custom.gemspec @@ -0,0 +1,81 @@ +$LOAD_PATH.push File.expand_path('../lib', __FILE__) +require 'onelogin/ruby-saml/version' + +Gem::Specification.new do |s| + s.name = 'ruby-saml-custom' + s.version = OneLogin::RubySaml::VERSION + + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.authors = ["OneLogin LLC"] + s.date = Time.now.strftime("%Y-%m-%d") + s.description = %q{SAML toolkit for Ruby on Rails} + s.email = %q{support@onelogin.com} + s.license = 'MIT' + s.extra_rdoc_files = [ + "LICENSE", + "README.md" + ] + s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + s.homepage = %q{https://github.com/onelogin/ruby-saml} + s.rdoc_options = ["--charset=UTF-8"] + s.require_paths = ["lib"] + s.rubygems_version = %q{1.3.7} + s.required_ruby_version = '>= 1.8.7' + s.summary = %q{SAML Ruby Tookit} + + # Because runtime dependencies are determined at build time, we cannot make + # Nokogiri's version dependent on the Ruby version, even though we would + # have liked to constrain Ruby 1.8.7 to install only the 1.5.x versions. + if defined?(JRUBY_VERSION) + if JRUBY_VERSION < '9.2.0.0' + s.add_runtime_dependency('nokogiri', '>= 1.8.2', '<= 1.8.5') + s.add_runtime_dependency('jruby-openssl', '>= 0.9.8') + s.add_runtime_dependency('json', '< 2.3.0') + else + s.add_runtime_dependency('nokogiri', '>= 1.8.2') + end + elsif RUBY_VERSION < '1.9' + s.add_runtime_dependency('uuid') + s.add_runtime_dependency('nokogiri', '<= 1.5.11') + elsif RUBY_VERSION < '2.1' + s.add_runtime_dependency('nokogiri', '>= 1.5.10', '<= 1.6.8.1') + s.add_runtime_dependency('json', '< 2.3.0') + elsif RUBY_VERSION < '2.3' + s.add_runtime_dependency('nokogiri', '>= 1.7', '< 1.10.0') + else + s.add_runtime_dependency('nokogiri', '>= 1.10.5') + s.add_runtime_dependency('rexml') + end + + s.add_development_dependency('coveralls') + s.add_development_dependency('minitest', '~> 5.5') + s.add_development_dependency('mocha', '~> 0.14') + s.add_development_dependency('rake', '~> 10') + s.add_development_dependency('shoulda', '~> 2.11') + s.add_development_dependency('simplecov') + s.add_development_dependency('systemu', '~> 2') + + if RUBY_VERSION < '2.1' + s.add_development_dependency('timecop', '<= 0.6.0') + else + s.add_development_dependency('timecop', '~> 0.9') + end + + if defined?(JRUBY_VERSION) + # All recent versions of JRuby play well with pry + s.add_development_dependency('pry') + elsif RUBY_VERSION < '1.9' + # 1.8.7 + s.add_development_dependency('ruby-debug', '~> 0.10.4') + elsif RUBY_VERSION < '2.0' + # 1.9.x + s.add_development_dependency('debugger-linecache', '~> 1.2.0') + s.add_development_dependency('debugger', '~> 1.6.4') + elsif RUBY_VERSION < '2.1' + # 2.0.x + s.add_development_dependency('byebug', '~> 2.1.1') + else + # 2.1.x, 2.2.x + s.add_development_dependency('pry-byebug') + end +end diff --git a/ruby-saml-custom/test/attributes_test.rb b/ruby-saml-custom/test/attributes_test.rb new file mode 100644 index 0000000..b98b65b --- /dev/null +++ b/ruby-saml-custom/test/attributes_test.rb @@ -0,0 +1,30 @@ +require File.expand_path(File.join(File.dirname(__FILE__), 'test_helper')) + +require 'onelogin/ruby-saml/attributes' + +class AttributesTest < Minitest::Test + describe 'Attributes' do + let(:attributes) do + OneLogin::RubySaml::Attributes.new({ + 'email' => ['tom@hanks.com'], + 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname' => ['Tom'], + 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname' => ['Hanks'] + }) + end + + it 'fetches string attribute' do + assert_equal('tom@hanks.com', attributes.fetch('email')) + end + + it 'fetches symbol attribute' do + assert_equal('tom@hanks.com', attributes.fetch(:email)) + end + + it 'fetches regexp attribute' do + assert_equal('Tom', attributes.fetch(/givenname/)) + assert_equal('Tom', attributes.fetch(/gi(.*)/)) + assert_nil(attributes.fetch(/^z.*/)) + assert_equal('Hanks', attributes.fetch(/surname/)) + end + end +end diff --git a/ruby-saml-custom/test/certificates/certificate.der b/ruby-saml-custom/test/certificates/certificate.der new file mode 100644 index 0000000..756d248 Binary files /dev/null and b/ruby-saml-custom/test/certificates/certificate.der differ diff --git a/ruby-saml-custom/test/certificates/certificate1 b/ruby-saml-custom/test/certificates/certificate1 new file mode 100644 index 0000000..df72def --- /dev/null +++ b/ruby-saml-custom/test/certificates/certificate1 @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE----- +MIIBrTCCAaGgAwIBAgIBATADBgEAMGcxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApD +YWxpZm9ybmlhMRUwEwYDVQQHDAxTYW50YSBNb25pY2ExETAPBgNVBAoMCE9uZUxv +Z2luMRkwFwYDVQQDDBBhcHAub25lbG9naW4uY29tMB4XDTEwMTAxMTIxMTUxMloX +DTE1MTAxMTIxMTUxMlowZzELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3Ju +aWExFTATBgNVBAcMDFNhbnRhIE1vbmljYTERMA8GA1UECgwIT25lTG9naW4xGTAX +BgNVBAMMEGFwcC5vbmVsb2dpbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ +AoGBAMPmjfjy7L35oDpeBXBoRVCgktPkLno9DOEWB7MgYMMVKs2B6ymWQLEWrDug +MK1hkzWFhIb5fqWLGbWy0J0veGR9/gHOQG+rD/I36xAXnkdiXXhzoiAG/zQxM0ed +MOUf40n314FC8moErcUg6QabttzesO59HFz6shPuxcWaVAgxAgMBAAEwAwYBAAMB +AA== +-----END CERTIFICATE----- diff --git a/ruby-saml-custom/test/certificates/certificate_without_head_foot b/ruby-saml-custom/test/certificates/certificate_without_head_foot new file mode 100644 index 0000000..a18e2df --- /dev/null +++ b/ruby-saml-custom/test/certificates/certificate_without_head_foot @@ -0,0 +1 @@ +MIIEYTCCA0mgAwIBAgIJAMax+2BoUJmCMA0GCSqGSIb3DQEBBQUAMIHGMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxsaW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xIzAhBgNVBAoMGldlbGxzcHJpbmcgV29ybGR3aWRlLCBJbmMuMRwwGgYDVQQLDBNTeXN0ZW1zIEVuZ2luZWVyaW5nMSQwIgYDVQQDDBtzc28ud2VsbHNwcmluZ3dvcmxkd2lkZS5jb20xKTAnBgkqhkiG9w0BCQEWGml0QHdlbGxzcHJpbmd3b3JsZHdpZGUuY29tMB4XDTEzMDIyNzIzNTUwOFoXDTIzMDIyNzIzNTUwOFowgcYxCzAJBgNVBAYTAlVTMREwDwYDVQQIDAhJbGxp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VZdGR+6bTxKUKq \ No newline at end of file diff --git a/ruby-saml-custom/test/certificates/formatted_certificate b/ruby-saml-custom/test/certificates/formatted_certificate new file mode 100644 index 0000000..a36646b --- /dev/null +++ b/ruby-saml-custom/test/certificates/formatted_certificate @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICPDCCAaWgAwIBAgIIEiC/9HMAWWAwDQYJKoZIhvcNAQEFBQAwTzELMAkGA1UE +BhMCVVMxDDAKBgNVBAoTA2libTEMMAoGA1UECxMDc3NvMSQwIgYDVQQDExtjMjVh +MDI3Ny50b3JvbnRvLmNhLmlibS5jb20wHhcNMTEwNTI0MTYzNTQ4WhcNMjEwNTIx +wsQMPBj4WQTNzTYMCQYDVQQGEwJVUzEMMAoGA1UEChMDaWJtMQwwCgYDVQQLEwNz +c28xJDAiBgNVBAMTG2MyNWEwMjc3LnRvcm9udG8uY2EuaWJtLmNvbTCBnzANBgkq +hkiG9w0BAQEFAAOBjQAwgYkCgYEAgzfYQZuf5FVdJTcrsIQZ+YHTPjOsw2MGo0jC +mdGMcp4brWeFgk1OVaOmytPx6P76wHWR436AleX3crHBPd8gPxuZdnvBQ7PkrKpw +Vvaq52juenFrho8JY0TeVgVkY5jAh45YzytjP2y2k/cGQurI/56NT0PpQJ0S1G3N +4eTg718CAwEAAaMhMB8wHQYDVR0OBBYEFCYVLJqcJ7WgdzGIsuJ/TzDGDqinMA0G +CSqGSIb3DQEBBQUAA4GBAB80bIePf+qWDvWe+9bEEnbFTw7pCknLexxZ0AMqrsmZ ++4jmI+evP1JZYCjfIg9X+MBH01hfp5dFcetz3o6w6SkV+BxLYLgfcy5KUcYsIM/1 +2Zkedj87bS1glzOy5B89pKD2DMbu6828Abzgc+4lyQ2ASifsqM4cZdVayzo8n+dQ +-----END CERTIFICATE----- \ No newline at end of file diff --git a/ruby-saml-custom/test/certificates/formatted_chained_certificate b/ruby-saml-custom/test/certificates/formatted_chained_certificate new file mode 100644 index 0000000..23c3621 --- /dev/null +++ b/ruby-saml-custom/test/certificates/formatted_chained_certificate @@ -0,0 +1,42 @@ +-----BEGIN CERTIFICATE----- +MIICPDCCAaWgAwIBAgIIEiC/9HMAWWAwDQYJKoZIhvcNAQEFBQAwTzELMAkGA1UE +BhMCVVMxDDAKBgNVBAoTA2libTEMMAoGA1UECxMDc3NvMSQwIgYDVQQDExtjMjVh +MDI3Ny50b3JvbnRvLmNhLmlibS5jb20wHhcNMTEwNTI0MTYzNTQ4WhcNMjEwNTIx +wsQMPBj4WQTNzTYMCQYDVQQGEwJVUzEMMAoGA1UEChMDaWJtMQwwCgYDVQQLEwNz +c28xJDAiBgNVBAMTG2MyNWEwMjc3LnRvcm9udG8uY2EuaWJtLmNvbTCBnzANBgkq +hkiG9w0BAQEFAAOBjQAwgYkCgYEAgzfYQZuf5FVdJTcrsIQZ+YHTPjOsw2MGo0jC +mdGMcp4brWeFgk1OVaOmytPx6P76wHWR436AleX3crHBPd8gPxuZdnvBQ7PkrKpw +Vvaq52juenFrho8JY0TeVgVkY5jAh45YzytjP2y2k/cGQurI/56NT0PpQJ0S1G3N +4eTg718CAwEAAaMhMB8wHQYDVR0OBBYEFCYVLJqcJ7WgdzGIsuJ/TzDGDqinMA0G +CSqGSIb3DQEBBQUAA4GBAB80bIePf+qWDvWe+9bEEnbFTw7pCknLexxZ0AMqrsmZ ++4jmI+evP1JZYCjfIg9X+MBH01hfp5dFcetz3o6w6SkV+BxLYLgfcy5KUcYsIM/1 +2Zkedj87bS1glzOy5B89pKD2DMbu6828Abzgc+4lyQ2ASifsqM4cZdVayzo8n+dQ +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICPDCCAaWgAwIBAgIIEiC/9HMAWWAwDQYJKoZIhvcNAQEFBQAwTzELMAkGA1UE +BhMCVVMxDDAKBgNVBAoTA2libTEMMAoGA1UECxMDc3NvMSQwIgYDVQQDExtjMjVh +MDI3Ny50b3JvbnRvLmNhLmlibS5jb20wHhcNMTEwNTI0MTYzNTQ4WhcNMj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dnvBQ7PkrKpw +Vvaq52juenFrho8JY0TeVgVkY5jAh45YzytjP2y2k/cGQurI/56NT0PpQJ0S1G3N +4eTg718CAwEAAaMhMB8wHQYDVR0OBBYEFCYVLJqcJ7WgdzGIsuJ/TzDGDqinMA0G +CSqGSIb3DQEBBQUAA4GBAB80bIePf+qWDvWe+9bEEnbFTw7pCknLexxZ0AMqrsmZ ++4jmI+evP1JZYCjfIg9X+MBH01hfp5dFcetz3o6w6SkV+BxLYLgfcy5KUcYsIM/1 +2Zkedj87bS1glzOy5B89pKD2DMbu6828Abzgc+4lyQ2ASifsqM4cZdVayzo8n+dQ +-----END CERTIFICATE----- \ No newline at end of file diff --git a/ruby-saml-custom/test/certificates/formatted_private_key b/ruby-saml-custom/test/certificates/formatted_private_key new file mode 100644 index 0000000..ec5b39b --- /dev/null +++ b/ruby-saml-custom/test/certificates/formatted_private_key @@ -0,0 +1,12 @@ +-----BEGIN PRIVATE KEY----- +MIIBuwIBAAKBgQDImEj39zKfeh4LbgzPuos/DCnyKZUJzAHX3OSXA1Akl+CA1Ak3 +NgRCJ3NOflCGzW+PcLvxrSwH3mHaqQAvDA2fJOySiVtJ9+tm1jrQnL+AAw7JzUht +YzmnRC8wwuN1+TDuKiK1Hzr/4fz2eFZ6+M53YC4eHOkBYA0FdFGRYrH70wIVAJfR +hg3tWWhJvyJBvaZoh3/BP613AoGBAL0KkMDFRc3FXcvdRKNpWbrsU41G32bBlfQR +O1EBe1+ghIasBr7lxEEhdkfthlaF4JiFHyaXuSx5hPKUbo8AO/MfaPJ7SKK2QRS3 +B/qlstzIbjmvgYJJuOs4O4x6lYgeU5rb9G5SoOEBvyo46ZxfzdWhAwfZofsrzAhe +3WlOTZkdAoGAGmt0xlYn/0oYZjCxGKStjBA80E5NypAl7UyFj1RhGjIUkiuRcgOL +d3/fC6vKuqsMtLHyb5EGqtHPbqm4re1rw0zDh+qHEFA4N6UW0poc9eNEfosJA2BO +5o8ft9FzKA033pl89mD0CBj05EPadGR7E7QhL5mXuQJpjXJEiyqbce4CFAUFhvCK +GeW2AKaE6oqRqeVwGw4V +-----END PRIVATE KEY----- \ No newline at end of file diff --git a/ruby-saml-custom/test/certificates/formatted_rsa_private_key b/ruby-saml-custom/test/certificates/formatted_rsa_private_key new file mode 100644 index 0000000..96a91d9 --- /dev/null +++ b/ruby-saml-custom/test/certificates/formatted_rsa_private_key @@ -0,0 +1,12 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIBuwIBAAKBgQDImEj39zKfeh4LbgzPuos/DCnyKZUJzAHX3OSXA1Akl+CA1Ak3 +NgRCJ3NOflCGzW+PcLvxrSwH3mHaqQAvDA2fJOySiVtJ9+tm1jrQnL+AAw7JzUht +YzmnRC8wwuN1+TDuKiK1Hzr/4fz2eFZ6+M53YC4eHOkBYA0FdFGRYrH70wIVAJfR +hg3tWWhJvyJBvaZoh3/BP613AoGBAL0KkMDFRc3FXcvdRKNpWbrsU41G32bBlfQR +O1EBe1+ghIasBr7lxEEhdkfthlaF4JiFHyaXuSx5hPKUbo8AO/MfaPJ7SKK2QRS3 +B/qlstzIbjmvgYJJuOs4O4x6lYgeU5rb9G5SoOEBvyo46ZxfzdWhAwfZofsrzAhe +3WlOTZkdAoGAGmt0xlYn/0oYZjCxGKStjBA80E5NypAl7UyFj1RhGjIUkiuRcgOL +d3/fC6vKuqsMtLHyb5EGqtHPbqm4re1rw0zDh+qHEFA4N6UW0poc9eNEfosJA2BO +5o8ft9FzKA033pl89mD0CBj05EPadGR7E7QhL5mXuQJpjXJEiyqbce4CFAUFhvCK +GeW2AKaE6oqRqeVwGw4V +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/ruby-saml-custom/test/certificates/invalid_certificate1 b/ruby-saml-custom/test/certificates/invalid_certificate1 new file mode 100644 index 0000000..f6bd017 --- /dev/null +++ b/ruby-saml-custom/test/certificates/invalid_certificate1 @@ -0,0 +1 @@ +-----BEGIN CERTIFICATE----- MIICPDCCAaWgAwIBAgIIEiC/9HMAWWAwDQYJKoZIhvcNAQEFBQAwTzELMAkGA1UE BhMCVVMxDDAKBgNVBAoTA2libTEMMAoGA1UECxMDc3NvMSQwIgYDVQQDExtjMjVh MDI3Ny50b3JvbnRvLmNhLmlibS5jb20wHhcNMTEwNTI0MTYzNTQ4WhcNMjEwNTIx wsQMPBj4WQTNzTYMCQYDVQQGEwJVUzEMMAoGA1UEChMDaWJtMQwwCgYDVQQLEwNz c28xJDAiBgNVBAMTG2MyNWEwMjc3LnRvcm9udG8uY2EuaWJtLmNvbTCBnzANBgkq hkiG9w0BAQEFAAOBjQAwgYkCgYEAgzfYQZuf5FVdJTcrsIQZ+YHTPjOsw2MGo0jC mdGMcp4brWeFgk1OVaOmytPx6P76wHWR436AleX3crHBPd8gPxuZdnvBQ7PkrKpw Vvaq52juenFrho8JY0TeVgVkY5jAh45YzytjP2y2k/cGQurI/56NT0PpQJ0S1G3N 4eTg718CAwEAAaMhMB8wHQYDVR0OBBYEFCYVLJqcJ7WgdzGIsuJ/TzDGDqinMA0G CSqGSIb3DQEBBQUAA4GBAB80bIePf+qWDvWe+9bEEnbFTw7pCknLexxZ0AMqrsmZ +4jmI+evP1JZYCjfIg9X+MBH01hfp5dFcetz3o6w6SkV+BxLYLgfcy5KUcYsIM/1 2Zkedj87bS1glzOy5B89pKD2DMbu6828Abzgc+4lyQ2ASifsqM4cZdVayzo8n+dQ -----END CERTIFICATE----- diff --git a/ruby-saml-custom/test/certificates/invalid_certificate2 b/ruby-saml-custom/test/certificates/invalid_certificate2 new file mode 100644 index 0000000..3764a4b --- /dev/null +++ b/ruby-saml-custom/test/certificates/invalid_certificate2 @@ -0,0 +1 @@ +MIICPDCCAaWgAwIBAgIIEiC/9HMAWWAwDQYJKoZIhvcNAQEFBQAwTzELMAkGA1UEBhMCVVMxDDAKBgNVBAoTA2libTEMMAoGA1UECxMDc3NvMSQwIgYDVQQDExtjMjVhMDI3Ny50b3JvbnRvLmNhLmlibS5jb20wHhcNMTEwNTI0MTYzNTQ4WhcNMjEwNTIxwsQMPBj4WQTNzTYMCQYDVQQGEwJVUzEMMAoGA1UEChMDaWJtMQwwCgYDVQQLEwNzc28xJDAiBgNVBAMTG2MyNWEwMjc3LnRvcm9udG8uY2EuaWJtLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAgzfYQZuf5FVdJTcrsIQZ+YHTPjOsw2MGo0jCmdGMcp4brWeFgk1OVaOmytPx6P76wHWR436AleX3crHBPd8gPxuZdnvBQ7PkrKpw Vvaq52juenFrho8JY0TeVgVkY5jAh45YzytjP2y2k/cGQurI/56NT0PpQJ0S1G3N 4eTg718CAwEAAaMhMB8wHQYDVR0OBBYEFCYVLJqcJ7WgdzGIsuJ/TzDGDqinMA0G CSqGSIb3DQEBBQUAA4GBAB80bIePf+qWDvWe+9bEEnbFTw7pCknLexxZ0AMqrsmZ +4jmI+evP1JZYCjfIg9X+MBH01hfp5dFcetz3o6w6SkV+BxLYLgfcy5KUcYsIM/1 2Zkedj87bS1glzOy5B89pKD2DMbu6828Abzgc+4lyQ2ASifsqM4cZdVayzo8n+dQ diff --git a/ruby-saml-custom/test/certificates/invalid_certificate3 b/ruby-saml-custom/test/certificates/invalid_certificate3 new file mode 100644 index 0000000..5f83840 --- /dev/null +++ b/ruby-saml-custom/test/certificates/invalid_certificate3 @@ -0,0 +1,12 @@ +MIICPDCCAaWgAwIBAgIIEiC/9HMAWWAwDQYJKoZIhvcNAQEFBQAwTzELMAkGA1UE +BhMCVVMxDDAKBgNVBAoTA2libTEMMAoGA1UECxMDc3NvMSQwIgYDVQQDExtjMjVh +MDI3Ny50b3JvbnRvLmNhLmlibS5jb20wHhcNMTEwNTI0MTYzNTQ4WhcNMjEwNTIx +wsQMPBj4WQTNzTYMCQYDVQQGEwJVUzEMMAoGA1UEChMDaWJtMQwwCgYDVQQLEwNz +c28xJDAiBgNVBAMTG2MyNWEwMjc3LnRvcm9udG8uY2EuaWJtLmNvbTCBnzANBgkq +hkiG9w0BAQEFAAOBjQAwgYkCgYEAgzfYQZuf5FVdJTcrsIQZ+YHTPjOsw2MGo0jC +mdGMcp4brWeFgk1OVaOmytPx6P76wHWR436AleX3crHBPd8gPxuZdnvBQ7PkrKpw +Vvaq52juenFrho8JY0TeVgVkY5jAh45YzytjP2y2k/cGQurI/56NT0PpQJ0S1G3N +4eTg718CAwEAAaMhMB8wHQYDVR0OBBYEFCYVLJqcJ7WgdzGIsuJ/TzDGDqinMA0G +CSqGSIb3DQEBBQUAA4GBAB80bIePf+qWDvWe+9bEEnbFTw7pCknLexxZ0AMqrsmZ ++4jmI+evP1JZYCjfIg9X+MBH01hfp5dFcetz3o6w6SkV+BxLYLgfcy5KUcYsIM/1 +2Zkedj87bS1glzOy5B89pKD2DMbu6828Abzgc+4lyQ2ASifsqM4cZdVayzo8n+dQ diff --git a/ruby-saml-custom/test/certificates/invalid_chained_certificate1 b/ruby-saml-custom/test/certificates/invalid_chained_certificate1 new file mode 100644 index 0000000..765c0dc --- /dev/null +++ b/ruby-saml-custom/test/certificates/invalid_chained_certificate1 @@ -0,0 +1 @@ +-----BEGIN CERTIFICATE-----MIICPDCCAaWgAwIBAgIIEiC/9HMAWW AwDQYJKoZIhvcNAQEFBQAwTzELMAkGA1UEBhMCVVMxDDAKBgNVBAoTA2libTEMMAoGA1UECxMDc3NvMSQwIgYDVQQDExtjMjVhMDI3Ny50b3JvbnRvLmNhLmlibS5jb20wHhcNMTEwNTI0MTYzNTQ4WhcNMjEwNTIxwsQMPBj4WQTNzTYMCQYDVQQGEwJVUzEMMAoGA1UEChMDaWJtMQwwCgYDVQQLEwNzc28xJDAiBgNVBAMTG2MyNWE wMjc3LnRvcm9udG8uY2EuaWJtLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAgzfYQZuf5FVdJTcrsIQZ+YHTPjOsw2MGo0jCmdGMcp4brWeFgk1OVaOmytPx6P76wHWR436AleX3crHBPd8gPxuZdnvBQ7PkrKpwVvaq52juenFrho8JY0TeVgVkY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sqM4cZdVayzo8n+dQ-----END CERTIFICATE----------BEGIN CERTIFICATE-----MIICPDCCAaWgAwIBAgIIEiC/9HMAWWAwDQYJKoZIhvcNAQEFBQAwTzELMAkGA1UEBhMCVVMxDDAKBgNVBAoTA2libTEMMAoGA1UECxMDc3NvMSQwIgYDVQQDExtjMjVhMDI3Ny50b3JvbnRvLmNhLmlibS5jb20wHhcNMTEwNTI0MTYzNTQ4WhcNMjEwNTIxwsQMPBj4WQTNzTYMCQYDVQQGEwJVUzEMMAoGA1UEChMDaWJtMQwwCgYDVQQLEwNzc28xJDAiBgNVBAMTG2MyNWEwMjc3LnRvcm9udG8uY2EuaWJtLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAgzfYQZuf5FVdJTcrsIQZ+YHTPjOsw2MGo0jCmdGMcp4brWeFgk1OVaOmytPx6P76wHWR436AleX3crHBPd8gPxuZdnvBQ7PkrKpwVvaq52juenFrho8JY0TeVgVkY5jAh45YzytjP2y2k/cGQurI/56NT0PpQJ0S1G3N4eTg718CAwEAAaMhMB8wHQYDVR0OBBYEFCYVLJqcJ7WgdzGIsuJ/TzDGDqinMA0GCSqGSIb3DQEBBQUAA4GBAB80bIePf+qWDvWe+9bEEnbFTw7pCknLexxZ0AMqrsmZ+4jmI+evP1JZYCjfIg9X+MBH01hfp5dFcetz3o6w6SkV+BxLYLgfcy5KUcYsIM/12Zkedj87bS1glzOy5B89pKD2DMbu6828Abzgc+4lyQ2ASifsqM4cZdVayzo8n+dQ-----END CERTIFICATE----- \ No newline at end of file diff --git a/ruby-saml-custom/test/certificates/invalid_private_key1 b/ruby-saml-custom/test/certificates/invalid_private_key1 new file mode 100644 index 0000000..44de664 --- /dev/null +++ b/ruby-saml-custom/test/certificates/invalid_private_key1 @@ -0,0 +1 @@ +-----BEGIN PRIVATE KEY----- MIIBuwIBAAKBgQDImEj39zKfeh4LbgzPuos/DCnyKZUJzAHX3OSXA1Akl+CA1Ak3 NgRCJ3NOflCGzW+PcLvxrSwH3mHaqQAvDA2fJOySiVtJ9+tm1jrQnL+AAw7JzUht YzmnRC8wwuN1+TDuKiK1Hzr/4fz2eFZ6+M53YC4eHOkBYA0FdFGRYrH70wIVAJfR hg3tWWhJvyJBvaZoh3/BP613AoGBAL0KkMDFRc3FXcvdRKNpWbrsU41G32bBlfQR O1EBe1+ghIasBr7lxEEhdkfthlaF4JiFHyaXuSx5hPKUbo8AO/MfaPJ7SKK2QRS3 B/qlstzIbjmvgYJJuOs4O4x6lYgeU5rb9G5SoOEBvyo46ZxfzdWhAwfZofsrzAhe 3WlOTZkdAoGAGmt0xlYn/0oYZjCxGKStjBA80E5NypAl7UyFj1RhGjIUkiuRcgOL d3/fC6vKuqsMtLHyb5EGqtHPbqm4re1rw0zDh+qHEFA4N6UW0poc9eNEfosJA2BO 5o8ft9FzKA033pl89mD0CBj05EPadGR7E7QhL5mXuQJpjXJEiyqbce4CFAUFhvCK GeW2AKaE6oqRqeVwGw4V -----END PRIVATE KEY----- \ No newline at end of file diff --git a/ruby-saml-custom/test/certificates/invalid_private_key2 b/ruby-saml-custom/test/certificates/invalid_private_key2 new file mode 100644 index 0000000..3bddb1f --- /dev/null +++ b/ruby-saml-custom/test/certificates/invalid_private_key2 @@ -0,0 +1 @@ +MIIBuwIBAAKBgQDImEj39zKfeh4LbgzPuos/DCnyKZUJzAHX3OSXA1Akl+CA1Ak3NgRCJ3NOflCGzW+PcLvxrSwH3mHaqQAvDA2fJOySiVtJ9+tm1jrQnL+AAw7JzUhtYzmnRC8wwuN1+TDuKiK1Hzr/4fz2eFZ6+M53YC4eHOkBYA0FdFGRYrH70wIVAJfRhg3tWWhJvyJBvaZoh3/BP613AoGBAL0KkMDFRc3FXcvdRKNpWbrsU41G32bBlfQRO1EBe1+ghIasBr7lxEEhdkfthlaF4JiFHyaXuSx5hPKUbo8AO/MfaPJ7SKK2QRS3B/qlstzIbjmvgYJJuOs4O4x6lYgeU5rb9G5SoOEBvyo46ZxfzdWhAwfZofsrzAhe3WlOTZkdAoGAGmt0xlYn/0oYZjCxGKStjBA80E5NypAl7UyFj1RhGjIUkiuRcgOLd3/fC6vKuqsMtLHyb5EGqtHPbqm4re1rw0zDh+qHEFA4N6UW0poc9eNEfosJA2BO5o8ft9FzKA033pl89mD0CBj05EPadGR7E7QhL5mXuQJpjXJEiyqbce4CFAUFhvCKGeW2AKaE6oqRqeVwGw4V \ No newline at end of file diff --git a/ruby-saml-custom/test/certificates/invalid_private_key3 b/ruby-saml-custom/test/certificates/invalid_private_key3 new file mode 100644 index 0000000..16889af --- /dev/null +++ b/ruby-saml-custom/test/certificates/invalid_private_key3 @@ -0,0 +1,10 @@ +MIIBuwIBAAKBgQDImEj39zKfeh4LbgzPuos/DCnyKZUJzAHX3OSXA1Akl+CA1Ak3 +NgRCJ3NOflCGzW+PcLvxrSwH3mHaqQAvDA2fJOySiVtJ9+tm1jrQnL+AAw7JzUht +YzmnRC8wwuN1+TDuKiK1Hzr/4fz2eFZ6+M53YC4eHOkBYA0FdFGRYrH70wIVAJfR +hg3tWWhJvyJBvaZoh3/BP613AoGBAL0KkMDFRc3FXcvdRKNpWbrsU41G32bBlfQR +O1EBe1+ghIasBr7lxEEhdkfthlaF4JiFHyaXuSx5hPKUbo8AO/MfaPJ7SKK2QRS3 +B/qlstzIbjmvgYJJuOs4O4x6lYgeU5rb9G5SoOEBvyo46ZxfzdWhAwfZofsrzAhe +3WlOTZkdAoGAGmt0xlYn/0oYZjCxGKStjBA80E5NypAl7UyFj1RhGjIUkiuRcgOL +d3/fC6vKuqsMtLHyb5EGqtHPbqm4re1rw0zDh+qHEFA4N6UW0poc9eNEfosJA2BO +5o8ft9FzKA033pl89mD0CBj05EPadGR7E7QhL5mXuQJpjXJEiyqbce4CFAUFhvCK +GeW2AKaE6oqRqeVwGw4V \ No newline at end of file diff --git a/ruby-saml-custom/test/certificates/invalid_rsa_private_key1 b/ruby-saml-custom/test/certificates/invalid_rsa_private_key1 new file mode 100644 index 0000000..6bb66ce --- /dev/null +++ b/ruby-saml-custom/test/certificates/invalid_rsa_private_key1 @@ -0,0 +1 @@ +-----BEGIN RSA PRIVATE KEY----- MIIBuwIBAAKBgQDImEj39zKfeh4LbgzPuos/DCnyKZUJzAHX3OSXA1Akl+CA1Ak3 NgRCJ3NOflCGzW+PcLvxrSwH3mHaqQAvDA2fJOySiVtJ9+tm1jrQnL+AAw7JzUht YzmnRC8wwuN1+TDuKiK1Hzr/4fz2eFZ6+M53YC4eHOkBYA0FdFGRYrH70wIVAJfR hg3tWWhJvyJBvaZoh3/BP613AoGBAL0KkMDFRc3FXcvdRKNpWbrsU41G32bBlfQR O1EBe1+ghIasBr7lxEEhdkfthlaF4JiFHyaXuSx5hPKUbo8AO/MfaPJ7SKK2QRS3 B/qlstzIbjmvgYJJuOs4O4x6lYgeU5rb9G5SoOEBvyo46ZxfzdWhAwfZofsrzAhe 3WlOTZkdAoGAGmt0xlYn/0oYZjCxGKStjBA80E5NypAl7UyFj1RhGjIUkiuRcgOL d3/fC6vKuqsMtLHyb5EGqtHPbqm4re1rw0zDh+qHEFA4N6UW0poc9eNEfosJA2BO 5o8ft9FzKA033pl89mD0CBj05EPadGR7E7QhL5mXuQJpjXJEiyqbce4CFAUFhvCK GeW2AKaE6oqRqeVwGw4V -----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/ruby-saml-custom/test/certificates/invalid_rsa_private_key2 b/ruby-saml-custom/test/certificates/invalid_rsa_private_key2 new file mode 100644 index 0000000..3bddb1f --- /dev/null +++ b/ruby-saml-custom/test/certificates/invalid_rsa_private_key2 @@ -0,0 +1 @@ +MIIBuwIBAAKBgQDImEj39zKfeh4LbgzPuos/DCnyKZUJzAHX3OSXA1Akl+CA1Ak3NgRCJ3NOflCGzW+PcLvxrSwH3mHaqQAvDA2fJOySiVtJ9+tm1jrQnL+AAw7JzUhtYzmnRC8wwuN1+TDuKiK1Hzr/4fz2eFZ6+M53YC4eHOkBYA0FdFGRYrH70wIVAJfRhg3tWWhJvyJBvaZoh3/BP613AoGBAL0KkMDFRc3FXcvdRKNpWbrsU41G32bBlfQRO1EBe1+ghIasBr7lxEEhdkfthlaF4JiFHyaXuSx5hPKUbo8AO/MfaPJ7SKK2QRS3B/qlstzIbjmvgYJJuOs4O4x6lYgeU5rb9G5SoOEBvyo46ZxfzdWhAwfZofsrzAhe3WlOTZkdAoGAGmt0xlYn/0oYZjCxGKStjBA80E5NypAl7UyFj1RhGjIUkiuRcgOLd3/fC6vKuqsMtLHyb5EGqtHPbqm4re1rw0zDh+qHEFA4N6UW0poc9eNEfosJA2BO5o8ft9FzKA033pl89mD0CBj05EPadGR7E7QhL5mXuQJpjXJEiyqbce4CFAUFhvCKGeW2AKaE6oqRqeVwGw4V \ No newline at end of file diff --git a/ruby-saml-custom/test/certificates/invalid_rsa_private_key3 b/ruby-saml-custom/test/certificates/invalid_rsa_private_key3 new file mode 100644 index 0000000..16889af --- /dev/null +++ b/ruby-saml-custom/test/certificates/invalid_rsa_private_key3 @@ -0,0 +1,10 @@ +MIIBuwIBAAKBgQDImEj39zKfeh4LbgzPuos/DCnyKZUJzAHX3OSXA1Akl+CA1Ak3 +NgRCJ3NOflCGzW+PcLvxrSwH3mHaqQAvDA2fJOySiVtJ9+tm1jrQnL+AAw7JzUht +YzmnRC8wwuN1+TDuKiK1Hzr/4fz2eFZ6+M53YC4eHOkBYA0FdFGRYrH70wIVAJfR +hg3tWWhJvyJBvaZoh3/BP613AoGBAL0KkMDFRc3FXcvdRKNpWbrsU41G32bBlfQR +O1EBe1+ghIasBr7lxEEhdkfthlaF4JiFHyaXuSx5hPKUbo8AO/MfaPJ7SKK2QRS3 +B/qlstzIbjmvgYJJuOs4O4x6lYgeU5rb9G5SoOEBvyo46ZxfzdWhAwfZofsrzAhe +3WlOTZkdAoGAGmt0xlYn/0oYZjCxGKStjBA80E5NypAl7UyFj1RhGjIUkiuRcgOL +d3/fC6vKuqsMtLHyb5EGqtHPbqm4re1rw0zDh+qHEFA4N6UW0poc9eNEfosJA2BO +5o8ft9FzKA033pl89mD0CBj05EPadGR7E7QhL5mXuQJpjXJEiyqbce4CFAUFhvCK +GeW2AKaE6oqRqeVwGw4V \ No newline at end of file diff --git a/ruby-saml-custom/test/certificates/ruby-saml-2.crt b/ruby-saml-custom/test/certificates/ruby-saml-2.crt new file mode 100644 index 0000000..11696a8 --- /dev/null +++ b/ruby-saml-custom/test/certificates/ruby-saml-2.crt @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICVDCCAb2gAwIBAgIBADANBgkqhkiG9w0BAQ0FADBHMQswCQYDVQQGEwJ1czEQ +MA4GA1UECAwHZXhhbXBsZTEQMA4GA1UECgwHZXhhbXBsZTEUMBIGA1UEAwwLZXhh +bXBsZS5jb20wHhcNMTcwNDA3MDgzMDAzWhcNMjcwNDA1MDgzMDAzWjBHMQswCQYD +VQQGEwJ1czEQMA4GA1UECAwHZXhhbXBsZTEQMA4GA1UECgwHZXhhbXBsZTEUMBIG +A1UEAwwLZXhhbXBsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKhP +S4/0azxbQekHHewQGKD7Pivr3CDpsrKxY3xlVanxj427OwzOb5KUVzsDEazumt6s +ZFY8HfidsjXY4EYA4ZzyL7ciIAR5vlAsIYN9nJ4AwVDnN/RjVwj+TN6BqWPLpVIp +Hc6Dl005HyE0zJnk1DZDn2tQVrIzbD3FhCp7YeotAgMBAAGjUDBOMB0GA1UdDgQW +BBRYZx4thASfNvR/E7NsCF2IaZ7wIDAfBgNVHSMEGDAWgBRYZx4thASfNvR/E7Ns +CF2IaZ7wIDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBDQUAA4GBACz4aobx9aG3 +kh+rNyrlgM3K6dYfnKG1/YH5sJCAOvg8kDr0fQAQifH8lFVWumKUMoAe0bFTfwWt +p/VJ8MprrEJth6PFeZdczpuv+fpLcNj2VmNVJqvQYvS4m36OnBFh1QFZW8UrbFIf +dtm2nuZ+twSKqfKwjLdqcoX0p39h7Uw/ +-----END CERTIFICATE----- \ No newline at end of file diff --git a/ruby-saml-custom/test/certificates/ruby-saml.crt b/ruby-saml-custom/test/certificates/ruby-saml.crt new file mode 100644 index 0000000..60a1291 --- /dev/null +++ b/ruby-saml-custom/test/certificates/ruby-saml.crt @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICGzCCAYQCCQCNNcQXom32VDANBgkqhkiG9w0BAQUFADBSMQswCQYDVQQGEwJV +UzELMAkGA1UECBMCSU4xFTATBgNVBAcTDEluZGlhbmFwb2xpczERMA8GA1UEChMI +T25lTG9naW4xDDAKBgNVBAsTA0VuZzAeFw0xNDA0MjMxODQxMDFaFw0xNTA0MjMx +ODQxMDFaMFIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJJTjEVMBMGA1UEBxMMSW5k +aWFuYXBvbGlzMREwDwYDVQQKEwhPbmVMb2dpbjEMMAoGA1UECxMDRW5nMIGfMA0G +CSqGSIb3DQEBAQUAA4GNADCBiQKBgQDo6m+QZvYQ/xL0ElLgupK1QDcYL4f5Pckw +sNgS9pUvV7fzTqCHk8ThLxTk42MQ2McJsOeUJVP728KhymjFCqxgP4VuwRk9rpAl +0+mhy6MPdyjyA6G14jrDWS65ysLchK4t/vwpEDz0SQlEoG1kMzllSm7zZS3XregA +7DjNaUYQqwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBALM2vGCiQ/vm+a6v40+VX2zd +qHA2Q/1vF1ibQzJ54MJCOVWvs+vQXfZFhdm0OPM2IrDU7oqvKPqP6xOAeJK6H0yP +7M4YL3fatSvIYmmfyXC9kt3Svz/NyrHzPhUnJ0ye/sUSXxnzQxwcm/9PwAqrQaA3 +QpQkH57ybF/OoryPe+2h +-----END CERTIFICATE----- diff --git a/ruby-saml-custom/test/certificates/ruby-saml.key b/ruby-saml-custom/test/certificates/ruby-saml.key new file mode 100644 index 0000000..902d3b0 --- /dev/null +++ b/ruby-saml-custom/test/certificates/ruby-saml.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQDo6m+QZvYQ/xL0ElLgupK1QDcYL4f5PckwsNgS9pUvV7fzTqCH +k8ThLxTk42MQ2McJsOeUJVP728KhymjFCqxgP4VuwRk9rpAl0+mhy6MPdyjyA6G1 +4jrDWS65ysLchK4t/vwpEDz0SQlEoG1kMzllSm7zZS3XregA7DjNaUYQqwIDAQAB +AoGBALGR6bRBit+yV5TUU3MZSrf8WQSLWDLgs/33FQSAEYSib4+DJke2lKbI6jkG +UoSJgFUXFbaQLtMY2+3VDsMKPBdAge9gIdvbkC4yoKjLGm/FBDOxxZcfLpR+9OPq +U3qM9D0CNuliBWI7Je+p/zs09HIYucpDXy9E18KA1KNF6rfhAkEA9KoNam6wAKnm +vMzz31ws3RuIOUeo2rx6aaVY95+P9tTxd6U+pNkwxy1aCGP+InVSwlYNA1aQ4Axi +/GdMIWMkxwJBAPO1CP7cQNZQmu7yusY+GUObDII5YK9WLaY4RAicn5378crPBFxv +Ukqf9G6FHo7u88iTCIp+vwa3Hn9Tumg3iP0CQQDgUXWBasCVqzCxU5wY4tMDWjXY +hpoLCpmVeRML3dDJt004rFm2HKe7Rhpw7PTZNQZOxUSjFeA4e0LaNf838UWLAkB8 +QfbHM3ffjhOg96PhhjINdVWoZCb230LBOHj/xxPfUmFTHcBEfQIBSJMxcrBFAnLL +9qPpMXymqOFk3ETz9DTlAj8E0qGbp78aVbTOtuwEwNJII+RPw+Zkc+lKR+yaWkAz +fIXw527NPHH3+rnBG72wyZr9ud4LAum9jh+5No1LQpk= +-----END RSA PRIVATE KEY----- diff --git a/ruby-saml-custom/test/idp_metadata_parser_test.rb b/ruby-saml-custom/test/idp_metadata_parser_test.rb new file mode 100644 index 0000000..cb6d1f4 --- /dev/null +++ b/ruby-saml-custom/test/idp_metadata_parser_test.rb @@ -0,0 +1,758 @@ +require File.expand_path(File.join(File.dirname(__FILE__), "test_helper")) + +require 'onelogin/ruby-saml/idp_metadata_parser' + +class IdpMetadataParserTest < Minitest::Test + class MockSuccessResponse < Net::HTTPSuccess + # override parent's initialize + def initialize; end + + attr_accessor :body + end + + class MockFailureResponse < Net::HTTPNotFound + # override parent's initialize + def initialize; end + + attr_accessor :body + end + + describe "parsing an IdP descriptor file" do + it "extract settings details from xml" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + + settings = idp_metadata_parser.parse(idp_metadata_descriptor) + + assert_equal "https://hello.example.com/access/saml/idp.xml", settings.idp_entity_id + assert_equal "https://hello.example.com/access/saml/login", settings.idp_sso_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", settings.idp_sso_service_binding + assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", settings.idp_cert_fingerprint + assert_equal "https://hello.example.com/access/saml/logout", settings.idp_slo_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", settings.idp_slo_service_binding + assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", settings.name_identifier_format + assert_equal ["AuthToken", "SSOStartPage"], settings.idp_attribute_names + assert_equal '2014-04-17T18:02:33.910Z', settings.valid_until + end + + it "extract certificate from md:KeyDescriptor[@use='signing']" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata = idp_metadata_descriptor + settings = idp_metadata_parser.parse(idp_metadata) + assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", settings.idp_cert_fingerprint + end + + it "extract certificate from md:KeyDescriptor[@use='encryption']" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata = idp_metadata_descriptor + idp_metadata = idp_metadata.sub(/(.*?)<\/md:KeyDescriptor>/m, "") + settings = idp_metadata_parser.parse(idp_metadata) + assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", settings.idp_cert_fingerprint + end + + it "extract certificate from md:KeyDescriptor" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata = idp_metadata_descriptor + idp_metadata = idp_metadata.sub(/(.*?)<\/md:KeyDescriptor>/m, "") + idp_metadata = idp_metadata.sub('', '') + settings = idp_metadata_parser.parse(idp_metadata) + assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", settings.idp_cert_fingerprint + end + + it "extract SSO endpoint with no specific binding, it takes the first" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata = idp_metadata_descriptor3 + settings = idp_metadata_parser.parse(idp_metadata) + assert_equal "https://idp.example.com/idp/profile/Shibboleth/SSO", settings.idp_sso_service_url + assert_equal "urn:mace:shibboleth:1.0:profiles:AuthnRequest", settings.idp_sso_service_binding + end + + it "extract SSO endpoint with specific binding as a String" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata = idp_metadata_descriptor3 + options = {} + options[:sso_binding] = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST' + options[:slo_binding] = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST' + settings = idp_metadata_parser.parse(idp_metadata, options) + assert_equal "https://idp.example.com/idp/profile/SAML2/POST/SSO", settings.idp_sso_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST", settings.idp_sso_service_binding + assert_nil settings.idp_slo_service_url + + options[:sso_binding] = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect' + options[:slo_binding] = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect' + settings = idp_metadata_parser.parse(idp_metadata, options) + assert_equal "https://idp.example.com/idp/profile/SAML2/Redirect/SSO", settings.idp_sso_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", settings.idp_sso_service_binding + assert_equal "https://idp.example.com/idp/profile/SAML2/Redirect/SLO", settings.idp_slo_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", settings.idp_slo_service_binding + end + + it "extract SSO endpoint with specific binding as an Array" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata = idp_metadata_descriptor3 + options = {} + options[:sso_binding] = ['urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST'] + options[:slo_binding] = ['urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST'] + settings = idp_metadata_parser.parse(idp_metadata, options) + assert_equal "https://idp.example.com/idp/profile/SAML2/POST/SSO", settings.idp_sso_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST", settings.idp_sso_service_binding + assert_nil settings.idp_slo_service_url + + options[:sso_binding] = ['urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'] + options[:slo_binding] = ['urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'] + settings = idp_metadata_parser.parse(idp_metadata, options) + assert_equal "https://idp.example.com/idp/profile/SAML2/Redirect/SSO", settings.idp_sso_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", settings.idp_sso_service_binding + assert_equal "https://idp.example.com/idp/profile/SAML2/Redirect/SLO", settings.idp_slo_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", settings.idp_slo_service_binding + + options[:sso_binding] = ['invalid_binding', 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'] + options[:slo_binding] = ['invalid_binding', 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'] + settings = idp_metadata_parser.parse(idp_metadata, options) + assert_equal "https://idp.example.com/idp/profile/SAML2/Redirect/SSO", settings.idp_sso_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", settings.idp_sso_service_binding + assert_equal "https://idp.example.com/idp/profile/SAML2/Redirect/SLO", settings.idp_slo_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", settings.idp_slo_service_binding + end + + it "extract NameIDFormat no specific priority, it takes the first" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata = idp_metadata_descriptor3 + settings = idp_metadata_parser.parse(idp_metadata) + assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", settings.name_identifier_format + end + + it "extract NameIDFormat specific priority as a String" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata = idp_metadata_descriptor3 + options = {} + options[:name_id_format] = 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified' + settings = idp_metadata_parser.parse(idp_metadata, options) + assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", settings.name_identifier_format + + options[:name_id_format] = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress' + settings = idp_metadata_parser.parse(idp_metadata, options) + assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", settings.name_identifier_format + + options[:name_id_format] = 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent' + settings = idp_metadata_parser.parse(idp_metadata, options) + assert_equal "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent", settings.name_identifier_format + end + + it "extract NameIDFormat specific priority as an Array" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata = idp_metadata_descriptor3 + options = {} + options[:name_id_format] = ['urn:oasis:names:tc:SAML:2.0:nameid-format:persistent', 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress'] + settings = idp_metadata_parser.parse(idp_metadata, options) + assert_equal "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent", settings.name_identifier_format + + options[:name_id_format] = ['invalid', 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress'] + settings = idp_metadata_parser.parse(idp_metadata, options) + assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", settings.name_identifier_format + end + + it "uses settings options as hash for overrides" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata = idp_metadata_descriptor + settings = idp_metadata_parser.parse(idp_metadata, { + :settings => { + :security => { + :digest_method => XMLSecurity::Document::SHA256, + :signature_method => XMLSecurity::Document::RSA_SHA256 + } + } + }) + assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", settings.idp_cert_fingerprint + assert_equal XMLSecurity::Document::SHA256, settings.security[:digest_method] + assert_equal XMLSecurity::Document::RSA_SHA256, settings.security[:signature_method] + end + + it "merges results into given settings object" do + settings = OneLogin::RubySaml::Settings.new(:security => { + :digest_method => XMLSecurity::Document::SHA256, + :signature_method => XMLSecurity::Document::RSA_SHA256 + }) + + OneLogin::RubySaml::IdpMetadataParser.new.parse(idp_metadata_descriptor, :settings => settings) + + assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", settings.idp_cert_fingerprint + assert_equal XMLSecurity::Document::SHA256, settings.security[:digest_method] + assert_equal XMLSecurity::Document::RSA_SHA256, settings.security[:signature_method] + end + end + + describe "parsing an IdP descriptor file into an Hash" do + it "extract settings details from xml" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + + metadata = idp_metadata_parser.parse_to_hash(idp_metadata_descriptor) + + assert_equal "https://hello.example.com/access/saml/idp.xml", metadata[:idp_entity_id] + assert_equal "https://hello.example.com/access/saml/login", metadata[:idp_sso_service_url] + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", metadata[:idp_sso_service_binding] + assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", metadata[:idp_cert_fingerprint] + assert_equal "https://hello.example.com/access/saml/logout", metadata[:idp_slo_service_url] + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", metadata[:idp_slo_service_binding] + assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", metadata[:name_identifier_format] + assert_equal ["AuthToken", "SSOStartPage"], metadata[:idp_attribute_names] + assert_equal '2014-04-17T18:02:33.910Z', metadata[:valid_until] + end + + it "extract certificate from md:KeyDescriptor[@use='signing']" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata = idp_metadata_descriptor + metadata = idp_metadata_parser.parse_to_hash(idp_metadata) + assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", metadata[:idp_cert_fingerprint] + end + + it "extract certificate from md:KeyDescriptor[@use='encryption']" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata = idp_metadata_descriptor + idp_metadata = idp_metadata.sub(/(.*?)<\/md:KeyDescriptor>/m, "") + parsed_metadata = idp_metadata_parser.parse_to_hash(idp_metadata) + assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", parsed_metadata[:idp_cert_fingerprint] + end + + it "extract certificate from md:KeyDescriptor" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata = idp_metadata_descriptor + idp_metadata = idp_metadata.sub(/(.*?)<\/md:KeyDescriptor>/m, "") + idp_metadata = idp_metadata.sub('', '') + parsed_metadata = idp_metadata_parser.parse_to_hash(idp_metadata) + assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", parsed_metadata[:idp_cert_fingerprint] + end + + it "extract SSO endpoint with no specific binding, it takes the first" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata = idp_metadata_descriptor3 + metadata = idp_metadata_parser.parse_to_hash(idp_metadata) + assert_equal "https://idp.example.com/idp/profile/Shibboleth/SSO", metadata[:idp_sso_service_url] + assert_equal "urn:mace:shibboleth:1.0:profiles:AuthnRequest", metadata[:idp_sso_service_binding] + end + + it "extract SSO endpoint with specific binding" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata = idp_metadata_descriptor3 + options = {} + options[:sso_binding] = ['urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST'] + parsed_metadata = idp_metadata_parser.parse_to_hash(idp_metadata, options) + assert_equal "https://idp.example.com/idp/profile/SAML2/POST/SSO", parsed_metadata[:idp_sso_service_url] + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST", parsed_metadata[:idp_sso_service_binding] + + options[:sso_binding] = ['urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'] + parsed_metadata = idp_metadata_parser.parse_to_hash(idp_metadata, options) + assert_equal "https://idp.example.com/idp/profile/SAML2/Redirect/SSO", parsed_metadata[:idp_sso_service_url] + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", parsed_metadata[:idp_sso_service_binding] + + options[:sso_binding] = ['invalid_binding', 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'] + parsed_metadata = idp_metadata_parser.parse_to_hash(idp_metadata, options) + assert_equal "https://idp.example.com/idp/profile/SAML2/Redirect/SSO", parsed_metadata[:idp_sso_service_url] + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", parsed_metadata[:idp_sso_service_binding] + end + + it "ignores a given :settings hash" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata = idp_metadata_descriptor + parsed_metadata = idp_metadata_parser.parse_to_hash(idp_metadata, { + :settings => { + :security => { + :digest_method => XMLSecurity::Document::SHA256, + :signature_method => XMLSecurity::Document::RSA_SHA256 + } + } + }) + assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", parsed_metadata[:idp_cert_fingerprint] + assert_nil parsed_metadata[:security] + end + + it "can extract certificates multiple times in sequence" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata1 = idp_metadata_descriptor + idp_metadata2 = idp_metadata_descriptor4 + metadata1 = idp_metadata_parser.parse_to_hash(idp_metadata1) + metadata2 = idp_metadata_parser.parse_to_hash(idp_metadata2) + + assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", metadata1[:idp_cert_fingerprint] + assert_equal "CD:2B:2B:DA:FF:F5:DB:64:10:7C:AC:FD:FE:0F:CB:5D:73:5F:16:07", metadata2[:idp_cert_fingerprint] + end + end + + describe "parsing an IdP descriptor file with multiple signing certs" do + it "extract settings details from xml" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + + settings = idp_metadata_parser.parse(idp_metadata_descriptor2) + + assert_equal "https://hello.example.com/access/saml/idp.xml", settings.idp_entity_id + assert_equal "https://hello.example.com/access/saml/login", settings.idp_sso_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", settings.idp_sso_service_binding + assert_equal "https://hello.example.com/access/saml/logout", settings.idp_slo_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", settings.idp_slo_service_binding + assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", settings.name_identifier_format + assert_equal ["AuthToken", "SSOStartPage"], settings.idp_attribute_names + + assert_nil settings.idp_cert_fingerprint + assert_nil settings.idp_cert + assert_equal 2, settings.idp_cert_multi.size + assert settings.idp_cert_multi.key?(:signing) + assert_equal 2, settings.idp_cert_multi[:signing].size + assert settings.idp_cert_multi.key?(:encryption) + assert_equal 1, settings.idp_cert_multi[:encryption].size + end + end + + describe "download and parse IdP descriptor file" do + before do + mock_response = MockSuccessResponse.new + mock_response.body = idp_metadata_descriptor + @url = "https://example.com" + uri = URI(@url) + + @http = Net::HTTP.new(uri.host, uri.port) + Net::HTTP.expects(:new).returns(@http) + @http.expects(:request).returns(mock_response) + end + + it "extract settings from remote xml" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + settings = idp_metadata_parser.parse_remote(@url) + + assert_equal "https://hello.example.com/access/saml/idp.xml", settings.idp_entity_id + assert_equal "https://hello.example.com/access/saml/login", settings.idp_sso_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", settings.idp_sso_service_binding + assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", settings.idp_cert_fingerprint + assert_equal "https://hello.example.com/access/saml/logout", settings.idp_slo_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", settings.idp_slo_service_binding + assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", settings.name_identifier_format + assert_equal ["AuthToken", "SSOStartPage"], settings.idp_attribute_names + assert_equal '2014-04-17T18:02:33.910Z', settings.valid_until + assert_equal OpenSSL::SSL::VERIFY_PEER, @http.verify_mode + end + + it "accept self signed certificate if insturcted" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata_parser.parse_remote(@url, false) + + assert_equal OpenSSL::SSL::VERIFY_NONE, @http.verify_mode + end + end + + describe "download and parse IdP descriptor file into an Hash" do + before do + mock_response = MockSuccessResponse.new + mock_response.body = idp_metadata_descriptor + @url = "https://example.com" + uri = URI(@url) + + @http = Net::HTTP.new(uri.host, uri.port) + Net::HTTP.expects(:new).returns(@http) + @http.expects(:request).returns(mock_response) + end + + it "extract settings from remote xml" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + parsed_metadata = idp_metadata_parser.parse_remote_to_hash(@url) + + assert_equal "https://hello.example.com/access/saml/idp.xml", parsed_metadata[:idp_entity_id] + assert_equal "https://hello.example.com/access/saml/login", parsed_metadata[:idp_sso_service_url] + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", parsed_metadata[:idp_sso_service_binding] + assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", parsed_metadata[:idp_cert_fingerprint] + assert_equal "https://hello.example.com/access/saml/logout", parsed_metadata[:idp_slo_service_url] + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", parsed_metadata[:idp_slo_service_binding] + assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", parsed_metadata[:name_identifier_format] + assert_equal ["AuthToken", "SSOStartPage"], parsed_metadata[:idp_attribute_names] + assert_equal '2014-04-17T18:02:33.910Z', parsed_metadata[:valid_until] + assert_equal OpenSSL::SSL::VERIFY_PEER, @http.verify_mode + end + + it "accept self signed certificate if insturcted" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + idp_metadata_parser.parse_remote_to_hash(@url, false) + + assert_equal OpenSSL::SSL::VERIFY_NONE, @http.verify_mode + end + end + + describe "download failure cases" do + it "raises an exception when the url has no scheme" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + + exception = assert_raises(ArgumentError) do + idp_metadata_parser.parse_remote("blahblah") + end + + assert_equal("url must begin with http or https", exception.message) + end + + it "raises an exception when unable to download metadata" do + mock_response = MockFailureResponse.new + @url = "https://example.com" + uri = URI(@url) + + @http = Net::HTTP.new(uri.host, uri.port) + Net::HTTP.expects(:new).returns(@http) + @http.expects(:request).returns(mock_response) + + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + + exception = assert_raises(OneLogin::RubySaml::HttpError) do + idp_metadata_parser.parse_remote("https://hello.example.com/access/saml/idp.xml") + end + + assert_match("Failed to fetch idp metadata", exception.message) + end + end + + describe "parsing metadata with and without ValidUntil and CacheDuration" do + before do + @idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + end + + it "if no ValidUntil or CacheDuration return nothing" do + settings = @idp_metadata_parser.parse(idp_metadata_descriptor3) + assert_nil settings.valid_until + end + + it "if ValidUntil and not CacheDuration return ValidUntil value" do + settings = @idp_metadata_parser.parse(idp_metadata_descriptor) + assert_equal '2014-04-17T18:02:33.910Z', settings.valid_until + end + + it "if no ValidUntil but CacheDuration return CacheDuration converted in ValidUntil" do + return if RUBY_VERSION < '1.9' + Timecop.freeze(Time.parse("2020-01-02T10:02:33Z", Time.now.utc)) do + settings = @idp_metadata_parser.parse(idp_metadata_descriptor5) + assert_equal '2020-01-03T10:02:33Z', settings.valid_until + end + end + + it "if ValidUntil and CacheDuration return the sooner timestamp" do + return if RUBY_VERSION < '1.9' + + Timecop.freeze(Time.parse("2020-01-01T10:12:55Z", Time.now.utc)) do + settings = @idp_metadata_parser.parse(idp_metadata_descriptor6) + assert_equal '2020-01-03T10:12:55Z', settings.valid_until + end + + Timecop.freeze(Time.parse("2020-01-01T10:12:55Z", Time.now.utc)) do + settings = @idp_metadata_parser.parse(idp_metadata_descriptor6) + assert_equal '2020-01-03T10:12:55Z', settings.valid_until + end + + Timecop.freeze(Time.parse("2020-01-03T10:12:55Z", Time.now.utc)) do + settings = @idp_metadata_parser.parse(idp_metadata_descriptor6) + assert_equal '2020-01-04T18:02:33.910Z', settings.valid_until + end + end + + end + + describe "parsing metadata with many entity descriptors" do + before do + @idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + @idp_metadata = idp_metadata_multiple_descriptors2 + @settings = @idp_metadata_parser.parse(@idp_metadata) + end + + it "should find first descriptor" do + assert_equal "https://foo.example.com/access/saml/idp.xml", @settings.idp_entity_id + end + + it "should find named descriptor" do + entity_id = "https://bar.example.com/access/saml/idp.xml" + settings = @idp_metadata_parser.parse( + @idp_metadata, :entity_id => entity_id + ) + assert_equal entity_id, settings.idp_entity_id + end + + it "should retreive data" do + assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", @settings.name_identifier_format + assert_equal "https://hello.example.com/access/saml/login", @settings.idp_sso_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", @settings.idp_sso_service_binding + assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", @settings.idp_cert_fingerprint + assert_equal "https://hello.example.com/access/saml/logout", @settings.idp_slo_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", @settings.idp_slo_service_binding + assert_equal ["AuthToken", "SSOStartPage"], @settings.idp_attribute_names + assert_equal '2014-04-17T18:02:33.910Z', @settings.valid_until + end + + it "should handle multiple descriptors at once" do + settings = @idp_metadata_parser.parse_to_array(@idp_metadata) + assert_equal "https://foo.example.com/access/saml/idp.xml", settings.first[:idp_entity_id] + assert_equal "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72", settings.first[:idp_cert_fingerprint] + assert_equal '2014-04-17T18:02:33.910Z', settings.first[:valid_until] + assert_equal "https://bar.example.com/access/saml/idp.xml", settings.last[:idp_entity_id] + assert_equal "08:EB:6E:60:A2:14:4E:89:EC:FA:05:74:9D:72:BF:5D:BE:54:F0:1A", settings.last[:idp_cert_fingerprint] + assert_equal '2014-04-17T18:02:33.910Z', settings.last[:valid_until] + end + end + + describe "parsing metadata with no IDPSSODescriptor element" do + before do + @idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + @idp_metadata = no_idp_metadata_descriptor + end + + it "raise due no IDPSSODescriptor element" do + assert_raises(ArgumentError) { @idp_metadata_parser.parse(@idp_metadata) } + end + end + + describe "parsing metadata with IDPSSODescriptor with multiple certs" do + before do + @idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + @idp_metadata = idp_metadata_multiple_certs + @settings = @idp_metadata_parser.parse(@idp_metadata) + end + + it "should return a idp_cert_multi and no idp_cert and no idp_cert_fingerprint" do + assert_nil @settings.idp_cert + assert_nil @settings.idp_cert_fingerprint + + expected_multi_cert = {} + expected_multi_cert[:signing] = ["MIIEZTCCA02gAwIBAgIUPyy/A3bZAZ4m28PzEUUoT7RJhxIwDQYJKoZIhvcNAQEF +BQAwcjELMAkGA1UEBhMCVVMxKzApBgNVBAoMIk9uZUxvZ2luIFRlc3QgKHNnYXJj +aWEtdXMtcHJlcHJvZCkxFTATBgNVBAsMDE9uZUxvZ2luIElkUDEfMB0GA1UEAwwW +T25lTG9naW4g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UwEwYDVQQL +DAxPbmVMb2dpbiBJZFAxHzAdBgNVBAMMFk9uZUxvZ2luIEFjY291bnQgODkxNDaC +FD8svwN22QGeJtvD8xFFKE+0SYcSMA4GA1UdDwEB/wQEAwIHgDANBgkqhkiG9w0B +AQUFAAOCAQEAQhB4q9jrycwbHrDSoYR1X4LFFzvJ9Us75wQquRHXpdyS9D6HUBXM +GI6ahPicXCQrfLgN8vzMIiqZqfySXXv/8/dxe/X4UsWLYKYJHDJmxXD5EmWTa65c +hjkeP1oJAc8f3CKCpcP2lOBTthbnk2fEVAeLHR4xNdQO0VvGXWO9BliYPpkYqUIB +vlm+Fg9mF7AM/Uagq2503XXIE1Lq//HON68P10vNMwLSKOtYLsoTiCnuIKGJqG37 +MsZVjQ1ZPRcO+LSLkq0i91gFxrOrVCrgztX4JQi5XkvEsYZGIXXjwHqxTVyt3adZ +WQO0LPxPqRiUqUzyhDhLo/xXNrHCu4VbMw=="] + + assert_equal expected_multi_cert, @settings.idp_cert_multi + assert_equal "https://idp.examle.com/saml/metadata", @settings.idp_entity_id + assert_equal "urn:oasis:names:tc:SAML:2.0:nameid-format:transient", @settings.name_identifier_format + assert_equal "https://idp.examle.com/saml/sso", @settings.idp_sso_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", @settings.idp_sso_service_binding + assert_equal "https://idp.examle.com/saml/slo", @settings.idp_slo_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", @settings.idp_slo_service_binding + end + end + + describe "parsing metadata with IDPSSODescriptor with multiple signing certs" do + before do + @idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + @idp_metadata = idp_metadata_multiple_signing_certs + @settings = @idp_metadata_parser.parse(@idp_metadata) + end + + it "should return a idp_cert_multi and no idp_cert and no idp_cert_fingerprint" do + assert_nil @settings.idp_cert + assert_nil @settings.idp_cert_fingerprint + + expected_multi_cert = {} + expected_multi_cert[:signing] = ["MIIEZTCCA02gAwIB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0ZXVjdmei9yKzIxL2F3VG5EVjlzTVlRcXVJUllZeTdiRzByMU9iaXdkb3ZudGsKN2dGSTA2WjB2WmFjREU1Ym9xVUNBd0VBQWFPQ0FTVXdnZ0VoTUFrR0ExVWRFd1FDTUFBd0N3WURWUjBQQkFRRApBZ1VnTUIwR0ExVWREZ1FXQkJTUk9OOEdKOG8rOGpnRnRqa3R3WmRxeDZCUnlUQVRCZ05WSFNVRUREQUtCZ2dyCkJnRUZCUWNEQVRBZEJnbGdoa2dCaHZoQ0FRMEVFQllPVkdWemRDQllOVEE1SUdObGNuUXdnYk1HQTFVZEl3U0IKcXpDQnFJQVVrVGpmQmlmS1B2STRCYlk1TGNHWGFzZWdVY21oZ1l5a2dZa3dnWVl4Q3pBSkJnTlZCQVlUQWtGVgpNUXd3Q2dZRFZRUUlFd05PVTFjeER6QU5CZ05WQkFjVEJsTjVaRzVsZVRFTU1Bb0dBMVVFQ2d3RFVFbFVNUWt3CkJ3WURWUVFMREFBeEdEQVdCZ05WQkFNTUQyeGhkM0psYm1ObGNHbDBMbU52YlRFbE1DTUdDU3FHU0liM0RRRUoKQVF3V2JHRjNjbVZ1WTJVdWNHbDBRR2R0WVdsc0xtTnZiWUlCQVRBTkJna3Foa2lHOXcwQkFRc0ZBQU9CZ1FDRQpUQWVKVERTQVc2ejFVRlRWN1FyZWg0VUxGT1JhajkrZUN1RjNLV0RIYyswSVFDajlyZG5ERzRRL3dmNy9yYVEwCkpuUFFDU0NkclBMSmV5b1BIN1FhVHdvYUY3ZHpWdzRMQ3N5TkpURld4NGNNNTBWdzZSNWZET2dpQzhic2ZmUzgKQkptb3VscnJaRE5OVmpHOG1XNmNMeHJZdlZRT3JSVmVjQ0ZJZ3NzQ2JBPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo="] + + assert_equal expected_multi_cert, @settings.idp_cert_multi + assert_equal "https://idp.examle.com/saml/metadata", @settings.idp_entity_id + assert_equal "urn:oasis:names:tc:SAML:2.0:nameid-format:transient", @settings.name_identifier_format + assert_equal "https://idp.examle.com/saml/sso", @settings.idp_sso_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", @settings.idp_sso_service_binding + assert_equal "https://idp.examle.com/saml/slo", @settings.idp_slo_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", @settings.idp_slo_service_binding + end + end + + describe "parsing metadata with IDPSSODescriptor with same signature cert and encrypt cert" do + before do + @idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + @idp_metadata = idp_metadata_same_sign_and_encrypt_cert + @settings = @idp_metadata_parser.parse(@idp_metadata) + end + + let(:expected_cert) do + "MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJVUzET +MBEGA1UECAwKQ2FsaWZvcm5pYTEVMBMGA1UEBwwMU2FudGEgTW9uaWNhMREwDwYD +VQQKDAhPbmVMb2dpbjEZMBcGA1UEAwwQYXBwLm9uZWxvZ2luLmNvbTAeFw0xMzA2 +MDUxNzE2MjBaFw0xODA2MDUxNzE2MjBaMGcxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +DApDYWxpZm9ybmlhMRUwEwYDVQQHDAxTYW50YSBNb25pY2ExETAPBgNVBAoMCE9u +ZUxvZ2luMRkwFwYDVQQDDBBhcHAub25lbG9naW4uY29tMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEAse8rnep4qL2GmhH10pMQyJ2Jae+AQHyfgVjaQZ7Z +0QQog5jX91vcJRSMi0XWJnUtOr6lF0dq1+yckjZ92wyLrH+7fvngNO1aV4Mjk9sT +gf+iqMrae6y6fRxDt9PXrEFVjvd3vv7QTJf2FuIPy4vVP06Dt8EMkQIr8rmLmU0m +Tr1k2DkrdtdlCuNFTXuAu3QqfvNCRrRwfNObn9MP6JeOUdcGLJsBjGF8exfcN1SF +zRF0JFr3dmOlx761zK5liD0T1sYWnDquatj/JD9fZMbKecBKni1NglH/LVd+b6aJ +UAr5LulERULUjLqYJRKW31u91/4Qazdo9tbvwqyFxaoUrwIDAQABo4HUMIHRMAwG +A1UdEwEB/wQCMAAwHQYDVR0OBBYEFPWcXvQSlTXnzZD2xziuoUvrrDedMIGRBgNV +HSMEgYkwgYaAFPWcXvQSlTXnzZD2xziuoUvrrDedoWukaTBnMQswCQYDVQQGEwJV +UzETMBEGA1UECAwKQ2FsaWZvcm5pYTEVMBMGA1UEBwwMU2FudGEgTW9uaWNhMREw +DwYDVQQKDAhPbmVMb2dpbjEZMBcGA1UEAwwQYXBwLm9uZWxvZ2luLmNvbYIBATAO +BgNVHQ8BAf8EBAMCBPAwDQYJKoZIhvcNAQEFBQADggEBAB/8xe3rzqXQVxzHyAHu +AuPa73ClDoL1cko0Fp8CGcqEIyj6Te9gx5z6wyfv+Lo8RFvBLlnB1lXqbC+fTGcV +gG/4oKLJ5UwRFxInqpZPnOAudVNnd0PYOODn9FWs6u+OTIQIaIcPUv3MhB9lwHIJ +sTk/bs9xcru5TPyLIxLLd6ib/pRceKH2mTkzUd0DYk9CQNXXeoGx/du5B9nh3ClP +TbVakRzl3oswgI5MQIphYxkW70SopEh4kOFSRE1ND31NNIq1YrXlgtkguQBFsZWu +QOPR6cEwFZzP0tHTYbI839WgxX6hfhIUTUz6mLqq4+3P4BG3+1OXeVDg63y8Uh78 +1sE=" + end + + it "should return idp_cert and idp_cert_fingerprint and no idp_cert_multi" do + assert_equal(expected_cert, @settings.idp_cert) + assert_equal("2D:A9:40:88:28:EE:67:BB:4A:5B:E0:58:A7:CC:71:95:2D:1B:C9:D3", @settings.idp_cert_fingerprint) + assert_equal({ :signing => [expected_cert], :encryption => [expected_cert] }, @settings.idp_cert_multi) + assert_equal("https://app.onelogin.com/saml/metadata/383123", @settings.idp_entity_id) + assert_equal("urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", @settings.name_identifier_format) + assert_equal("https://app.onelogin.com/trust/saml2/http-post/sso/383123", @settings.idp_sso_service_url) + assert_nil(@settings.idp_slo_service_url) + # TODO: next line can be changed to `assert_nil @settings.idp_slo_service_binding` after :embed_sign is removed. + assert_nil(@settings.instance_variable_get('@idp_slo_service_binding')) + end + end + + describe "parsing metadata with IDPSSODescriptor with different signature cert and encrypt cert" do + before do + @idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + @idp_metadata = idp_metadata_different_sign_and_encrypt_cert + @settings = @idp_metadata_parser.parse(@idp_metadata) + end + + it "should return a idp_cert_multi and no idp_cert and no idp_cert_fingerprint" do + assert_nil @settings.idp_cert + assert_nil @settings.idp_cert_fingerprint + + expected_multi_cert = {} + expected_multi_cert[:signing] = ["MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJVUzET +MBEGA1UECAwKQ2FsaWZvcm5pYTEVMBMGA1UEBwwMU2FudGEgTW9uaWNhMREwDwYD +VQQKDAhPbmVMb2dpbjEZMBcGA1UEAwwQYXBwLm9uZWxvZ2luLmNvbTAeFw0xMzA2 +MDUxNzE2MjBaFw0xODA2MDUxNzE2MjBaMGcxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +DApDYWxpZm9ybmlhMRUwEwYDVQQHDAxTYW50YSBNb25pY2ExETAPBgNVBAoMCE9u +ZUxvZ2luMRkwFwYDVQQDDBBhcHAub25lbG9naW4uY29tMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEAse8rnep4qL2GmhH10pMQyJ2Jae+AQHyfgVjaQZ7Z +0QQog5jX91vcJRSMi0XWJnUtOr6lF0dq1+yckjZ92wyLrH+7fvngNO1aV4Mjk9sT +gf+iqMrae6y6fRxDt9PXrEFVjvd3vv7QTJf2FuIPy4vVP06Dt8EMkQIr8rmLmU0m +Tr1k2DkrdtdlCuNFTXuAu3QqfvNCRrRwfNObn9MP6JeOUdcGLJsBjGF8exfcN1SF +zRF0JFr3dmOlx761zK5liD0T1sYWnDquatj/JD9fZMbKecBKni1NglH/LVd+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XXIE1Lq//HON68P10vNMwLSKOtYLsoTiCnuIKGJqG37 +MsZVjQ1ZPRcO+LSLkq0i91gFxrOrVCrgztX4JQi5XkvEsYZGIXXjwHqxTVyt3adZ +WQO0LPxPqRiUqUzyhDhLo/xXNrHCu4VbMw=="] + + assert_equal expected_multi_cert, @settings.idp_cert_multi + assert_equal "https://app.onelogin.com/saml/metadata/383123", @settings.idp_entity_id + assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", @settings.name_identifier_format + assert_equal "https://app.onelogin.com/trust/saml2/http-post/sso/383123", @settings.idp_sso_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", @settings.idp_sso_service_binding + assert_nil @settings.idp_slo_service_url + # TODO: next line can be changed to `assert_nil @settings.idp_slo_service_binding` after :embed_sign is removed. + assert_nil @settings.instance_variable_get('@idp_slo_service_binding') + end + end + + describe "metadata with different singlelogout response location" do + it "should return the responselocation if it exists" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + + settings = idp_metadata_parser.parse(idp_different_slo_response_location) + + assert_equal "https://hello.example.com/access/saml/logout", settings.idp_slo_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", settings.idp_slo_service_binding + assert_equal "https://hello.example.com/access/saml/logout/return", settings.idp_slo_response_service_url + end + + it "should set the responselocation to nil if it doesnt exist" do + idp_metadata_parser = OneLogin::RubySaml::IdpMetadataParser.new + + settings = idp_metadata_parser.parse(idp_without_slo_response_location) + + assert_equal "https://hello.example.com/access/saml/logout", settings.idp_slo_service_url + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", settings.idp_slo_service_binding + assert_nil settings.idp_slo_response_service_url + end + end +end diff --git a/ruby-saml-custom/test/logging_test.rb b/ruby-saml-custom/test/logging_test.rb new file mode 100644 index 0000000..ba1070d --- /dev/null +++ b/ruby-saml-custom/test/logging_test.rb @@ -0,0 +1,62 @@ +require File.expand_path(File.join(File.dirname(__FILE__), "test_helper")) + +require 'onelogin/ruby-saml/logging' + +class LoggingTest < Minitest::Test + + describe "Logging" do + before do + OneLogin::RubySaml::Logging.logger = nil + end + + after do + OneLogin::RubySaml::Logging.logger = ::TEST_LOGGER + end + + describe "given no specific logging setup" do + it "prints to stdout" do + OneLogin::RubySaml::Logging::DEFAULT_LOGGER.expects(:debug).with('hi mom') + OneLogin::RubySaml::Logging.debug('hi mom') + end + end + + describe "given a Rails app" do + let(:logger) { mock('Logger') } + + before do + ::Rails = mock('Rails module') + ::Rails.stubs(:logger).returns(logger) + end + + after do + Object.instance_eval { remove_const(:Rails) } + end + + it "delegates to Rails" do + logger.expects(:debug).with('hi mom') + logger.expects(:info).with('sup?') + + OneLogin::RubySaml::Logging.debug('hi mom') + OneLogin::RubySaml::Logging.info('sup?') + end + end + + describe "given a specific Logger" do + let(:logger) { mock('Logger') } + + before { OneLogin::RubySaml::Logging.logger = logger } + + after do + OneLogin::RubySaml::Logging.logger = ::TEST_LOGGER + end + + it "delegates to the object" do + logger.expects(:debug).with('hi mom') + logger.expects(:info).with('sup?') + + OneLogin::RubySaml::Logging.debug('hi mom') + OneLogin::RubySaml::Logging.info('sup?') + end + end + end +end diff --git a/ruby-saml-custom/test/logout_requests/invalid_slo_request.xml b/ruby-saml-custom/test/logout_requests/invalid_slo_request.xml new file mode 100644 index 0000000..8df2ea6 --- /dev/null +++ b/ruby-saml-custom/test/logout_requests/invalid_slo_request.xml @@ -0,0 +1,6 @@ + +https://app.onelogin.com/saml/metadata/SOMEACCOUNT +https://app.onelogin.com/saml/metadata/SOMEACCOUNT +someone@example.org +someone2@example.org + diff --git a/ruby-saml-custom/test/logout_requests/slo_request.xml b/ruby-saml-custom/test/logout_requests/slo_request.xml new file mode 100644 index 0000000..81a8d9a --- /dev/null +++ b/ruby-saml-custom/test/logout_requests/slo_request.xml @@ -0,0 +1,4 @@ + + https://app.onelogin.com/saml/metadata/SOMEACCOUNT + someone@example.org + diff --git a/ruby-saml-custom/test/logout_requests/slo_request.xml.base64 b/ruby-saml-custom/test/logout_requests/slo_request.xml.base64 new file mode 100644 index 0000000..6e7691f --- /dev/null +++ b/ruby-saml-custom/test/logout_requests/slo_request.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOkxvZ291dFJlcXVlc3QgVmVyc2lvbj0nMi4wJyBJRD0nX2MwMzQ4OTUwLTkzNWItMDEzMS0xMDYwLTc4MmJjYjU2ZmNhYScgeG1sbnM6c2FtbHA9J3VybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCcgSXNzdWVJbnN0YW50PScyMDE0LTAzLTIxVDE5OjIwOjEzJz4NCiAgPHNhbWw6SXNzdWVyIHhtbG5zOnNhbWw9J3VybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24nPmh0dHBzOi8vYXBwLm9uZWxvZ2luLmNvbS9zYW1sL21ldGFkYXRhL1NPTUVBQ0NPVU5UPC9zYW1sOklzc3Vlcj4NCiAgPHNhbWw6TmFtZUlEIHhtbG5zOnNhbWw9J3VybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24nPnNvbWVvbmVAZXhhbXBsZS5vcmc8L3NhbWw6TmFtZUlEPg0KPC9zYW1scDpMb2dvdXRSZXF1ZXN0Pg== \ No newline at end of file diff --git a/ruby-saml-custom/test/logout_requests/slo_request_deflated.xml.base64 b/ruby-saml-custom/test/logout_requests/slo_request_deflated.xml.base64 new file mode 100644 index 0000000..d00f726 --- /dev/null +++ b/ruby-saml-custom/test/logout_requests/slo_request_deflated.xml.base64 @@ -0,0 +1 @@ +ndG7asMwFIDhvdB38KZJlmTHaSxs05B0COQCTdq1yKrqGqxLdWTI41dJOpgOHToKDv93DqpA6MHxre3sGJ7V16ggJK/KQ29NjbKUomSzrtGbpPlsURYUl3nRYspyhhmdU/ywyFrZFvMPKQRKznowwK/JGo3ecCugB26EVsCD5MflbstjlDtvg5V2iHWAUW0MBGFCBCmbYZrjjJ1YyTPKWY6a+7skqS5Rfh32E+ZvRQAoH+IlqPkMwQEnRDiXWqMG2/UmlVaTS4VoFcS7CIIcD7un5Wp1eNmfKjIhJzvsI7NZ/2cHsFpF+1GdhXaDSq3vfpBbMyK396//aL4B \ No newline at end of file diff --git a/ruby-saml-custom/test/logout_requests/slo_request_with_name_id_format.xml b/ruby-saml-custom/test/logout_requests/slo_request_with_name_id_format.xml new file mode 100644 index 0000000..ec2526d --- /dev/null +++ b/ruby-saml-custom/test/logout_requests/slo_request_with_name_id_format.xml @@ -0,0 +1,4 @@ + + https://app.onelogin.com/saml/metadata/SOMEACCOUNT + someone@example.org + diff --git a/ruby-saml-custom/test/logout_requests/slo_request_with_session_index.xml b/ruby-saml-custom/test/logout_requests/slo_request_with_session_index.xml new file mode 100644 index 0000000..30d1377 --- /dev/null +++ b/ruby-saml-custom/test/logout_requests/slo_request_with_session_index.xml @@ -0,0 +1,5 @@ + +https://app.onelogin.com/saml/metadata/SOMEACCOUNT +someone@example.org +_ea853497-c58a-408a-bc23-c849752d9741 + diff --git a/ruby-saml-custom/test/logout_responses/logoutresponse_fixtures.rb b/ruby-saml-custom/test/logout_responses/logoutresponse_fixtures.rb new file mode 100644 index 0000000..c111022 --- /dev/null +++ b/ruby-saml-custom/test/logout_responses/logoutresponse_fixtures.rb @@ -0,0 +1,86 @@ +#encoding: utf-8 + +def default_logout_response_opts + { + :uuid => "_28024690-000e-0130-b6d2-38f6b112be8b", + :issue_instant => Time.now.strftime('%Y-%m-%dT%H:%M:%SZ'), + :settings => settings + } +end + +def valid_logout_response_document(opts = {}) + opts = default_logout_response_opts.merge(opts) + + " + #{opts[:settings].issuer} + + + + + " +end + +def unsuccessful_logout_response_document(opts = {}) + opts = default_logout_response_opts.merge(opts) + + " + #{opts[:settings].issuer} + + + + + " +end + +def unsuccessful_logout_response_with_message_document(opts = {}) + opts = default_logout_response_opts.merge(opts) + + " + #{opts[:settings].issuer} + + + + Logoutrequest expired + + " +end + +def invalid_xml_logout_response_document + " + " +end + +def settings + @settings ||= OneLogin::RubySaml::Settings.new( + { + :assertion_consumer_service_url => "http://app.muda.no/sso/consume", + :single_logout_service_url => "http://app.muda.no/sso/consume_logout", + :issuer => "http://app.muda.no", + :sp_name_qualifier => "http://sso.muda.no", + :idp_sso_service_url => "http://sso.muda.no/sso", + :idp_slo_service_url => "http://sso.muda.no/slo", + :idp_cert_fingerprint => "00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00", + :name_identifier_format => "urn:oasis:names:tc:SAML:2.0:nameid-format:transient", + } + ) +end diff --git a/ruby-saml-custom/test/logoutrequest_test.rb b/ruby-saml-custom/test/logoutrequest_test.rb new file mode 100644 index 0000000..4e37aef --- /dev/null +++ b/ruby-saml-custom/test/logoutrequest_test.rb @@ -0,0 +1,338 @@ +require File.expand_path(File.join(File.dirname(__FILE__), "test_helper")) + +require 'onelogin/ruby-saml/logoutrequest' + +class RequestTest < Minitest::Test + + describe "Logoutrequest" do + let(:settings) { OneLogin::RubySaml::Settings.new } + + before do + settings.idp_slo_service_url = "http://unauth.com/logout" + settings.name_identifier_value = "f00f00" + end + + it "create the deflated SAMLRequest URL parameter" do + unauth_url = OneLogin::RubySaml::Logoutrequest.new.create(settings) + assert_match /^http:\/\/unauth\.com\/logout\?SAMLRequest=/, unauth_url + + inflated = decode_saml_request_payload(unauth_url) + assert_match /^ nil }) + assert_match /&hello=$/, unauth_url + + unauth_url = OneLogin::RubySaml::Logoutrequest.new.create(settings, { :foo => "bar" }) + assert_match /&foo=bar$/, unauth_url + end + + it "RelayState cases" do + unauth_url = OneLogin::RubySaml::Logoutrequest.new.create(settings, { :RelayState => nil }) + assert !unauth_url.include?('RelayState') + + unauth_url = OneLogin::RubySaml::Logoutrequest.new.create(settings, { :RelayState => "http://example.com" }) + assert unauth_url.include?('&RelayState=http%3A%2F%2Fexample.com') + + unauth_url = OneLogin::RubySaml::Logoutrequest.new.create(settings, { 'RelayState' => nil }) + assert !unauth_url.include?('RelayState') + + unauth_url = OneLogin::RubySaml::Logoutrequest.new.create(settings, { 'RelayState' => "http://example.com" }) + assert unauth_url.include?('&RelayState=http%3A%2F%2Fexample.com') + end + + it "set sessionindex" do + settings.idp_slo_service_url = "http://example.com" + sessionidx = OneLogin::RubySaml::Utils.uuid + settings.sessionindex = sessionidx + + unauth_url = OneLogin::RubySaml::Logoutrequest.new.create(settings, { :nameid => "there" }) + inflated = decode_saml_request_payload(unauth_url) + + assert_match /), inflated + end + + it "set name_identifier_value" do + settings.name_identifier_format = "transient" + name_identifier_value = "abc123" + settings.name_identifier_value = name_identifier_value + + unauth_url = OneLogin::RubySaml::Logoutrequest.new.create(settings, { :nameid => "there" }) + inflated = decode_saml_request_payload(unauth_url) + + assert_match /), inflated + end + + describe "when the target url doesn't contain a query string" do + it "create the SAMLRequest parameter correctly" do + unauth_url = OneLogin::RubySaml::Logoutrequest.new.create(settings) + assert_match /^http:\/\/unauth.com\/logout\?SAMLRequest/, unauth_url + end + end + + describe "when the target url contains a query string" do + it "create the SAMLRequest parameter correctly" do + settings.idp_slo_service_url = "http://example.com?field=value" + + unauth_url = OneLogin::RubySaml::Logoutrequest.new.create(settings) + assert_match /^http:\/\/example.com\?field=value&SAMLRequest/, unauth_url + end + end + + describe "consumation of logout may need to track the transaction" do + it "have access to the request uuid" do + settings.idp_slo_service_url = "http://example.com?field=value" + + unauth_req = OneLogin::RubySaml::Logoutrequest.new + unauth_url = unauth_req.create(settings) + + inflated = decode_saml_request_payload(unauth_url) + assert_match %r[ID='#{unauth_req.uuid}'], inflated + end + end + + describe "playgin with preix" do + it "creates request with ID prefixed with default '_'" do + request = OneLogin::RubySaml::Logoutrequest.new + + assert_match /^_/, request.uuid + end + + it "creates request with ID is prefixed, when :id_prefix is passed" do + OneLogin::RubySaml::Utils::set_prefix("test") + request = OneLogin::RubySaml::Logoutrequest.new + assert_match /^test/, request.uuid + OneLogin::RubySaml::Utils::set_prefix("_") + end + end + + describe "signing with HTTP-POST binding" do + + before do + settings.security[:logout_requests_signed] = true + settings.idp_slo_service_binding = :post + settings.idp_sso_service_binding = :redirect + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + end + + it "doesn't sign through create_xml_document" do + unauth_req = OneLogin::RubySaml::Logoutrequest.new + inflated = unauth_req.create_xml_document(settings).to_s + + refute_match %r[([a-zA-Z0-9/+=]+)], inflated + refute_match %r[], inflated + refute_match %r[], inflated + end + + it "sign unsigned request" do + unauth_req = OneLogin::RubySaml::Logoutrequest.new + unauth_req_doc = unauth_req.create_xml_document(settings) + inflated = unauth_req_doc.to_s + + refute_match %r[([a-zA-Z0-9/+=]+)], inflated + refute_match %r[], inflated + refute_match %r[], inflated + + inflated = unauth_req.sign_document(unauth_req_doc, settings).to_s + + assert_match %r[([a-zA-Z0-9/+=]+)], inflated + assert_match %r[], inflated + assert_match %r[], inflated + end + + it "signs through create_logout_request_xml_doc" do + unauth_req = OneLogin::RubySaml::Logoutrequest.new + inflated = unauth_req.create_logout_request_xml_doc(settings).to_s + + assert_match %r[([a-zA-Z0-9/+=]+)], inflated + assert_match %r[], inflated + assert_match %r[], inflated + end + + it "created a signed logout request" do + settings.compress_request = true + + unauth_req = OneLogin::RubySaml::Logoutrequest.new + unauth_url = unauth_req.create(settings) + + inflated = decode_saml_request_payload(unauth_url) + assert_match %r[([a-zA-Z0-9/+=]+)], inflated + assert_match %r[], inflated + assert_match %r[], inflated + end + + it "create a signed logout request with 256 digest and signature method" do + settings.compress_request = false + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA256 + settings.security[:digest_method] = XMLSecurity::Document::SHA256 + + params = OneLogin::RubySaml::Logoutrequest.new.create_params(settings) + request_xml = Base64.decode64(params["SAMLRequest"]) + + assert_match %r[([a-zA-Z0-9/+=]+)], request_xml + assert_match %r[], request_xml + assert_match %r[], request_xml + end + + it "create a signed logout request with 512 digest and signature method RSA_SHA384" do + settings.compress_request = false + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA384 + settings.security[:digest_method] = XMLSecurity::Document::SHA512 + + params = OneLogin::RubySaml::Logoutrequest.new.create_params(settings) + request_xml = Base64.decode64(params["SAMLRequest"]) + + assert_match %r[([a-zA-Z0-9/+=]+)], request_xml + assert_match %r[], request_xml + assert_match %r[], request_xml + end + end + + describe "signing with HTTP-Redirect binding" do + + let(:cert) { OpenSSL::X509::Certificate.new(ruby_saml_cert_text) } + + before do + settings.security[:logout_requests_signed] = true + settings.idp_slo_service_binding = :redirect + settings.idp_sso_service_binding = :post + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + end + + it "create a signature parameter with RSA_SHA1 / SHA1 and validate it" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + + params = OneLogin::RubySaml::Logoutrequest.new.create_params(settings, :RelayState => 'http://example.com') + assert params['SAMLRequest'] + assert params[:RelayState] + assert params['Signature'] + assert_equal params['SigAlg'], XMLSecurity::Document::RSA_SHA1 + + query_string = "SAMLRequest=#{CGI.escape(params['SAMLRequest'])}" + query_string << "&RelayState=#{CGI.escape(params[:RelayState])}" + query_string << "&SigAlg=#{CGI.escape(params['SigAlg'])}" + + signature_algorithm = XMLSecurity::BaseDocument.new.algorithm(params['SigAlg']) + assert_equal signature_algorithm, OpenSSL::Digest::SHA1 + assert cert.public_key.verify(signature_algorithm.new, Base64.decode64(params['Signature']), query_string) + end + + it "create a signature parameter with RSA_SHA256 / SHA256 and validate it" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA256 + + params = OneLogin::RubySaml::Logoutrequest.new.create_params(settings, :RelayState => 'http://example.com') + assert params['Signature'] + assert_equal params['SigAlg'], XMLSecurity::Document::RSA_SHA256 + + query_string = "SAMLRequest=#{CGI.escape(params['SAMLRequest'])}" + query_string << "&RelayState=#{CGI.escape(params[:RelayState])}" + query_string << "&SigAlg=#{CGI.escape(params['SigAlg'])}" + + signature_algorithm = XMLSecurity::BaseDocument.new.algorithm(params['SigAlg']) + assert_equal signature_algorithm, OpenSSL::Digest::SHA256 + assert cert.public_key.verify(signature_algorithm.new, Base64.decode64(params['Signature']), query_string) + end + + it "create a signature parameter with RSA_SHA384 / SHA384 and validate it" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA384 + + params = OneLogin::RubySaml::Logoutrequest.new.create_params(settings, :RelayState => 'http://example.com') + assert params['Signature'] + assert_equal params['SigAlg'], XMLSecurity::Document::RSA_SHA384 + + query_string = "SAMLRequest=#{CGI.escape(params['SAMLRequest'])}" + query_string << "&RelayState=#{CGI.escape(params[:RelayState])}" + query_string << "&SigAlg=#{CGI.escape(params['SigAlg'])}" + + signature_algorithm = XMLSecurity::BaseDocument.new.algorithm(params['SigAlg']) + assert_equal signature_algorithm, OpenSSL::Digest::SHA384 + assert cert.public_key.verify(signature_algorithm.new, Base64.decode64(params['Signature']), query_string) + end + + it "create a signature parameter with RSA_SHA512 / SHA512 and validate it" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA512 + + params = OneLogin::RubySaml::Logoutrequest.new.create_params(settings, :RelayState => 'http://example.com') + assert params['Signature'] + assert_equal params['SigAlg'], XMLSecurity::Document::RSA_SHA512 + + query_string = "SAMLRequest=#{CGI.escape(params['SAMLRequest'])}" + query_string << "&RelayState=#{CGI.escape(params[:RelayState])}" + query_string << "&SigAlg=#{CGI.escape(params['SigAlg'])}" + + signature_algorithm = XMLSecurity::BaseDocument.new.algorithm(params['SigAlg']) + assert_equal signature_algorithm, OpenSSL::Digest::SHA512 + assert cert.public_key.verify(signature_algorithm.new, Base64.decode64(params['Signature']), query_string) + end + end + + describe "DEPRECATED: signing with HTTP-POST binding via :embed_sign" do + + before do + # sign the logout request + settings.security[:logout_requests_signed] = true + settings.security[:embed_sign] = true + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + end + + it "created a signed logout request" do + settings.compress_request = true + + unauth_req = OneLogin::RubySaml::Logoutrequest.new + unauth_url = unauth_req.create(settings) + + inflated = decode_saml_request_payload(unauth_url) + assert_match %r[([a-zA-Z0-9/+=]+)], inflated + assert_match %r[], inflated + assert_match %r[], inflated + end + end + + describe "DEPRECATED: signing with HTTP-Redirect binding via :embed_sign" do + + let(:cert) { OpenSSL::X509::Certificate.new(ruby_saml_cert_text) } + + before do + settings.security[:logout_requests_signed] = true + settings.security[:embed_sign] = false + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + end + + it "create a signature parameter with RSA_SHA1 / SHA1 and validate it" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + + params = OneLogin::RubySaml::Logoutrequest.new.create_params(settings, :RelayState => 'http://example.com') + assert params['SAMLRequest'] + assert params[:RelayState] + assert params['Signature'] + assert_equal params['SigAlg'], XMLSecurity::Document::RSA_SHA1 + + query_string = "SAMLRequest=#{CGI.escape(params['SAMLRequest'])}" + query_string << "&RelayState=#{CGI.escape(params[:RelayState])}" + query_string << "&SigAlg=#{CGI.escape(params['SigAlg'])}" + + signature_algorithm = XMLSecurity::BaseDocument.new.algorithm(params['SigAlg']) + assert_equal signature_algorithm, OpenSSL::Digest::SHA1 + assert cert.public_key.verify(signature_algorithm.new, Base64.decode64(params['Signature']), query_string) + end + end + + describe "#manipulate request_id" do + it "be able to modify the request id" do + logoutrequest = OneLogin::RubySaml::Logoutrequest.new + request_id = logoutrequest.request_id + assert_equal request_id, logoutrequest.uuid + logoutrequest.uuid = "new_uuid" + assert_equal logoutrequest.request_id, logoutrequest.uuid + assert_equal "new_uuid", logoutrequest.request_id + end + end + end +end diff --git a/ruby-saml-custom/test/logoutresponse_test.rb b/ruby-saml-custom/test/logoutresponse_test.rb new file mode 100644 index 0000000..22d2347 --- /dev/null +++ b/ruby-saml-custom/test/logoutresponse_test.rb @@ -0,0 +1,425 @@ +require File.expand_path(File.join(File.dirname(__FILE__), "test_helper")) + +require 'onelogin/ruby-saml/logoutresponse' +require 'logout_responses/logoutresponse_fixtures' + +class RubySamlTest < Minitest::Test + + describe "Logoutresponse" do + + let(:valid_logout_response_without_settings) { OneLogin::RubySaml::Logoutresponse.new(valid_logout_response_document) } + let(:valid_logout_response) { OneLogin::RubySaml::Logoutresponse.new(valid_logout_response_document, settings) } + + describe "#new" do + it "raise an exception when response is initialized with nil" do + assert_raises(ArgumentError) { OneLogin::RubySaml::Logoutresponse.new(nil) } + end + it "default to empty settings" do + assert_nil valid_logout_response_without_settings.settings + end + it "accept constructor-injected settings" do + refute_nil valid_logout_response.settings + end + it "accept constructor-injected options" do + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(valid_logout_response_document, nil, { :foo => :bar} ) + assert !logoutresponse.options.empty? + end + it "support base64 encoded responses" do + generated_logout_response = valid_logout_response_document + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(Base64.encode64(generated_logout_response), settings) + assert_equal generated_logout_response, logoutresponse.response + end + end + + describe "#validate_structure" do + it "invalidates when the logout response has an invalid xml" do + settings.soft = true + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(invalid_xml_logout_response_document, settings) + assert !logoutresponse.send(:validate_structure) + assert_includes logoutresponse.errors, "Invalid SAML Logout Response. Not match the saml-schema-protocol-2.0.xsd" + end + + it "raise when the logout response has an invalid xml" do + settings.soft = false + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(invalid_xml_logout_response_document, settings) + assert_raises OneLogin::RubySaml::ValidationError do + logoutresponse.send(:validate_structure) + end + end + end + + describe "#validate" do + describe "when soft=true" do + before do + settings.soft = true + end + + it "validate the logout response" do + in_relation_to_request_id = random_id + opts = { :matches_request_id => in_relation_to_request_id} + + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(valid_logout_response_document({:uuid => in_relation_to_request_id}), settings, opts) + + assert logoutresponse.validate + + assert_equal settings.sp_entity_id, logoutresponse.issuer + assert_equal in_relation_to_request_id, logoutresponse.in_response_to + + assert logoutresponse.success? + assert_empty logoutresponse.errors + end + + it "validate the logout response extended" do + in_relation_to_request_id = random_id + settings.idp_entity_id = 'http://app.muda.no' + opts = { :matches_request_id => in_relation_to_request_id} + + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(valid_logout_response_document({:uuid => in_relation_to_request_id}), settings, opts) + assert logoutresponse.validate + assert_equal in_relation_to_request_id, logoutresponse.in_response_to + assert logoutresponse.success? + assert_empty logoutresponse.errors + end + + it "invalidate logout response when initiated with blank" do + logoutresponse = OneLogin::RubySaml::Logoutresponse.new("", settings) + assert !logoutresponse.validate + assert_includes logoutresponse.errors, "Blank logout response" + end + + it "invalidate logout response when initiated with no idp cert or fingerprint" do + settings.idp_cert_fingerprint = nil + settings.idp_cert = nil + settings.idp_cert_multi = nil + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(valid_logout_response_document, settings) + assert !logoutresponse.validate + assert_includes logoutresponse.errors, "No fingerprint or certificate on settings of the logout response" + end + + it "invalidate logout response with wrong id when given option :matches_request_id" do + expected_request_id = "_some_other_expected_uuid" + opts = { :matches_request_id => expected_request_id} + + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(valid_logout_response_document, settings, opts) + + assert !logoutresponse.validate + refute_equal expected_request_id, logoutresponse.in_response_to + assert_includes logoutresponse.errors, "The InResponseTo of the Logout Response: #{logoutresponse.in_response_to}, does not match the ID of the Logout Request sent by the SP: #{expected_request_id}" + end + + it "invalidate logout response with unexpected request status" do + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(unsuccessful_logout_response_document, settings) + + assert !logoutresponse.success? + assert !logoutresponse.validate + assert_includes logoutresponse.errors, "The status code of the Logout Response was not Success, was Requester" + end + + it "invalidate logout response with unexpected request status and status message" do + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(unsuccessful_logout_response_with_message_document, settings) + + assert !logoutresponse.success? + assert !logoutresponse.validate + assert_includes logoutresponse.errors, "The status code of the Logout Response was not Success, was Requester -> Logoutrequest expired" + end + + it "invalidate logout response when in lack of sp_entity_id setting" do + bad_settings = settings + bad_settings.issuer = nil + bad_settings.sp_entity_id = nil + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(unsuccessful_logout_response_document, bad_settings) + assert !logoutresponse.validate + assert_includes logoutresponse.errors, "No sp_entity_id in settings of the logout response" + end + + it "invalidate logout response with wrong issuer" do + in_relation_to_request_id = random_id + settings.idp_entity_id = 'http://invalid.issuer.example.com/' + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(valid_logout_response_document({:uuid => in_relation_to_request_id}), settings) + assert !logoutresponse.validate + assert_includes logoutresponse.errors, "Doesn't match the issuer, expected: <#{logoutresponse.settings.idp_entity_id}>, but was: " + end + + it "collect errors when collect_errors=true" do + settings.idp_entity_id = 'http://invalid.issuer.example.com/' + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(unsuccessful_logout_response_document, settings) + collect_errors = true + assert !logoutresponse.validate(collect_errors) + assert_includes logoutresponse.errors, "The status code of the Logout Response was not Success, was Requester" + assert_includes logoutresponse.errors, "Doesn't match the issuer, expected: <#{logoutresponse.settings.idp_entity_id}>, but was: " + end + + end + + describe "when soft=false" do + before do + settings.soft = false + end + + it "validates good logout response" do + in_relation_to_request_id = random_id + + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(valid_logout_response_document({:uuid => in_relation_to_request_id}), settings) + assert logoutresponse.validate + assert_empty logoutresponse.errors + end + + it "raises validation error when response initiated with blank" do + logoutresponse = OneLogin::RubySaml::Logoutresponse.new("", settings) + + assert_raises(OneLogin::RubySaml::ValidationError) { logoutresponse.validate } + assert_includes logoutresponse.errors, "Blank logout response" + end + + it "raises validation error when initiated with no idp cert or fingerprint" do + settings.idp_cert_fingerprint = nil + settings.idp_cert = nil + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(valid_logout_response_document, settings) + assert_raises(OneLogin::RubySaml::ValidationError) { logoutresponse.validate } + assert_includes logoutresponse.errors, "No fingerprint or certificate on settings of the logout response" + end + + it "raises validation error when matching for wrong request id" do + + expected_request_id = "_some_other_expected_id" + opts = { :matches_request_id => expected_request_id} + + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(valid_logout_response_document, settings, opts) + assert_raises(OneLogin::RubySaml::ValidationError) { logoutresponse.validate } + assert_includes logoutresponse.errors, "The InResponseTo of the Logout Response: #{logoutresponse.in_response_to}, does not match the ID of the Logout Request sent by the SP: #{expected_request_id}" + end + + it "raise validation error for wrong request status" do + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(unsuccessful_logout_response_document, settings) + + assert_raises(OneLogin::RubySaml::ValidationError) { logoutresponse.validate } + assert_includes logoutresponse.errors, "The status code of the Logout Response was not Success, was Requester" + end + + it "raise validation error when in bad state" do + # no settings + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(unsuccessful_logout_response_document, settings) + assert_raises(OneLogin::RubySaml::ValidationError) { logoutresponse.validate } + assert_includes logoutresponse.errors, "The status code of the Logout Response was not Success, was Requester" + end + + it "raise validation error when in lack of sp_entity_id setting" do + settings.issuer = nil + settings.sp_entity_id = nil + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(unsuccessful_logout_response_document, settings) + assert_raises(OneLogin::RubySaml::ValidationError) { logoutresponse.validate } + assert_includes logoutresponse.errors, "No sp_entity_id in settings of the logout response" + end + + it "raise validation error when logout response with wrong issuer" do + in_relation_to_request_id = random_id + settings.idp_entity_id = 'http://invalid.issuer.example.com/' + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(valid_logout_response_document({:uuid => in_relation_to_request_id}), settings) + assert_raises(OneLogin::RubySaml::ValidationError) { logoutresponse.validate } + assert_includes logoutresponse.errors, "Doesn't match the issuer, expected: <#{logoutresponse.settings.idp_entity_id}>, but was: " + end + end + + describe "#validate_signature" do + let (:params) { OneLogin::RubySaml::SloLogoutresponse.new.create_params(settings, random_id, "Custom Logout Message", :RelayState => 'http://example.com') } + + before do + settings.soft = true + settings.idp_slo_service_url = "http://example.com?field=value" + settings.security[:logout_responses_signed] = true + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + settings.idp_cert = ruby_saml_cert_text + end + + it "return true when no idp_cert is provided and option :relax_signature_validation is present" do + settings.idp_cert = nil + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + params['RelayState'] = params[:RelayState] + options = {} + options[:get_params] = params + options[:relax_signature_validation] = true + logoutresponse_sign_test = OneLogin::RubySaml::Logoutresponse.new(params['SAMLResponse'], settings, options) + assert logoutresponse_sign_test.send(:validate_signature) + end + + it "return false when no idp_cert is provided and no option :relax_signature_validation is present" do + settings.idp_cert = nil + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + params['RelayState'] = params[:RelayState] + options = {} + options[:get_params] = params + logoutresponse_sign_test = OneLogin::RubySaml::Logoutresponse.new(params['SAMLResponse'], settings, options) + assert !logoutresponse_sign_test.send(:validate_signature) + end + + it "return true when valid RSA_SHA1 Signature" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + params['RelayState'] = params[:RelayState] + options = {} + options[:get_params] = params + logoutresponse_sign_test = OneLogin::RubySaml::Logoutresponse.new(params['SAMLResponse'], settings, options) + assert logoutresponse_sign_test.send(:validate_signature) + end + + it "return true when valid RSA_SHA256 Signature" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA256 + params['RelayState'] = params[:RelayState] + options = {} + options[:get_params] = params + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(params['SAMLResponse'], settings, options) + assert logoutresponse.send(:validate_signature) + end + + it "return false when invalid RSA_SHA1 Signature" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + params['RelayState'] = 'http://invalid.example.com' + options = {} + options[:get_params] = params + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(params['SAMLResponse'], settings, options) + assert !logoutresponse.send(:validate_signature) + end + + it "raise when invalid RSA_SHA1 Signature" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + settings.soft = false + params['RelayState'] = 'http://invalid.example.com' + options = {} + options[:get_params] = params + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(params['SAMLResponse'], settings, options) + + assert_raises(OneLogin::RubySaml::ValidationError) { logoutresponse.send(:validate_signature) } + assert logoutresponse.errors.include? "Invalid Signature on Logout Response" + end + + it "raise when get_params encoding differs from what this library generates" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + settings.soft = false + options = {} + options[:get_params] = params + options[:get_params]['RelayState'] = 'http://example.com' + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(params['SAMLResponse'], settings, options) + # Assemble query string. + query = OneLogin::RubySaml::Utils.build_query( + :type => 'SAMLResponse', + :data => params['SAMLResponse'], + :relay_state => params['RelayState'], + :sig_alg => params['SigAlg'] + ) + # Modify the query string so that it encodes the same values, + # but with different percent-encoding. Sanity-check that they + # really are equialent before moving on. + original_query = query.dup + query.gsub!("example", "ex%61mple") + refute_equal(query, original_query) + assert_equal(CGI.unescape(query), CGI.unescape(original_query)) + # Make normalised signature based on our modified params. + sign_algorithm = XMLSecurity::BaseDocument.new.algorithm(settings.security[:signature_method]) + signature = settings.get_sp_key.sign(sign_algorithm.new, query) + params['Signature'] = Base64.encode64(signature).gsub(/\n/, "") + # Re-create the Logoutresponse based on these modified parameters, + # and ask it to validate the signature. It will do it incorrectly, + # because it will compute it based on re-encoded query parameters, + # rather than their original encodings. + options[:get_params] = params + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(params['SAMLResponse'], settings, options) + assert_raises(OneLogin::RubySaml::ValidationError, "Invalid Signature on Logout Request") do + logoutresponse.send(:validate_signature) + end + end + + it "return true even if raw_get_params encoding differs from what this library generates" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + settings.soft = false + options = {} + options[:get_params] = params + options[:get_params]['RelayState'] = 'http://example.com' + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(params['SAMLResponse'], settings, options) + # Assemble query string. + query = OneLogin::RubySaml::Utils.build_query( + :type => 'SAMLResponse', + :data => params['SAMLResponse'], + :relay_state => params['RelayState'], + :sig_alg => params['SigAlg'] + ) + # Modify the query string so that it encodes the same values, + # but with different percent-encoding. Sanity-check that they + # really are equialent before moving on. + original_query = query.dup + query.gsub!("example", "ex%61mple") + refute_equal(query, original_query) + assert_equal(CGI.unescape(query), CGI.unescape(original_query)) + # Make normalised signature based on our modified params. + sign_algorithm = XMLSecurity::BaseDocument.new.algorithm(settings.security[:signature_method]) + signature = settings.get_sp_key.sign(sign_algorithm.new, query) + params['Signature'] = Base64.encode64(signature).gsub(/\n/, "") + # Re-create the Logoutresponse based on these modified parameters, + # and ask it to validate the signature. Provide the altered parameter + # in its raw URI-encoded form, so that we don't have to guess the value + # that contributed to the signature. + options[:get_params] = params + options[:get_params].delete("RelayState") + options[:raw_get_params] = { + "RelayState" => "http%3A%2F%2Fex%61mple.com", + } + logoutresponse = OneLogin::RubySaml::Logoutresponse.new(params['SAMLResponse'], settings, options) + assert logoutresponse.send(:validate_signature) + end + end + + describe "#validate_signature" do + let (:params) { OneLogin::RubySaml::SloLogoutresponse.new.create_params(settings, random_id, "Custom Logout Message", :RelayState => 'http://example.com') } + + before do + settings.soft = true + settings.idp_slo_service_url = "http://example.com?field=value" + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + settings.security[:logout_responses_signed] = true + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + settings.idp_cert = nil + end + + it "return true when at least a idp_cert is valid" do + params['RelayState'] = params[:RelayState] + options = {} + options[:get_params] = params + settings.idp_cert_multi = { + :signing => [ruby_saml_cert_text2, ruby_saml_cert_text], + :encryption => [] + } + logoutresponse_sign_test = OneLogin::RubySaml::Logoutresponse.new(params['SAMLResponse'], settings, options) + assert logoutresponse_sign_test.send(:validate_signature) + end + + it "return false when cert expired and check_idp_cert_expiration expired" do + params['RelayState'] = params[:RelayState] + options = {} + options[:get_params] = params + settings.security[:check_idp_cert_expiration] = true + settings.idp_cert = nil + settings.idp_cert_multi = { + :signing => [ruby_saml_cert_text], + :encryption => [] + } + logoutresponse_sign_test = OneLogin::RubySaml::Logoutresponse.new(params['SAMLResponse'], settings, options) + assert !logoutresponse_sign_test.send(:validate_signature) + assert_includes logoutresponse_sign_test.errors, "IdP x509 certificate expired" + end + + it "return false when none cert on idp_cert_multi is valid" do + params['RelayState'] = params[:RelayState] + options = {} + options[:get_params] = params + settings.idp_cert_multi = { + :signing => [ruby_saml_cert_text2, ruby_saml_cert_text2], + :encryption => [] + } + logoutresponse_sign_test = OneLogin::RubySaml::Logoutresponse.new(params['SAMLResponse'], settings, options) + assert !logoutresponse_sign_test.send(:validate_signature) + assert_includes logoutresponse_sign_test.errors, "Invalid Signature on Logout Response" + end + end + end + end +end diff --git a/ruby-saml-custom/test/metadata/idp_descriptor.xml b/ruby-saml-custom/test/metadata/idp_descriptor.xml new file mode 100644 index 0000000..3e33900 --- /dev/null +++ b/ruby-saml-custom/test/metadata/idp_descriptor.xml @@ -0,0 +1,26 @@ + + + + + + + LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURxekNDQXhTZ0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRc0ZBRENCaGpFTE1Ba0dBMVVFQmhNQ1FWVXgKRERBS0JnTlZCQWdUQTA1VFZ6RVBNQTBHQTFVRUJ4TUdVM2xrYm1WNU1Rd3dDZ1lEVlFRS0RBTlFTVlF4Q1RBSApCZ05WQkFzTUFERVlNQllHQTFVRUF3d1BiR0YzY21WdVkyVndhWFF1WTI5dE1TVXdJd1lKS29aSWh2Y05BUWtCCkRCWnNZWGR5Wlc1alpTNXdhWFJBWjIxaGFXd3VZMjl0TUI0WERURXlNRFF4T1RJeU5UUXhPRm9YRFRNeU1EUXgKTkRJeU5UUXhPRm93Z1lZeEN6QUpCZ05WQkFZVEFrRlZNUXd3Q2dZRFZRUUlFd05PVTFjeER6QU5CZ05WQkFjVApCbE41Wkc1bGVURU1NQW9HQTFVRUNnd0RVRWxVTVFrd0J3WURWUVFMREFBeEdEQVdCZ05WQkFNTUQyeGhkM0psCmJtTmxjR2wwTG1OdmJURWxNQ01HQ1NxR1NJYjNEUUVKQVF3V2JHRjNjbVZ1WTJVdWNHbDBRR2R0WVdsc0xtTnYKYlRDQm56QU5CZ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VoTUFrR0ExVWRFd1FDTUFBd0N3WURWUjBQQkFRRApBZ1VnTUIwR0ExVWREZ1FXQkJTUk9OOEdKOG8rOGpnRnRqa3R3WmRxeDZCUnlUQVRCZ05WSFNVRUREQUtCZ2dyCkJnRUZCUWNEQVRBZEJnbGdoa2dCaHZoQ0FRMEVFQllPVkdWemRDQllOVEE1SUdObGNuUXdnYk1HQTFVZEl3U0IKcXpDQnFJQVVrVGpmQmlmS1B2STRCYlk1TGNHWGFzZWdVY21oZ1l5a2dZa3dnWVl4Q3pBSkJnTlZCQVlUQWtGVgpNUXd3Q2dZRFZRUUlFd05PVTFjeER6QU5CZ05WQkFjVEJsTjVaRzVsZVRFTU1Bb0dBMVVFQ2d3RFVFbFVNUWt3CkJ3WURWUVFMREFBeEdEQVdCZ05WQkFNTUQyeGhkM0psYm1ObGNHbDBMbU52YlRFbE1DTUdDU3FHU0liM0RRRUoKQVF3V2JHRjNjbVZ1WTJVdWNHbDBRR2R0WVdsc0xtTnZiWUlCQVRBTkJna3Foa2lHOXcwQkFRc0ZBQU9CZ1FDRQpUQWVKVERTQVc2ejFVRlRWN1FyZWg0VUxGT1JhajkrZUN1RjNLV0RIYyswSVFDajlyZG5ERzRRL3dmNy9yYVEwCkpuUFFDU0NkclBMSmV5b1BIN1FhVHdvYUY3ZHpWdzRMQ3N5TkpURld4NGNNNTBWdzZSNWZET2dpQzhic2ZmUzgKQkptb3VscnJaRE5OVmpHOG1XNmNMeHJZdlZRT3JSVmVjQ0ZJZ3NzQ2JBPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= + + + + + urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified + urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress + urn:oasis:names:tc:SAML:2.0:nameid-format:persistent + + + + + diff --git a/ruby-saml-custom/test/metadata/idp_descriptor_2.xml b/ruby-saml-custom/test/metadata/idp_descriptor_2.xml new file mode 100644 index 0000000..4a11917 --- /dev/null +++ b/ruby-saml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:tc:SAML:2.0:nameid-format:persistent + + + + + diff --git a/ruby-saml-custom/test/metadata/idp_descriptor_3.xml b/ruby-saml-custom/test/metadata/idp_descriptor_3.xml new file mode 100644 index 0000000..e8c2dde --- /dev/null +++ b/ruby-saml-custom/test/metadata/idp_descriptor_3.xml @@ -0,0 +1,18 @@ + + + + + + LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURxekNDQXhTZ0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRc0ZBRENCaGpFTE1Ba0dBMVVFQmhNQ1FWVXgKRERBS0JnTlZCQWdUQTA1VFZ6RVBNQTBHQTFVRUJ4TUdVM2xrYm1WNU1Rd3dDZ1lEVlFRS0RBTlFTVlF4Q1RBSApCZ05WQkFzTUFERVlNQllHQTFVRUF3d1BiR0YzY21WdVkyVndhWFF1WTI5dE1TVXdJd1lKS29aSWh2Y05BUWtCCkRCWnNZWGR5Wlc1alpTNXdhWFJBWjIxaGFXd3VZMjl0TUI0WERURXlNRFF4T1RJeU5UUXhPRm9YRFRNeU1EUXgKTkRJeU5UUXhPRm93Z1lZeEN6QUpCZ05WQkFZVEFrRlZNUXd3Q2dZRFZRUUlFd05PVTFjeER6QU5CZ05WQkFjVApCbE41Wkc1bGVURU1NQW9HQTFVRUNnd0RVRWxVTVFrd0J3WURWUVFMREFBeEdEQVdCZ05WQkFNTUQyeGhkM0psCmJtTmxjR2wwTG1OdmJURWxNQ01HQ1NxR1NJYjNEUUVKQVF3V2JHRjNjbVZ1WTJVdWNHbDBRR2R0WVdsc0xtTnYKYlRDQm56QU5CZ2txaGtpRzl3MEJBUUVGQUFPQmpRQXdnWWtDZ1lFQXFqaWUzUjJvaStwRGFldndJeXMvbWJVVApubkdsa3h0ZGlrcnExMXZleHd4SmlQTmhtaHFSVzNtVXVKRXpsbElkVkw2RW14R1lUcXBxZjkzSGxoa3NhZUowCjhVZ2pQOVVtTVlyaFZKdTFqY0ZXVjdmei9yKzIxL2F3VG5EVjlzTVlRcXVJUllZeTdiRzByMU9iaXdkb3ZudGsKN2dGSTA2WjB2WmFjREU1Ym9xVUNBd0VBQWFPQ0FTVXdnZ0VoTUFrR0ExVWRFd1FDTUFBd0N3WURWUjBQQkFRRApBZ1VnTUIwR0ExVWREZ1FXQkJTUk9OOEdKOG8rOGpnRnRqa3R3WmRxeDZCUnlUQVRCZ05WSFNVRUREQUtCZ2dyCkJnRUZCUWNEQVRBZEJnbGdoa2dCaHZoQ0FRMEVFQllPVkdWemRDQllOVEE1SUdObGNuUXdnYk1HQTFVZEl3U0IKcXpDQnFJQVVrVGpmQmlmS1B2STRCYlk1TGNHWGFzZWdVY21oZ1l5a2dZa3dnWVl4Q3pBSkJnTlZCQVlUQWtGVgpNUXd3Q2dZRFZRUUlFd05PVTFjeER6QU5CZ05WQkFjVEJsTjVaRzVsZVRFTU1Bb0dBMVVFQ2d3RFVFbFVNUWt3CkJ3WURWUVFMREFBeEdEQVdCZ05WQkFNTUQyeGhkM0psYm1ObGNHbDBMbU52YlRFbE1DTUdDU3FHU0liM0RRRUoKQVF3V2JHRjNjbVZ1WTJVdWNHbDBRR2R0WVdsc0xtTnZiWUlCQVRBTkJna3Foa2lHOXcwQkFRc0ZBQU9CZ1FDRQpUQWVKVERTQVc2ejFVRlRWN1FyZWg0VUxGT1JhajkrZUN1RjNLV0RIYyswSVFDajlyZG5ERzRRL3dmNy9yYVEwCkpuUFFDU0NkclBMSmV5b1BIN1FhVHdvYUY3ZHpWdzRMQ3N5TkpURld4NGNNNTBWdzZSNWZET2dpQzhic2ZmUzgKQkptb3VscnJaRE5OVmpHOG1XNmNMeHJZdlZRT3JSVmVjQ0ZJZ3NzQ2JBPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= + + + + + urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified + urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress + urn:oasis:names:tc:SAML:2.0:nameid-format:persistent + + + + + \ No newline at end of file diff --git a/ruby-saml-custom/test/metadata/idp_descriptor_4.xml b/ruby-saml-custom/test/metadata/idp_descriptor_4.xml new file mode 100644 index 0000000..5e7a4ad --- /dev/null +++ b/ruby-saml-custom/test/metadata/idp_descriptor_4.xml @@ -0,0 +1,72 @@ + + + + + + + MIIEZTCCA02gAwIBAgIUPyy/A3bZAZ4m28PzEUUoT7RJhxIwDQYJKoZIhvcNAQEF +BQAwcjELMAkGA1UEBhMCVVMxKzApBgNVBAoMIk9uZUxvZ2luIFRlc3QgKHNnYXJj +aWEtdXMtcHJlcHJvZCkxFTATBgNVBAsMDE9uZUxvZ2luIElkUDEfMB0GA1UEAwwW +T25lTG9naW4gQWNjb3VudCA4OTE0NjAeFw0xNjA4MDQyMjI5MzdaFw0yMTA4MDUy +MjI5MzdaMHIxCzAJBgNVBAYTAlVTMSswKQYDVQQKDCJPbmVMb2dpbiBUZXN0IChz +Z2FyY2lhLXVzLXByZXByb2QpMRUwEwYDVQQLDAxPbmVMb2dpbiBJZFAxHzAdBgNV +BAMMFk9uZUxvZ2luIEFjY291bnQgODkxNDYwggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQDN6iqQGcLOCglNO42I2rkzE05UXSiMXT6c8ALThMMiaDw6qqzo +3sd/tKK+NcNKWLIIC8TozWVyh5ykUiVZps+08xil7VsTU7E+wKu3kvmOsvw2wlRw +tnoKZJwYhnr+RkBa+h1r3ZYUgXm1ZPeHMKj1g18KaWz9+MxYL6BhKqrOzfW/P2xx +VRcFH7/pq+ZsDdgNzD2GD+apzY4MZyZj/N6BpBWJ0GlFsmtBegpbX3LBitJuFkk5 +L4/U/jjF1AJa3boBdCUVfATqO5G03H4XS1GySjBIRQXmlUF52rLjg6xCgWJ30/+t +1X+IHLJeixiQ0vxyh6C4/usCEt94cgD1r8ADAgMBAAGjgfIwge8wDAYDVR0TAQH/ +BAIwADAdBgNVHQ4EFgQUPW0DcH0G3IwynWgi74co4wZ6n7gwga8GA1UdIwSBpzCB +pIAUPW0Dc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qUzyhDhLo/xXNrHCu4VbMw== + + + + + urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified + urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress + urn:oasis:names:tc:SAML:2.0:nameid-format:persistent + + + + + diff --git a/ruby-saml-custom/test/metadata/idp_descriptor_5.xml b/ruby-saml-custom/test/metadata/idp_descriptor_5.xml new file mode 100644 index 0000000..3bff973 --- /dev/null +++ b/ruby-saml-custom/test/metadata/idp_descriptor_5.xml @@ -0,0 +1,72 @@ + + + + + + + MIIEZTCCA02gAwIBAgIUPyy/A3bZAZ4m28PzEUUoT7RJhxIwDQYJKoZIhvcNAQEF +BQAwcjELMAkGA1UEBhMCVVMxKzApBgNVBAoMIk9uZUxvZ2luIFRlc3QgKHNnYXJj +aWEtdXMtcHJlcHJvZCkxFTATBgNVBAsMDE9uZUxvZ2luIElkUDEfMB0GA1UEAwwW +T25lTG9naW4gQWNjb3VudCA4OTE0NjAeFw0xNjA4MDQyMjI5MzdaFw0yMTA4MDUy +MjI5MzdaMHIxCzAJBgNVBAYTAlVTMSswKQYDVQQKDCJPbmVMb2dpbiBUZXN0IChz +Z2FyY2lhLXVzLXByZXByb2QpMRUwEwYDVQQLDAxPbmVMb2dpbiBJZFAxHzAdBgNV +BAMMFk9uZUxvZ2luIEFjY291bnQgODkxNDYwggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQDN6iqQGcLOCglNO42I2rkzE05UXSiMXT6c8ALThMMiaDw6qqzo +3sd/tKK+NcNKWLIIC8TozWVyh5ykUiVZps+08xil7VsTU7E+wKu3kvmOsvw2wlRw +tnoKZJwYhnr+RkBa+h1r3ZYUgXm1ZPeHMKj1g18KaWz9+MxYL6BhKqrOzfW/P2xx +VRcFH7/pq+ZsDdgNzD2GD+apzY4MZyZj/N6BpBWJ0GlFsmtBegpbX3LBitJuFkk5 +L4/U/jjF1AJa3boBdCUVfATqO5G03H4XS1GySjBIRQXmlUF52rLjg6xCgWJ30/+t +1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fg9mF7AM/Uagq2503XXIE1Lq//HON68P10vNMwLSKOtYLsoTiCnuIKGJqG37 +MsZVjQ1ZPRcO+LSLkq0i91gFxrOrVCrgztX4JQi5XkvEsYZGIXXjwHqxTVyt3adZ +WQO0LPxPqRiUqUzyhDhLo/xXNrHCu4VbMw== + + + + + urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified + urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress + urn:oasis:names:tc:SAML:2.0:nameid-format:persistent + + + + + diff --git a/ruby-saml-custom/test/metadata/idp_descriptor_6.xml b/ruby-saml-custom/test/metadata/idp_descriptor_6.xml new file mode 100644 index 0000000..fa6e21d --- /dev/null +++ b/ruby-saml-custom/test/metadata/idp_descriptor_6.xml @@ -0,0 +1,72 @@ + + + + + + + MIIEZTCCA02gAwIBAgIUPyy/A3bZAZ4m28PzEUUoT7RJhxIwDQYJKoZIhvcNAQEF +BQAwcjELMAkGA1UEBhMCVVMxKzApBgNVBAoMIk9uZUxvZ2luIFRlc3QgKHNnYXJj +aWEtdXMtcHJlcHJvZCkxFTATBgNVBAsMDE9uZUxvZ2luIElkUDEfMB0GA1UEAwwW +T25lTG9naW4gQWNjb3VudCA4OTE0NjAeFw0xNjA4MDQyMjI5MzdaFw0yMTA4MDUy +MjI5MzdaMHIxCzAJBgNVBAYTAlVTMSswKQYDVQQKDCJPbmVMb2dpbiBUZXN0IChz +Z2FyY2lhLXVzLXByZXByb2QpMRUwEwYDVQQLDAxPbmVMb2dpbiBJZFAxHzAdBgNV +BAMMFk9uZUxvZ2luIEFjY291bnQgODkxNDYwggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQDN6iqQGcLOCglNO42I2rkzE05UXSiMXT6c8ALThMMiaDw6qqzo +3sd/tKK+NcNKWLIIC8TozWVyh5ykUiVZps+08xil7VsTU7E+wKu3kvmOsvw2wlRw +tnoKZJwYhnr+RkBa+h1r3ZYUgXm1ZPeHMKj1g18KaWz9+MxYL6BhKqrOz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BXM +GI6ahPicXCQrfLgN8vzMIiqZqfySXXv/8/dxe/X4UsWLYKYJHDJmxXD5EmWTa65c +hjkeP1oJAc8f3CKCpcP2lOBTthbnk2fEVAeLHR4xNdQO0VvGXWO9BliYPpkYqUIB +vlm+Fg9mF7AM/Uagq2503XXIE1Lq//HON68P10vNMwLSKOtYLsoTiCnuIKGJqG37 +MsZVjQ1ZPRcO+LSLkq0i91gFxrOrVCrgztX4JQi5XkvEsYZGIXXjwHqxTVyt3adZ +WQO0LPxPqRiUqUzyhDhLo/xXNrHCu4VbMw== + + + + + urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified + urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress + urn:oasis:names:tc:SAML:2.0:nameid-format:persistent + + + + + diff --git a/ruby-saml-custom/test/metadata/idp_different_slo_response_location.xml b/ruby-saml-custom/test/metadata/idp_different_slo_response_location.xml new file mode 100644 index 0000000..aa53cfc --- /dev/null +++ b/ruby-saml-custom/test/metadata/idp_different_slo_response_location.xml @@ -0,0 +1,26 @@ + + + + + + + LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURxekNDQXhTZ0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRc0ZBRENCaGpFTE1Ba0dBMVVFQmhNQ1FWVXgKRERBS0JnTlZCQWdUQTA1VFZ6RVBNQTBHQTFVRUJ4TUdVM2xrYm1WNU1Rd3dDZ1lEVlFRS0RBTlFTVlF4Q1RBSApCZ05WQkFzTUFERVlNQllHQTFVRUF3d1BiR0YzY21WdVkyVndhWFF1WTI5dE1TVXdJd1lKS29aSWh2Y05BUWtCCkRCWnNZWGR5Wlc1alpTNXdhWFJBWjIxaGFXd3VZMjl0TUI0WERURXlNRFF4T1RJeU5UUXhPRm9YRFRNeU1EUXgKTkRJeU5UUXhPRm93Z1lZeEN6QUpCZ05WQkFZVEFrRlZNUXd3Q2dZRFZRUUlFd05PVTFjeER6QU5CZ05WQkFjVApCbE41Wkc1bGVUR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ified + urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress + urn:oasis:names:tc:SAML:2.0:nameid-format:persistent + + + + + diff --git a/ruby-saml-custom/test/metadata/idp_metadata_different_sign_and_encrypt_cert.xml b/ruby-saml-custom/test/metadata/idp_metadata_different_sign_and_encrypt_cert.xml new file mode 100644 index 0000000..df90353 --- /dev/null +++ b/ruby-saml-custom/test/metadata/idp_metadata_different_sign_and_encrypt_cert.xml @@ -0,0 +1,72 @@ + + + + + + + MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJVUzET +MBEGA1UECAwKQ2FsaWZvcm5pYTEVMBMGA1UEBwwMU2FudGEgTW9uaWNhMREwDwYD +VQQKDAhPbmVMb2dpbjEZMBcGA1UEAwwQYXBwLm9uZWxvZ2luLmNvbTAeFw0xMzA2 +MDUxNzE2MjBaFw0xODA2MDUxNzE2MjBaMGcxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +DApDYWxpZm9ybmlhMRUwEwYDVQQHDAxTYW50YSBNb25pY2ExETAPBgNVBAoMCE9u +ZUxvZ2luMRkwFwYDVQQDDBBhcHAub25lbG9naW4uY29tMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEAse8rnep4qL2GmhH10pMQyJ2Jae+AQHyfgVjaQZ7Z +0QQog5jX91vcJRSMi0XWJnUtOr6lF0dq1+yckjZ92wyLrH+7fvngNO1aV4Mjk9sT +gf+iqMrae6y6fRxDt9PXrEFVjvd3vv7QTJf2FuIPy4vVP06Dt8EMkQIr8rmLmU0m +Tr1k2DkrdtdlCuNFTXuAu3QqfvNCRrRwfNObn9MP6JeOUdcGLJsBjGF8exfcN1SF +zRF0JFr3dmOlx761zK5liD0T1sYWnDquatj/JD9fZMbKecBKni1NglH/LVd+b6aJ +UAr5LulERULUjLqYJRKW31u91/4Qazdo9tbvwqyFxaoUrwIDAQABo4HUMIHRMAwG +A1UdEwEB/wQCMAAwHQYDVR0OBBYE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+WQO0LPxPqRiUqUzyhDhLo/xXNrHCu4VbMw== + + + + urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress + + + + + + Support + support@onelogin.com + + \ No newline at end of file diff --git a/ruby-saml-custom/test/metadata/idp_metadata_multi_certs.xml b/ruby-saml-custom/test/metadata/idp_metadata_multi_certs.xml new file mode 100644 index 0000000..f993f64 --- /dev/null +++ b/ruby-saml-custom/test/metadata/idp_metadata_multi_certs.xml @@ -0,0 +1,75 @@ + + + + + + + MIIEZTCCA02gAwIBAgIUPyy/A3bZAZ4m28PzEUUoT7RJhxIwDQYJKoZIhvcNAQEF +BQAwcjELMAkGA1UEBhMCVVMxKzApBgNVBAoMIk9uZUxvZ2luIFRlc3QgKHNnYXJj +aWEtdXMtcHJlcHJvZCkxFTATBgNVBAsMDE9uZUxvZ2luIElkUDEfMB0GA1UEAwwW +T25lTG9naW4gQWNjb3VudCA4OTE0NjAeFw0xNjA4MDQyMjI5MzdaFw0yMTA4MDUy +MjI5MzdaMHIxCzAJBgNVBAYTAlVTMSswKQYDVQQKDCJPbmVMb2dpbiBUZXN0IChz +Z2FyY2lhLXVzLXByZXByb2QpMRUwEwYDVQQLDAxPbmVMb2dpbiBJZFAxHzAdBgNV +BAMMFk9uZUxvZ2luIEFjY291bnQgODkxNDYwggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQDN6iqQGcLOCglNO42I2rkzE05UXSiMXT6c8ALThMMiaDw6qqzo +3sd/tKK+NcNKWLIIC8TozWVyh5ykUiVZps+08xil7VsTU7E+wKu3kvmOsvw2wlRw +tnoKZJwYhnr+RkBa+h1r3ZYUgXm1ZPeHMKj1g18KaWz9+MxYL6BhKqrOzfW/P2xx +VRcFH7/pq+ZsDdgNzD2GD+apzY4MZyZj/N6BpBWJ0GlFsmtBegpbX3LBitJuFkk5 +L4/U/jjF1AJa3boBdCUVfATqO5G03H4XS1GySjBIRQXmlUF52rLjg6xCgWJ30/+t +1X+IHLJeixiQ0vxyh6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Ku3kvmOsvw2wlRw +tnoKZJwYhnr+RkBa+h1r3ZYUgXm1ZPeHMKj1g18KaWz9+MxYL6BhKqrOzfW/P2xx +VRcFH7/pq+ZsDdgNzD2GD+apzY4MZyZj/N6BpBWJ0GlFsmtBegpbX3LBitJuFkk5 +L4/U/jjF1AJa3boBdCUVfATqO5G03H4XS1GySjBIRQXmlUF52rLjg6xCgWJ30/+t +1X+IHLJeixiQ0vxyh6C4/usCEt94cgD1r8ADAgMBAAGjgfIwge8wDAYDVR0TAQH/ +BAIwADAdBgNVHQ4EFgQUPW0DcH0G3IwynWgi74co4wZ6n7gwga8GA1UdIwSBpzCB +pIAUPW0DcH0G3IwynWgi74co4wZ6n7ihdqR0MHIxCzAJBgNVBAYTAlVTMSswKQYD +VQQKDCJPbmVMb2dpbiBUZXN0IChzZ2FyY2lhLXVzLXByZXByb2QpMRUwEwYDVQQL +DAxPbmVMb2dpbiBJZFAxHzAdBgNVBAMMFk9uZUxvZ2luIEFjY291bnQgODkxNDaC +FD8svwN22QGeJtvD8xFFKE+0SYcSMA4GA1UdDwEB/wQEAwIHgDANBgkqhkiG9w0B +AQUFAAOCAQEAQhB4q9jrycwbHrDSoYR1X4LFFzvJ9Us75wQquRHXpdyS9D6HUBXM +GI6ahPicXCQrfLgN8vzMIiqZqfySXXv/8/dxe/X4UsWLYKYJHDJmxXD5EmWTa65c +hjkeP1oJAc8f3CKCpcP2lOBTthbnk2fEVAeLHR4xNdQO0VvGXWO9BliYPpkYqUIB +vlm+Fg9mF7AM/Uagq2503XXIE1Lq//HON68P10vNMwLSKOtYLsoTiCnuIKGJqG37 +MsZVjQ1ZPRcO+LSLkq0i91gFxrOrVCrgztX4JQi5XkvEsYZGIXXjwHqxTVyt3adZ +WQO0LPxPqRiUqUzyhDhLo/xXNrHCu4VbMw== + + + + + urn:oasis:names:tc:SAML:2.0:nameid-format:transient + + + \ No newline at end of file diff --git a/ruby-saml-custom/test/metadata/idp_metadata_multi_signing_certs.xml b/ruby-saml-custom/test/metadata/idp_metadata_multi_signing_certs.xml new file mode 100644 index 0000000..3d74c40 --- /dev/null +++ b/ruby-saml-custom/test/metadata/idp_metadata_multi_signing_certs.xml @@ -0,0 +1,52 @@ + + + + + + + MIIEZTCCA02gAwIBAgIUPyy/A3bZAZ4m28PzEUUoT7RJhxIwDQYJKoZIhvcNAQEF +BQAwcjELMAkGA1UEBhMCVVMxKzApBgNVBAoMIk9uZUxvZ2luIFRlc3QgKHNnYXJj +aWEtdXMtcHJlcHJvZCkxFTATBgNVBAsMDE9uZUxvZ2luIElkUDEfMB0GA1UEAwwW +T25lTG9naW4gQWNjb3VudCA4OTE0NjAeFw0xNjA4MDQyMjI5MzdaFw0yMTA4MDUy +MjI5MzdaMHIxCzAJBgNVBAYTAlVTMSswKQYDVQQKDCJPbmVMb2dpbiBUZXN0IChz +Z2FyY2lhLXVzLXByZXByb2QpMRUwEwYDVQQLDAxPbmVMb2dpbiBJZFAxHzAdBgNV +BAMMFk9uZUxvZ2luIEFjY291bnQgODkxNDYwggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQDN6iqQGcLOCglNO42I2rkzE05UXSiMXT6c8ALThMMiaDw6qqzo +3sd/tKK+NcNKWLIIC8TozWVyh5ykUiVZps+08xil7VsTU7E+wKu3kvmOsvw2wlRw +tnoKZJwYhnr+RkBa+h1r3ZYUgXm1ZPeHMKj1g18KaWz9+MxYL6BhKqrOzfW/P2xx +VRcFH7/pq+ZsDdgNzD2GD+apzY4MZyZj/N6BpBWJ0GlFsmtBegpbX3LBitJuFkk5 +L4/U/jjF1AJa3boBdCUVfATqO5G03H4XS1GySjBIRQXmlUF52rLjg6xCgWJ30/+t +1X+IHLJeixiQ0vxyh6C4/usCEt94cgD1r8ADAgMBAAGjgfIwge8wDAYDVR0TAQH/ +BAIwADAdBgNVHQ4EFgQUPW0DcH0G3IwynWgi74co4wZ6n7gwga8GA1UdIwSBpzCB +pIAUPW0DcH0G3IwynWgi74co4wZ6n7ihd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3NzQ2JBPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= + + + + + urn:oasis:names:tc:SAML:2.0:nameid-format:transient + + + diff --git a/ruby-saml-custom/test/metadata/idp_metadata_same_sign_and_encrypt_cert.xml b/ruby-saml-custom/test/metadata/idp_metadata_same_sign_and_encrypt_cert.xml new file mode 100644 index 0000000..e7fd250 --- /dev/null +++ b/ruby-saml-custom/test/metadata/idp_metadata_same_sign_and_encrypt_cert.xml @@ -0,0 +1,71 @@ + + + + + + + MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJVUzET +MBEGA1UECAwKQ2FsaWZvcm5pYTEVMBMGA1UEBwwMU2FudGEgTW9uaWNhMREwDwYD +VQQKDAhPbmVMb2dpbjEZMBcGA1UEAwwQYXBwLm9uZWxvZ2luLmNvbTAeFw0xMzA2 +MDUxNzE2MjBaFw0xODA2MDUxNzE2MjBaMGcxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +DApDYWxpZm9ybmlhMRUwEwYDVQQHDAxTYW50YSBNb25pY2ExETAPBgNVBAoMCE9u +ZUxvZ2luMRkwFwYDVQQDDBBhcHAub25lbG9naW4uY29tMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEAse8rnep4qL2GmhH10pMQyJ2Jae+AQHyfgVjaQZ7Z +0QQog5jX91vcJRSMi0XWJnUtOr6lF0dq1+yckjZ92wyLrH+7fvngNO1aV4Mjk9sT +gf+iqMrae6y6fRxDt9PXrEFVjvd3vv7QTJf2FuIPy4vVP06Dt8EMkQIr8rmLmU0m +Tr1k2DkrdtdlCuNFTXuAu3QqfvNCRrRwfNObn9MP6JeOUdcGLJsBjGF8exfcN1SF +zRF0JFr3dmOlx761zK5liD0T1sYWnDquatj/JD9fZMbKecBKni1NglH/LVd+b6aJ +UAr5LulERULUjLqYJRKW31u91/4Qazdo9tbvwqyFxaoUrwIDAQABo4HUMIHRMAwG +A1UdEwEB/w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support@onelogin.com + + \ No newline at end of file diff --git a/ruby-saml-custom/test/metadata/idp_multiple_descriptors.xml b/ruby-saml-custom/test/metadata/idp_multiple_descriptors.xml new file mode 100644 index 0000000..bf0a302 --- /dev/null +++ b/ruby-saml-custom/test/metadata/idp_multiple_descriptors.xml @@ -0,0 +1,59 @@ + + + + + urn:oasis:names:tc:SAML:2.0:nameid-format:transient + + + + + + + + + LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURxekNDQXhTZ0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRc0ZBRENCaGpFTE1Ba0dBMVVFQmhNQ1FWVXgKRERBS0JnTlZCQWdUQTA1VFZ6RVBNQTBHQTFVRUJ4TUdVM2xrYm1WNU1Rd3dDZ1lEVlFRS0RBTlFTVlF4Q1RBSApCZ05WQkFzTUFERVlNQllHQTFVRUF3d1BiR0YzY21WdVkyVndhWFF1WTI5dE1TVXdJd1lKS29aSWh2Y05BUWtCCkRCWnNZWGR5Wlc1alpTNXdhWFJBWjIxaGFXd3VZMjl0TUI0WERURXlNRFF4T1RJeU5UUXhPRm9YRFRNeU1EUXgKTkRJeU5UUXhPRm93Z1lZeEN6QUpCZ05WQkFZVEFrRlZNUXd3Q2dZRFZRUUlFd05PVTFjeER6QU5CZ05WQkFjVApCbE41Wkc1bGVURU1NQW9HQTFVRUNnd0RVRWxVTVFrd0J3WURWUVFMREFBeEdEQVdCZ05WQkFNTUQyeGhkM0psCmJtTmxjR2wwTG1OdmJURWxNQ01HQ1NxR1NJYjNEUUVKQVF3V2JHRjNjbVZ1WTJVdWNHbDBRR2R0WVdsc0xtTnYKYlRDQm56QU5CZ2txaGtpRzl3MEJBUUVGQUFPQmpRQXdnWWtDZ1lFQXFqaWUzUjJvaStwRGFldndJeXMvbWJVVApubkdsa3h0ZGlrcnExMXZleHd4SmlQTmhtaHFSVzNtVXVKRXpsbElkVkw2RW14R1lUcXBxZjkzSGxoa3NhZUowCjhVZ2pQOVVtTVlya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uUFFDU0NkclBMSmV5b1BIN1FhVHdvYUY3ZHpWdzRMQ3N5TkpURld4NGNNNTBWdzZSNWZET2dpQzhic2ZmUzgKQkptb3VscnJaRE5OVmpHOG1XNmNMeHJZdlZRT3JSVmVjQ0ZJZ3NzQ2JBPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= + + + + + urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified + urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress + urn:oasis:names:tc:SAML:2.0:nameid-format:persistent + + + + + + diff --git a/ruby-saml-custom/test/metadata/idp_multiple_descriptors_2.xml b/ruby-saml-custom/test/metadata/idp_multiple_descriptors_2.xml new file mode 100644 index 0000000..9d388e6 --- /dev/null +++ b/ruby-saml-custom/test/metadata/idp_multiple_descriptors_2.xml @@ -0,0 +1,59 @@ + + + + + urn:oasis:names:tc:SAML:2.0:nameid-format:transient + + + + + + + + + LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURxekNDQXhTZ0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRc0ZBRENCaGpFTE1Ba0dBMVVFQmhNQ1FWVXgKRERBS0JnTlZCQWdUQTA1VFZ6RVBNQTBHQTFVRUJ4TUdVM2xrYm1WNU1Rd3dDZ1lEVlFRS0RBTlFTVlF4Q1RBSApCZ05WQkFzTUFERVlNQllHQTFVRUF3d1BiR0YzY21WdVkyVndhWFF1WTI5dE1TVXdJd1lKS29aSWh2Y05BUWtCCkRCWnNZWGR5Wlc1alpTNXdhWFJBWjIxaGFXd3VZMjl0TUI0WERURXlNRFF4T1RJeU5UUXhPRm9YRFRNeU1EUXgKTkRJeU5UUXhPRm93Z1lZeEN6QUpCZ05WQkFZVEFrRlZNUXd3Q2dZRFZRUUlFd05PVTFjeER6QU5CZ05WQkFjVApCbE41Wkc1bGVURU1NQW9HQTFVRUNnd0RVRWxVTVFrd0J3WURWUVFMREFBeEdEQVdCZ05WQkFNTUQyeGhkM0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0yOTAzMTgxMzAzMTJaMFsxCzAJBgNVBAYTAnVzMRgwFgYDVQQIDA9iYXIuZXhhbXBsZS5jb20xGDAWBgNVBAoMD2Jhci5leGFtcGxlLmNvbTEYMBYGA1UEAwwPYmFyLmV4YW1wbGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDv7Xe9pxNYjxLhXhjQy7L6BbU0IVwQS9pbWqXYDtH3z1fIy+tWMEnE+XhuSFLilRcfn8Ksk0VeFLByQw2HfxAHY3O2dsCv5yLHye3/5bLKa+/pYu7r9ltE5JNjELAH1Yo0/SvAWX9Nuw6Ovw7D6frXUxBPhJaEQ+1VnatuZBUOfQIDAQABo1AwTjAdBgNVHQ4EFgQU6xbFedBYUDFTdXoQvRrELtH4jP8wHwYDVR0jBBgwFoAU6xbFedBYUDFTdXoQvRrELtH4jP8wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQBvDqYSONEhlDB4+k2+hMg03XCwINLh0UHWd+QfFO1yT6iZK+Duaq9pDBl97RO9sN6qHfOFSQXYBOj6S1Xf+6Orq1yeep/Uh+UrL7wzWYMzPryZxTYn8B1PbdXePRIZCzU7d7ueMnEfUoBj9HqhQphRYD9WgXP9/xzvu9JQjTNk9g== + + + + + urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified + urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress + urn:oasis:names:tc:SAML:2.0:nameid-format:persistent + + + + + + diff --git a/ruby-saml-custom/test/metadata/idp_without_slo_response_location.xml b/ruby-saml-custom/test/metadata/idp_without_slo_response_location.xml new file mode 100644 index 0000000..d6af0a1 --- /dev/null +++ b/ruby-saml-custom/test/metadata/idp_without_slo_response_location.xml @@ -0,0 +1,26 @@ + + + + + + + LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURxekNDQXhTZ0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRc0ZBRENCaGpFTE1Ba0dBMVVFQmhNQ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DBRR2R0WVdsc0xtTnZiWUlCQVRBTkJna3Foa2lHOXcwQkFRc0ZBQU9CZ1FDRQpUQWVKVERTQVc2ejFVRlRWN1FyZWg0VUxGT1JhajkrZUN1RjNLV0RIYyswSVFDajlyZG5ERzRRL3dmNy9yYVEwCkpuUFFDU0NkclBMSmV5b1BIN1FhVHdvYUY3ZHpWdzRMQ3N5TkpURld4NGNNNTBWdzZSNWZET2dpQzhic2ZmUzgKQkptb3VscnJaRE5OVmpHOG1XNmNMeHJZdlZRT3JSVmVjQ0ZJZ3NzQ2JBPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= + + + + + urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified + urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress + urn:oasis:names:tc:SAML:2.0:nameid-format:persistent + + + + + diff --git a/ruby-saml-custom/test/metadata/no_idp_descriptor.xml b/ruby-saml-custom/test/metadata/no_idp_descriptor.xml new file mode 100644 index 0000000..3e1599d --- /dev/null +++ b/ruby-saml-custom/test/metadata/no_idp_descriptor.xml @@ -0,0 +1,21 @@ + + + + + + + LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURxekNDQXhTZ0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRc0ZBRENCaGpFTE1Ba0dBMVVFQmhNQ1FWVXgKRERBS0JnTlZCQWdUQTA1VFZ6RVBNQTBHQTFVRUJ4TUdVM2xrYm1WNU1Rd3dDZ1lEVlFRS0RBTlFTVlF4Q1RBSApCZ05WQkFzTUFERVlNQllHQTFVRUF3d1BiR0YzY21WdVkyVndhWFF1WTI5dE1TVXdJd1lKS29aSWh2Y05BUWtCCkRCWnNZWGR5Wlc1alpTNXdhWFJBWjIxaGFXd3VZMjl0TUI0WERURXlNRFF4T1RJeU5UUXhPRm9YRFRNeU1EUXgKTkRJeU5UUXhPRm93Z1lZeEN6QUpCZ05WQkFZVEFrRlZNUXd3Q2dZRFZRUUlFd05PVTF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+ + + + diff --git a/ruby-saml-custom/test/metadata_test.rb b/ruby-saml-custom/test/metadata_test.rb new file mode 100644 index 0000000..9f9f3d1 --- /dev/null +++ b/ruby-saml-custom/test/metadata_test.rb @@ -0,0 +1,386 @@ +require File.expand_path(File.join(File.dirname(__FILE__), "test_helper")) + +require 'onelogin/ruby-saml/metadata' + +class MetadataTest < Minitest::Test + + describe 'Metadata' do + let(:settings) { OneLogin::RubySaml::Settings.new } + let(:xml_text) { OneLogin::RubySaml::Metadata.new.generate(settings, false) } + let(:xml_doc) { REXML::Document.new(xml_text) } + let(:spsso_descriptor) { REXML::XPath.first(xml_doc, "//md:SPSSODescriptor") } + let(:acs) { REXML::XPath.first(xml_doc, "//md:AssertionConsumerService") } + + before do + settings.sp_entity_id = "https://example.com" + settings.name_identifier_format = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" + settings.assertion_consumer_service_url = "https://foo.example/saml/consume" + end + + it "generates Pretty Print Service Provider Metadata" do + xml_text = OneLogin::RubySaml::Metadata.new.generate(settings, true) + # assert correct xml declaration + start = "\n "urn:oasis:names:tc:SAML:2.0:metadata" + ) + end + let(:cert_nodes) do + REXML::XPath.match( + xml_doc, + "//md:KeyDescriptor/ds:KeyInfo/ds:X509Data/ds:X509Certificate", + "md" => "urn:oasis:names:tc:SAML:2.0:metadata", + "ds" => "http://www.w3.org/2000/09/xmldsig#" + ) + end + let(:cert) { OpenSSL::X509::Certificate.new(Base64.decode64(cert_nodes[0].text)) } + + before do + settings.certificate = ruby_saml_cert_text + end + + it "generates Service Provider Metadata with X509Certificate for sign" do + assert_equal 1, key_descriptors.length + assert_equal "signing", key_descriptors[0].attribute("use").value + + assert_equal 1, cert_nodes.length + assert_equal ruby_saml_cert.to_der, cert.to_der + + assert validate_xml!(xml_text, "saml-schema-metadata-2.0.xsd") + end + + describe "and signed authentication requests" do + before do + settings.security[:authn_requests_signed] = true + end + + it "generates Service Provider Metadata with AuthnRequestsSigned" do + assert_equal "true", spsso_descriptor.attribute("AuthnRequestsSigned").value + assert validate_xml!(xml_text, "saml-schema-metadata-2.0.xsd") + end + end + + describe "and encrypted assertions" do + before do + settings.security[:want_assertions_encrypted] = true + end + + it "generates Service Provider Metadata with X509Certificate for encrypt" do + assert_equal 2, key_descriptors.length + + assert_equal "encryption", key_descriptors[1].attribute("use").value + + assert_equal 2, cert_nodes.length + assert_equal cert_nodes[0].text, cert_nodes[1].text + assert validate_xml!(xml_text, "saml-schema-metadata-2.0.xsd") + end + end + end + + describe "with a future SP certificate" do + let(:key_descriptors) do + REXML::XPath.match( + xml_doc, + "//md:KeyDescriptor", + "md" => "urn:oasis:names:tc:SAML:2.0:metadata" + ) + end + let(:cert_nodes) do + REXML::XPath.match( + xml_doc, + "//md:KeyDescriptor/ds:KeyInfo/ds:X509Data/ds:X509Certificate", + "md" => "urn:oasis:names:tc:SAML:2.0:metadata", + "ds" => "http://www.w3.org/2000/09/xmldsig#" + ) + end + + before do + settings.certificate = ruby_saml_cert_text + settings.certificate_new = ruby_saml_cert_text2 + end + + it "generates Service Provider Metadata with 2 X509Certificate for sign" do + assert_equal 2, key_descriptors.length + assert_equal "signing", key_descriptors[0].attribute("use").value + assert_equal "signing", key_descriptors[1].attribute("use").value + + cert = OpenSSL::X509::Certificate.new(Base64.decode64(cert_nodes[0].text)) + cert_new = OpenSSL::X509::Certificate.new(Base64.decode64(cert_nodes[1].text)) + + assert_equal 2, cert_nodes.length + assert_equal ruby_saml_cert.to_der, cert.to_der + assert_equal ruby_saml_cert2.to_der, cert_new.to_der + + assert validate_xml!(xml_text, "saml-schema-metadata-2.0.xsd") + end + + describe "and signed authentication requests" do + before do + settings.security[:authn_requests_signed] = true + end + + it "generates Service Provider Metadata with AuthnRequestsSigned" do + assert_equal "true", spsso_descriptor.attribute("AuthnRequestsSigned").value + assert validate_xml!(xml_text, "saml-schema-metadata-2.0.xsd") + end + end + + describe "and encrypted assertions" do + before do + settings.security[:want_assertions_encrypted] = true + end + + it "generates Service Provider Metadata with X509Certificate for encrypt" do + assert_equal 4, key_descriptors.length + assert_equal "signing", key_descriptors[0].attribute("use").value + assert_equal "encryption", key_descriptors[1].attribute("use").value + assert_equal "signing", key_descriptors[2].attribute("use").value + assert_equal "encryption", key_descriptors[3].attribute("use").value + + assert_equal 4, cert_nodes.length + assert_equal cert_nodes[0].text, cert_nodes[1].text + assert_equal cert_nodes[2].text, cert_nodes[3].text + assert validate_xml!(xml_text, "saml-schema-metadata-2.0.xsd") + end + end + + end + + describe "when attribute service is configured with multiple attribute values" do + let(:attr_svc) { REXML::XPath.first(xml_doc, "//md:AttributeConsumingService") } + let(:req_attr) { REXML::XPath.first(xml_doc, "//md:RequestedAttribute") } + + before do + settings.attribute_consuming_service.configure do + service_name "Test Service" + add_attribute(:name => 'Name', :name_format => 'Name Format', :friendly_name => 'Friendly Name', :attribute_value => ['Attribute Value One', false]) + end + end + + it "generates attribute service" do + assert_equal "true", attr_svc.attribute("isDefault").value + assert_equal "1", attr_svc.attribute("index").value + assert_equal REXML::XPath.first(xml_doc, "//md:ServiceName").text.strip, "Test Service" + + assert_equal "Name", req_attr.attribute("Name").value + assert_equal "Name Format", req_attr.attribute("NameFormat").value + assert_equal "Friendly Name", req_attr.attribute("FriendlyName").value + + attribute_values = REXML::XPath.match(xml_doc, "//saml:AttributeValue").map(&:text) + assert_equal "Attribute Value One", attribute_values[0] + assert_equal 'false', attribute_values[1] + + assert validate_xml!(xml_text, "saml-schema-metadata-2.0.xsd") + end + end + + describe "when attribute service is configured" do + let(:attr_svc) { REXML::XPath.first(xml_doc, '//md:AttributeConsumingService') } + let(:req_attr) { REXML::XPath.first(xml_doc, '//md:RequestedAttribute') } + + before do + settings.attribute_consuming_service.configure do + service_name "Test Service" + add_attribute(:name => 'active', :name_format => 'format', :friendly_name => 'Active', :attribute_value => true) + end + end + + it "generates attribute service" do + assert_equal "true", attr_svc.attribute("isDefault").value + assert_equal "1", attr_svc.attribute("index").value + assert_equal REXML::XPath.first(xml_doc, "//md:ServiceName").text.strip, "Test Service" + + assert_equal 'active', req_attr.attribute('Name').value + assert_equal 'format', req_attr.attribute('NameFormat').value + assert_equal 'Active', req_attr.attribute('FriendlyName').value + assert_equal 'true', REXML::XPath.first(xml_doc, '//saml:AttributeValue').text.strip + + assert validate_xml!(xml_text, "saml-schema-metadata-2.0.xsd") + end + + describe "#service_name" do + before do + settings.attribute_consuming_service.service_name("Test2 Service") + end + + it "change service name" do + assert_equal REXML::XPath.first(xml_doc, "//md:ServiceName").text.strip, "Test2 Service" + end + end + + describe "#service_index" do + before do + settings.attribute_consuming_service.service_index(2) + end + + it "change service index" do + assert_equal "2", attr_svc.attribute("index").value + end + end + end + + describe "when the settings indicate to sign (embedded) metadata" do + before do + settings.security[:metadata_signed] = true + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + end + + it "creates a signed metadata" do + assert_match %r[([a-zA-Z0-9/+=]+)]m, xml_text + assert_match %r[], xml_text + assert_match %r[], xml_text + + signed_metadata = XMLSecurity::SignedDocument.new(xml_text) + assert signed_metadata.validate_document(ruby_saml_cert_fingerprint, false) + + assert validate_xml!(xml_text, "saml-schema-metadata-2.0.xsd") + end + + describe "when digest and signature methods are specified" do + before do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA256 + settings.security[:digest_method] = XMLSecurity::Document::SHA512 + end + + it "creates a signed metadata with specified digest and signature methods" do + assert_match %r[([a-zA-Z0-9/+=]+)]m, xml_text + assert_match %r[], xml_text + assert_match %r[], xml_text + + signed_metadata = XMLSecurity::SignedDocument.new(xml_text) + assert signed_metadata.validate_document(ruby_saml_cert_fingerprint, false) + + assert validate_xml!(xml_text, "saml-schema-metadata-2.0.xsd") + end + end + + describe "when custom metadata elements have been inserted" do + let(:xml_text) { subclass.new.generate(settings, false) } + let(:subclass) do + Class.new(OneLogin::RubySaml::Metadata) do + def add_extras(root, _settings) + idp = REXML::Element.new("md:IDPSSODescriptor") + idp.attributes['protocolSupportEnumeration'] = 'urn:oasis:names:tc:SAML:2.0:protocol' + + nid = REXML::Element.new("md:NameIDFormat") + nid.text = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress' + idp.add_element(nid) + + sso = REXML::Element.new("md:SingleSignOnService") + sso.attributes['Binding'] = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST' + sso.attributes['Location'] = 'https://foobar.com/sso' + idp.add_element(sso) + root.insert_before(root.children[0], idp) + + org = REXML::Element.new("md:Organization") + org.add_element("md:OrganizationName", 'xml:lang' => "en-US").text = 'ACME Inc.' + org.add_element("md:OrganizationDisplayName", 'xml:lang' => "en-US").text = 'ACME' + org.add_element("md:OrganizationURL", 'xml:lang' => "en-US").text = 'https://www.acme.com' + root.insert_after(root.children[3], org) + end + end + end + + it "inserts signature as the first child of root element" do + first_child = xml_doc.root.children[0] + assert_equal first_child.prefix, 'ds' + assert_equal first_child.name, 'Signature' + + assert_match %r[([a-zA-Z0-9/+=]+)]m, xml_text + assert_match %r[], xml_text + assert_match %r[], xml_text + + signed_metadata = XMLSecurity::SignedDocument.new(xml_text) + assert signed_metadata.validate_document(ruby_saml_cert_fingerprint, false) + + assert validate_xml!(xml_text, "saml-schema-metadata-2.0.xsd") + end + end + end + end +end diff --git a/ruby-saml-custom/test/request_test.rb b/ruby-saml-custom/test/request_test.rb new file mode 100644 index 0000000..b2c061a --- /dev/null +++ b/ruby-saml-custom/test/request_test.rb @@ -0,0 +1,416 @@ +require File.expand_path(File.join(File.dirname(__FILE__), "test_helper")) + +require 'onelogin/ruby-saml/authrequest' +require 'onelogin/ruby-saml/setting_error' + +class RequestTest < Minitest::Test + + describe "Authrequest" do + let(:settings) { OneLogin::RubySaml::Settings.new } + + before do + settings.idp_sso_service_url = "http://example.com" + end + + it "create the deflated SAMLRequest URL parameter" do + auth_url = OneLogin::RubySaml::Authrequest.new.create(settings) + assert_match /^http:\/\/example\.com\?SAMLRequest=/, auth_url + payload = CGI.unescape(auth_url.split("=").last) + decoded = Base64.decode64(payload) + + zstream = Zlib::Inflate.new(-Zlib::MAX_WBITS) + inflated = zstream.inflate(decoded) + zstream.finish + zstream.close + + assert_match /^') + assert inflated.include?("testuser@example.com") + assert inflated.include?("") + end + + it "accept extra parameters" do + auth_url = OneLogin::RubySaml::Authrequest.new.create(settings, { :hello => "there" }) + assert_match /&hello=there$/, auth_url + + auth_url = OneLogin::RubySaml::Authrequest.new.create(settings, { :hello => nil }) + assert_match /&hello=$/, auth_url + end + + it "RelayState cases" do + auth_url = OneLogin::RubySaml::Authrequest.new.create(settings, { :RelayState => nil }) + assert !auth_url.include?('RelayState') + + auth_url = OneLogin::RubySaml::Authrequest.new.create(settings, { :RelayState => "http://example.com" }) + assert auth_url.include?('&RelayState=http%3A%2F%2Fexample.com') + + auth_url = OneLogin::RubySaml::Authrequest.new.create(settings, { 'RelayState' => nil }) + assert !auth_url.include?('RelayState') + + auth_url = OneLogin::RubySaml::Authrequest.new.create(settings, { 'RelayState' => "http://example.com" }) + assert auth_url.include?('&RelayState=http%3A%2F%2Fexample.com') + end + + it "creates request with ID prefixed with default '_'" do + request = OneLogin::RubySaml::Authrequest.new + + assert_match /^_/, request.uuid + end + + it "creates request with ID is prefixed, when :id_prefix is passed" do + OneLogin::RubySaml::Utils::set_prefix("test") + request = OneLogin::RubySaml::Authrequest.new + assert_match /^test/, request.uuid + OneLogin::RubySaml::Utils::set_prefix("_") + end + + describe "when the target url is not set" do + before do + settings.idp_sso_service_url = nil + end + + it "raises an error with a descriptive message" do + err = assert_raises OneLogin::RubySaml::SettingError do + OneLogin::RubySaml::Authrequest.new.create(settings) + end + assert_match /idp_sso_service_url is not set/, err.message + end + end + + describe "when the target url doesn't contain a query string" do + it "create the SAMLRequest parameter correctly" do + + auth_url = OneLogin::RubySaml::Authrequest.new.create(settings) + assert_match /^http:\/\/example.com\?SAMLRequest/, auth_url + end + end + + describe "when the target url contains a query string" do + it "create the SAMLRequest parameter correctly" do + settings.idp_sso_service_url = "http://example.com?field=value" + + auth_url = OneLogin::RubySaml::Authrequest.new.create(settings) + assert_match /^http:\/\/example.com\?field=value&SAMLRequest/, auth_url + end + end + + it "create the saml:AuthnContextClassRef element correctly" do + settings.authn_context = 'secure/name/password/uri' + auth_doc = OneLogin::RubySaml::Authrequest.new.create_authentication_xml_doc(settings) + assert_match /secure\/name\/password\/uri<\/saml:AuthnContextClassRef>/, auth_doc.to_s + end + + it "create multiple saml:AuthnContextClassRef elements correctly" do + settings.authn_context = ['secure/name/password/uri', 'secure/email/password/uri'] + auth_doc = OneLogin::RubySaml::Authrequest.new.create_authentication_xml_doc(settings) + assert_match /secure\/name\/password\/uri<\/saml:AuthnContextClassRef>/, auth_doc.to_s + assert_match /secure\/email\/password\/uri<\/saml:AuthnContextClassRef>/, auth_doc.to_s + end + + it "create the saml:AuthnContextClassRef with comparison exact" do + settings.authn_context = 'secure/name/password/uri' + auth_doc = OneLogin::RubySaml::Authrequest.new.create_authentication_xml_doc(settings) + assert_match /secure\/name\/password\/uri<\/saml:AuthnContextClassRef>/, auth_doc.to_s + end + + it "create the saml:AuthnContextClassRef with comparison minimun" do + settings.authn_context = 'secure/name/password/uri' + settings.authn_context_comparison = 'minimun' + auth_doc = OneLogin::RubySaml::Authrequest.new.create_authentication_xml_doc(settings) + assert_match /secure\/name\/password\/uri<\/saml:AuthnContextClassRef>/, auth_doc.to_s + end + + it "create the saml:AuthnContextDeclRef element correctly" do + settings.authn_context_decl_ref = 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport' + auth_doc = OneLogin::RubySaml::Authrequest.new.create_authentication_xml_doc(settings) + assert_match /urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport<\/saml:AuthnContextDeclRef>/, auth_doc.to_s + end + + describe "#create_params signing with HTTP-POST binding" do + before do + settings.compress_request = false + settings.idp_sso_service_url = "http://example.com?field=value" + settings.idp_sso_service_binding = :post + settings.security[:authn_requests_signed] = true + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + end + + it "create a signed request" do + params = OneLogin::RubySaml::Authrequest.new.create_params(settings) + request_xml = Base64.decode64(params["SAMLRequest"]) + assert_match %r[([a-zA-Z0-9/+=]+)], request_xml + assert_match %r[], request_xml + end + + it "create a signed request with 256 digest and signature methods" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA256 + settings.security[:digest_method] = XMLSecurity::Document::SHA512 + + params = OneLogin::RubySaml::Authrequest.new.create_params(settings) + + request_xml = Base64.decode64(params["SAMLRequest"]) + assert_match %r[([a-zA-Z0-9/+=]+)], request_xml + assert_match %r[], request_xml + assert_match %r[], request_xml + end + end + + describe "#create_params signing with HTTP-Redirect binding" do + let(:cert) { OpenSSL::X509::Certificate.new(ruby_saml_cert_text) } + + before do + settings.compress_request = false + settings.idp_sso_service_url = "http://example.com?field=value" + settings.idp_sso_service_binding = :redirect + settings.assertion_consumer_service_binding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign" + settings.security[:authn_requests_signed] = true + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + end + + it "create a signature parameter with RSA_SHA1 and validate it" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + + params = OneLogin::RubySaml::Authrequest.new.create_params(settings, :RelayState => 'http://example.com') + assert params['SAMLRequest'] + assert params[:RelayState] + assert params['Signature'] + assert_equal params['SigAlg'], XMLSecurity::Document::RSA_SHA1 + + query_string = "SAMLRequest=#{CGI.escape(params['SAMLRequest'])}" + query_string << "&RelayState=#{CGI.escape(params[:RelayState])}" + query_string << "&SigAlg=#{CGI.escape(params['SigAlg'])}" + + signature_algorithm = XMLSecurity::BaseDocument.new.algorithm(params['SigAlg']) + assert_equal signature_algorithm, OpenSSL::Digest::SHA1 + + assert cert.public_key.verify(signature_algorithm.new, Base64.decode64(params['Signature']), query_string) + end + + it "create a signature parameter with RSA_SHA256 and validate it" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA256 + + params = OneLogin::RubySaml::Authrequest.new.create_params(settings, :RelayState => 'http://example.com') + assert params['Signature'] + assert_equal params['SigAlg'], XMLSecurity::Document::RSA_SHA256 + + query_string = "SAMLRequest=#{CGI.escape(params['SAMLRequest'])}" + query_string << "&RelayState=#{CGI.escape(params[:RelayState])}" + query_string << "&SigAlg=#{CGI.escape(params['SigAlg'])}" + + signature_algorithm = XMLSecurity::BaseDocument.new.algorithm(params['SigAlg']) + assert_equal signature_algorithm, OpenSSL::Digest::SHA256 + assert cert.public_key.verify(signature_algorithm.new, Base64.decode64(params['Signature']), query_string) + end + end + + it "create the saml:AuthnContextClassRef element correctly" do + settings.authn_context = 'secure/name/password/uri' + auth_doc = OneLogin::RubySaml::Authrequest.new.create_authentication_xml_doc(settings) + assert auth_doc.to_s =~ /secure\/name\/password\/uri<\/saml:AuthnContextClassRef>/ + end + + it "create the saml:AuthnContextClassRef with comparison exact" do + settings.authn_context = 'secure/name/password/uri' + auth_doc = OneLogin::RubySaml::Authrequest.new.create_authentication_xml_doc(settings) + assert auth_doc.to_s =~ /secure\/name\/password\/uri<\/saml:AuthnContextClassRef>/ + end + + it "create the saml:AuthnContextClassRef with comparison minimun" do + settings.authn_context = 'secure/name/password/uri' + settings.authn_context_comparison = 'minimun' + auth_doc = OneLogin::RubySaml::Authrequest.new.create_authentication_xml_doc(settings) + assert auth_doc.to_s =~ /secure\/name\/password\/uri<\/saml:AuthnContextClassRef>/ + end + + it "create the saml:AuthnContextDeclRef element correctly" do + settings.authn_context_decl_ref = 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport' + auth_doc = OneLogin::RubySaml::Authrequest.new.create_authentication_xml_doc(settings) + assert auth_doc.to_s =~ /urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport<\/saml:AuthnContextDeclRef>/ + end + + it "create multiple saml:AuthnContextDeclRef elements correctly " do + settings.authn_context_decl_ref = ['name/password/uri', 'example/decl/ref'] + auth_doc = OneLogin::RubySaml::Authrequest.new.create_authentication_xml_doc(settings) + assert auth_doc.to_s =~ /name\/password\/uri<\/saml:AuthnContextDeclRef>/ + assert auth_doc.to_s =~ /example\/decl\/ref<\/saml:AuthnContextDeclRef>/ + end + + describe "DEPRECATED: #create_params signing with HTTP-POST binding via :embed_sign" do + before do + settings.compress_request = false + settings.idp_sso_service_url = "http://example.com?field=value" + settings.security[:authn_requests_signed] = true + settings.security[:embed_sign] = true + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + end + + it "create a signed request" do + params = OneLogin::RubySaml::Authrequest.new.create_params(settings) + request_xml = Base64.decode64(params["SAMLRequest"]) + assert_match %r[([a-zA-Z0-9/+=]+)], request_xml + assert_match %r[], request_xml + end + end + + describe "DEPRECATED: #create_params signing with HTTP-Redirect binding via :embed_sign" do + let(:cert) { OpenSSL::X509::Certificate.new(ruby_saml_cert_text) } + + before do + settings.compress_request = false + settings.idp_sso_service_url = "http://example.com?field=value" + settings.assertion_consumer_service_binding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign" + settings.security[:authn_requests_signed] = true + settings.security[:embed_sign] = false + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + end + + it "create a signature parameter with RSA_SHA1 and validate it" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + + params = OneLogin::RubySaml::Authrequest.new.create_params(settings, :RelayState => 'http://example.com') + assert params['SAMLRequest'] + assert params[:RelayState] + assert params['Signature'] + assert_equal params['SigAlg'], XMLSecurity::Document::RSA_SHA1 + + query_string = "SAMLRequest=#{CGI.escape(params['SAMLRequest'])}" + query_string << "&RelayState=#{CGI.escape(params[:RelayState])}" + query_string << "&SigAlg=#{CGI.escape(params['SigAlg'])}" + + signature_algorithm = XMLSecurity::BaseDocument.new.algorithm(params['SigAlg']) + assert_equal signature_algorithm, OpenSSL::Digest::SHA1 + + assert cert.public_key.verify(signature_algorithm.new, Base64.decode64(params['Signature']), query_string) + end + end + + describe "#manipulate request_id" do + it "be able to modify the request id" do + authnrequest = OneLogin::RubySaml::Authrequest.new + request_id = authnrequest.request_id + assert_equal request_id, authnrequest.uuid + authnrequest.uuid = "new_uuid" + assert_equal authnrequest.request_id, authnrequest.uuid + assert_equal "new_uuid", authnrequest.request_id + end + end + end +end diff --git a/ruby-saml-custom/test/response_test.rb b/ruby-saml-custom/test/response_test.rb new file mode 100644 index 0000000..a51f348 --- /dev/null +++ b/ruby-saml-custom/test/response_test.rb @@ -0,0 +1,1745 @@ +require File.expand_path(File.join(File.dirname(__FILE__), "test_helper")) + +require 'onelogin/ruby-saml/response' + +class RubySamlTest < Minitest::Test + + describe "Response" do + + let(:settings) { OneLogin::RubySaml::Settings.new } + let(:response) { OneLogin::RubySaml::Response.new(response_document_without_recipient) } + let(:response_without_attributes) { OneLogin::RubySaml::Response.new(response_document_without_attributes) } + let(:response_with_multiple_attribute_statements) { OneLogin::RubySaml::Response.new(fixture(:response_with_multiple_attribute_statements)) } + let(:response_without_reference_uri) { OneLogin::RubySaml::Response.new(response_document_without_reference_uri) } + let(:response_with_signed_assertion) { OneLogin::RubySaml::Response.new(response_document_with_signed_assertion) } + let(:response_with_ds_namespace_at_the_root) { OneLogin::RubySaml::Response.new(response_document_with_ds_namespace_at_the_root)} + let(:response_unsigned) { OneLogin::RubySaml::Response.new(response_document_unsigned) } + let(:response_wrapped) { OneLogin::RubySaml::Response.new(response_document_wrapped) } + let(:response_multiple_attr_values) { OneLogin::RubySaml::Response.new(fixture(:response_with_multiple_attribute_values)) } + let(:response_valid_signed) { OneLogin::RubySaml::Response.new(response_document_valid_signed) } + let(:response_valid_signed_without_recipient) { OneLogin::RubySaml::Response.new(response_document_valid_signed, {:skip_recipient_check => true })} + let(:response_valid_signed_without_x509certificate) { OneLogin::RubySaml::Response.new(response_document_valid_signed_without_x509certificate) } + let(:response_no_id) { OneLogin::RubySaml::Response.new(read_invalid_response("no_id.xml.base64")) } + let(:response_no_version) { OneLogin::RubySaml::Response.new(read_invalid_response("no_saml2.xml.base64")) } + let(:response_multi_assertion) { OneLogin::RubySaml::Response.new(read_invalid_response("multiple_assertions.xml.base64")) } + let(:response_no_conditions) { OneLogin::RubySaml::Response.new(read_invalid_response("no_conditions.xml.base64")) } + let(:response_no_conditions_with_skip) { OneLogin::RubySaml::Response.new(read_invalid_response("no_conditions.xml.base64"), { :skip_conditions => true }) } + let(:response_no_authnstatement) { OneLogin::RubySaml::Response.new(read_invalid_response("no_authnstatement.xml.base64")) } + let(:response_no_authnstatement_with_skip) { OneLogin::RubySaml::Response.new(read_invalid_response("no_authnstatement.xml.base64"), {:skip_authnstatement => true}) } + let(:response_empty_destination) { OneLogin::RubySaml::Response.new(read_invalid_response("empty_destination.xml.base64")) } + let(:response_empty_destination_with_skip) { OneLogin::RubySaml::Response.new(read_invalid_response("empty_destination.xml.base64"), {:skip_destination => true}) } + let(:response_no_status) { OneLogin::RubySaml::Response.new(read_invalid_response("no_status.xml.base64")) } + let(:response_no_statuscode) { OneLogin::RubySaml::Response.new(read_invalid_response("no_status_code.xml.base64")) } + let(:response_statuscode_responder) { OneLogin::RubySaml::Response.new(read_invalid_response("status_code_responder.xml.base64")) } + let(:response_statuscode_responder_and_msg) { OneLogin::RubySaml::Response.new(read_invalid_response("status_code_responer_and_msg.xml.base64")) } + let(:response_double_statuscode) { OneLogin::RubySaml::Response.new(response_document_double_status_code) } + let(:response_encrypted_attrs) { OneLogin::RubySaml::Response.new(response_document_encrypted_attrs) } + let(:response_no_signed_elements) { OneLogin::RubySaml::Response.new(read_invalid_response("no_signature.xml.base64")) } + let(:response_multiple_signed) { OneLogin::RubySaml::Response.new(read_invalid_response("multiple_signed.xml.base64")) } + let(:response_audience_self_closed) { OneLogin::RubySaml::Response.new(read_response("response_audience_self_closed_tag.xml.base64")) } + let(:response_invalid_audience) { OneLogin::RubySaml::Response.new(read_invalid_response("invalid_audience.xml.base64")) } + let(:response_invalid_audience_with_skip) { OneLogin::RubySaml::Response.new(read_invalid_response("invalid_audience.xml.base64"), {:skip_audience => true}) } + let(:response_invalid_signed_element) { OneLogin::RubySaml::Response.new(read_invalid_response("response_invalid_signed_element.xml.base64")) } + let(:response_invalid_issuer_assertion) { OneLogin::RubySaml::Response.new(read_invalid_response("invalid_issuer_assertion.xml.base64")) } + let(:response_invalid_issuer_message) { OneLogin::RubySaml::Response.new(read_invalid_response("invalid_issuer_message.xml.base64")) } + let(:response_no_issuer_response) { OneLogin::RubySaml::Response.new(read_invalid_response("no_issuer_response.xml.base64")) } + let(:response_no_issuer_assertion) { OneLogin::RubySaml::Response.new(read_invalid_response("no_issuer_assertion.xml.base64")) } + let(:response_no_nameid) { OneLogin::RubySaml::Response.new(read_invalid_response("no_nameid.xml.base64")) } + let(:response_empty_nameid) { OneLogin::RubySaml::Response.new(read_invalid_response("empty_nameid.xml.base64")) } + let(:response_wrong_spnamequalifier) { OneLogin::RubySaml::Response.new(read_invalid_response("wrong_spnamequalifier.xml.base64")) } + let(:response_duplicated_attributes) { OneLogin::RubySaml::Response.new(read_invalid_response("duplicated_attributes.xml.base64")) } + let(:response_no_subjectconfirmation_data) { OneLogin::RubySaml::Response.new(read_invalid_response("no_subjectconfirmation_data.xml.base64")) } + let(:response_no_subjectconfirmation_method) { OneLogin::RubySaml::Response.new(read_invalid_response("no_subjectconfirmation_method.xml.base64")) } + let(:response_invalid_subjectconfirmation_inresponse) { OneLogin::RubySaml::Response.new(read_invalid_response("invalid_subjectconfirmation_inresponse.xml.base64")) } + let(:response_invalid_subjectconfirmation_recipient) { OneLogin::RubySaml::Response.new(read_invalid_response("invalid_subjectconfirmation_recipient.xml.base64")) } + let(:response_invalid_subjectconfirmation_nb) { OneLogin::RubySaml::Response.new(read_invalid_response("invalid_subjectconfirmation_nb.xml.base64")) } + let(:response_invalid_subjectconfirmation_noa) { OneLogin::RubySaml::Response.new(read_invalid_response("invalid_subjectconfirmation_noa.xml.base64")) } + let(:response_invalid_signature_position) { OneLogin::RubySaml::Response.new(read_invalid_response("invalid_signature_position.xml.base64")) } + let(:response_encrypted_nameid) { OneLogin::RubySaml::Response.new(response_document_encrypted_nameid) } + + def generate_audience_error(expected, actual) + s = actual.count > 1 ? 's' : ''; + return "Invalid Audience#{s}. The audience#{s} #{actual.join(',')}, did not match the expected audience #{expected}" + end + + it "raise an exception when response is initialized with nil" do + assert_raises(ArgumentError) { OneLogin::RubySaml::Response.new(nil) } + end + + it "not filter available options only" do + options = { :skip_destination => true, :foo => :bar } + response = OneLogin::RubySaml::Response.new(response_document_valid_signed, options) + assert_includes response.options.keys, :skip_destination + assert_includes response.options.keys, :foo + end + + it "be able to parse a document which contains ampersands" do + XMLSecurity::SignedDocument.any_instance.stubs(:digests_match?).returns(true) + OneLogin::RubySaml::Response.any_instance.stubs(:validate_conditions).returns(true) + + ampersands_response = OneLogin::RubySaml::Response.new(ampersands_document) + ampersands_response.settings = settings + ampersands_response.settings.idp_cert_fingerprint = 'c51985d947f1be57082025050846eb27f6cab783' + + assert !ampersands_response.is_valid? + assert_includes ampersands_response.errors, "SAML Response must contain 1 assertion" + end + + describe "Prevent node text with comment attack (VU#475445)" do + before do + @response = OneLogin::RubySaml::Response.new(read_response('response_node_text_attack.xml.base64')) + end + + it "receives the full NameID when there is an injected comment" do + assert_equal "support@onelogin.com", @response.name_id + end + + it "receives the full AttributeValue when there is an injected comment" do + assert_equal "smith", @response.attributes["surname"] + end + end + + describe "Another test to prevent with comment attack (VU#475445)" do + before do + @response = OneLogin::RubySaml::Response.new(read_response('response_node_text_attack2.xml.base64'), {:skip_recipient_check => true }) + @response.settings = settings + @response.settings.idp_cert_fingerprint = ruby_saml_cert_fingerprint + end + + it "receives the full NameID when there is an injected comment, validates the response" do + assert_equal "test@onelogin.com", @response.name_id + end + end + + describe "Another test with CDATA injected" do + before do + @response = OneLogin::RubySaml::Response.new(read_response('response_node_text_attack3.xml.base64'), {:skip_recipient_check => true }) + @response.settings = settings + @response.settings.idp_cert_fingerprint = ruby_saml_cert_fingerprint + end + + it "it normalizes CDATA but reject SAMLResponse due signature invalidation" do + assert_equal "test@onelogin.com.evil.com", @response.name_id + assert !@response.is_valid? + assert_includes @response.errors, "Invalid Signature on SAML Response" + end + end + + describe "Prevent XEE attack" do + before do + @response = OneLogin::RubySaml::Response.new(fixture(:attackxee)) + end + + it "false when evil attack vector is present, soft = true" do + @response.soft = true + assert !@response.send(:validate_structure) + assert_includes @response.errors, "Invalid SAML Response. Not match the saml-schema-protocol-2.0.xsd" + end + + it "raise when evil attack vector is present, soft = false " do + @response.soft = false + + assert_raises(OneLogin::RubySaml::ValidationError) do + @response.send(:validate_structure) + end + end + end + + it "adapt namespace" do + refute_nil response.nameid + refute_nil response_without_attributes.nameid + refute_nil response_with_signed_assertion.nameid + end + + it "default to raw input when a response is not Base64 encoded" do + decoded = Base64.decode64(response_document_without_attributes) + response_from_raw = OneLogin::RubySaml::Response.new(decoded) + assert response_from_raw.document + end + + describe "Assertion" do + it "only retreive an assertion with an ID that matches the signature's reference URI" do + response_wrapped.stubs(:conditions).returns(nil) + settings.idp_cert_fingerprint = signature_fingerprint_1 + response_wrapped.settings = settings + assert_nil response_wrapped.nameid + end + end + + describe "#is_valid?" do + describe "soft = false" do + + before do + response.soft = false + response_valid_signed.soft = false + end + + it "raise when response is initialized with blank data" do + blank_response = OneLogin::RubySaml::Response.new('') + blank_response.soft = false + error_msg = "Blank response" + assert_raises(OneLogin::RubySaml::ValidationError, error_msg) do + blank_response.is_valid? + end + assert_includes blank_response.errors, error_msg + end + + it "raise when settings have not been set" do + error_msg = "No settings on response" + assert_raises(OneLogin::RubySaml::ValidationError, error_msg) do + response.is_valid? + end + assert_includes response.errors, error_msg + end + + it "raise when No fingerprint or certificate on settings" do + settings.idp_cert_fingerprint = nil + settings.idp_cert = nil + settings.idp_cert_multi = nil + response.settings = settings + error_msg = "No fingerprint or certificate on settings" + assert_raises(OneLogin::RubySaml::ValidationError, error_msg) do + response.is_valid? + end + assert_includes response.errors, error_msg + end + + it "raise when signature wrapping attack" do + response_wrapped.stubs(:conditions).returns(nil) + response_wrapped.stubs(:validate_subject_confirmation).returns(true) + settings.idp_cert_fingerprint = signature_fingerprint_1 + response_wrapped.settings = settings + assert !response_wrapped.is_valid? + end + + it "raise when no signature" do + settings.idp_cert_fingerprint = signature_fingerprint_1 + response_no_signed_elements.settings = settings + response_no_signed_elements.soft = false + error_msg = "Found an unexpected number of Signature Element. SAML Response rejected" + assert_raises(OneLogin::RubySaml::ValidationError, error_msg) do + response_no_signed_elements.is_valid? + end + end + + it "raise when multiple signatures" do + settings.idp_cert_fingerprint = signature_fingerprint_1 + response_multiple_signed.settings = settings + response_multiple_signed.soft = false + error_msg = "Duplicated ID. SAML Response rejected" + assert_raises(OneLogin::RubySaml::ValidationError, error_msg) do + response_multiple_signed.is_valid? + end + end + + it "validate SAML 2.0 XML structure" do + resp_xml = Base64.decode64(response_document_unsigned).gsub(/emailAddress/,'test') + response_unsigned_mod = OneLogin::RubySaml::Response.new(Base64.encode64(resp_xml)) + response_unsigned_mod.stubs(:conditions).returns(nil) + settings.idp_cert_fingerprint = signature_fingerprint_1 + response_unsigned_mod.settings = settings + response_unsigned_mod.soft = false + assert_raises(OneLogin::RubySaml::ValidationError, 'Digest mismatch') do + response_unsigned_mod.is_valid? + end + end + + it "raise when encountering a condition that prevents the document from being valid" do + settings.idp_cert_fingerprint = ruby_saml_cert_fingerprint + response.settings = settings + response.soft = false + error_msg = "Current time is on or after NotOnOrAfter condition" + assert_raises(OneLogin::RubySaml::ValidationError, error_msg) do + response.is_valid? + end + assert_includes response.errors[0], error_msg + end + + it "raise when encountering a SAML Response with bad formatted" do + settings.idp_cert_fingerprint = signature_fingerprint_1 + response_without_attributes.settings = settings + response_without_attributes.soft = false + assert_raises(OneLogin::RubySaml::ValidationError) do + response_without_attributes.is_valid? + end + end + + it "raise when the inResponseTo value does not match the Request ID" do + settings.soft = false + settings.idp_cert_fingerprint = signature_fingerprint_1 + opts = {} + opts[:settings] = settings + opts[:matches_request_id] = "invalid_request_id" + response_valid_signed = OneLogin::RubySaml::Response.new(response_document_valid_signed, opts) + error_msg = "The InResponseTo of the Response: _fc4a34b0-7efb-012e-caae-782bcb13bb38, does not match the ID of the AuthNRequest sent by the SP: invalid_request_id" + assert_raises(OneLogin::RubySaml::ValidationError, error_msg) do + response_valid_signed.is_valid? + end + assert_includes response_valid_signed.errors, error_msg + end + + it "raise when there is no valid audience" do + settings.idp_cert_fingerprint = signature_fingerprint_1 + settings.sp_entity_id = 'invalid' + response_valid_signed.settings = settings + response_valid_signed.soft = false + error_msg = generate_audience_error(response_valid_signed.settings.sp_entity_id, ['https://someone.example.com/audience']) + assert_raises(OneLogin::RubySaml::ValidationError, error_msg) do + response_valid_signed.is_valid? + end + assert_includes response_valid_signed.errors, error_msg + end + + it "raise when no ID present in the SAML Response" do + settings.idp_cert_fingerprint = signature_fingerprint_1 + response_no_id.settings = settings + response_no_id.soft = false + error_msg = "Missing ID attribute on SAML Response" + assert_raises(OneLogin::RubySaml::ValidationError, error_msg) do + response_no_id.is_valid? + end + assert_includes response_no_id.errors, error_msg + end + + it "raise when no 2.0 Version present in the SAML Response" do + settings.idp_cert_fingerprint = signature_fingerprint_1 + response_no_version.settings = settings + response_no_version.soft = false + error_msg = "Unsupported SAML version" + assert_raises(OneLogin::RubySaml::ValidationError, error_msg) do + response_no_version.is_valid? + end + assert_includes response_no_version.errors, error_msg + end + end + + describe "soft = true" do + before do + response.soft = true + response_valid_signed.soft = true + end + + it "return true when the response is initialized with valid data" do + response_valid_signed_without_recipient.stubs(:conditions).returns(nil) + response_valid_signed_without_recipient.settings = settings + response_valid_signed_without_recipient.settings.idp_cert_fingerprint = ruby_saml_cert_fingerprint + assert response_valid_signed_without_recipient.is_valid? + assert_empty response_valid_signed_without_recipient.errors + end + + it "return true when the response is initialized with valid data and using certificate instead of fingerprint" do + response_valid_signed_without_recipient.stubs(:conditions).returns(nil) + response_valid_signed_without_recipient.settings = settings + response_valid_signed_without_recipient.settings.idp_cert = ruby_saml_cert_text + assert response_valid_signed_without_recipient.is_valid? + assert_empty response_valid_signed_without_recipient.errors + end + + it "return false when response is initialized with blank data" do + blank_response = OneLogin::RubySaml::Response.new('') + blank_response.soft = true + assert !blank_response.is_valid? + assert_includes blank_response.errors, "Blank response" + end + + it "return false if settings have not been set" do + assert !response.is_valid? + assert_includes response.errors, "No settings on response" + end + + it "return false if fingerprint or certificate not been set on settings" do + response.settings = settings + assert !response.is_valid? + assert_includes response.errors, "No fingerprint or certificate on settings" + end + + it "should be idempotent when the response is initialized with invalid data" do + response_unsigned.stubs(:conditions).returns(nil) + response_unsigned.settings = settings + assert !response_unsigned.is_valid? + assert !response_unsigned.is_valid? + end + + it "should be idempotent when the response is initialized with valid data" do + response_valid_signed_without_recipient.stubs(:conditions).returns(nil) + response_valid_signed_without_recipient.settings = settings + response_valid_signed_without_recipient.settings.idp_cert_fingerprint = ruby_saml_cert_fingerprint + assert response_valid_signed_without_recipient.is_valid? + assert response_valid_signed_without_recipient.is_valid? + end + + it "not allow signature wrapping attack" do + response_wrapped.stubs(:conditions).returns(nil) + response_wrapped.stubs(:validate_subject_confirmation).returns(true) + settings.idp_cert_fingerprint = signature_fingerprint_1 + response_wrapped.settings = settings + assert !response_wrapped.is_valid? + end + + it "support dynamic namespace resolution on signature elements" do + no_signature_response = OneLogin::RubySaml::Response.new(fixture("no_signature_ns.xml")) + no_signature_response.stubs(:conditions).returns(nil) + no_signature_response.stubs(:validate_subject_confirmation).returns(true) + no_signature_response.settings = settings + no_signature_response.settings.idp_cert_fingerprint = "28:74:9B:E8:1F:E8:10:9C:A8:7C:A9:C3:E3:C5:01:6C:92:1C:B4:BA" + XMLSecurity::SignedDocument.any_instance.expects(:validate_signature).returns(true) + assert no_signature_response.is_valid? + end + + it "validate ADFS assertions" do + adfs_response = OneLogin::RubySaml::Response.new(fixture(:adfs_response_sha256)) + adfs_response.stubs(:conditions).returns(nil) + adfs_response.stubs(:validate_subject_confirmation).returns(true) + settings.idp_cert_fingerprint = "28:74:9B:E8:1F:E8:10:9C:A8:7C:A9:C3:E3:C5:01:6C:92:1C:B4:BA" + adfs_response.settings = settings + adfs_response.soft = true + assert adfs_response.is_valid? + end + + it "validate SAML 2.0 XML structure" do + resp_xml = Base64.decode64(response_document_unsigned).gsub(/emailAddress/,'test') + response_unsigned_mod = OneLogin::RubySaml::Response.new(Base64.encode64(resp_xml)) + response_unsigned_mod.stubs(:conditions).returns(nil) + settings.idp_cert_fingerprint = signature_fingerprint_1 + response_unsigned_mod.settings = settings + response_unsigned_mod.soft = true + assert !response_unsigned_mod.is_valid? + end + + it "return false when encountering a condition that prevents the document from being valid" do + settings.idp_cert_fingerprint = ruby_saml_cert_fingerprint + response.settings = settings + error_msg = "Current time is on or after NotOnOrAfter condition" + assert !response.is_valid? + assert_includes response.errors[0], "Current time is on or after NotOnOrAfter condition" + end + + it "return false when encountering a SAML Response with bad formatted" do + settings.idp_cert_fingerprint = signature_fingerprint_1 + response_without_attributes.settings = settings + response_without_attributes.soft = true + error_msg = "Invalid SAML Response. Not match the saml-schema-protocol-2.0.xsd" + response_without_attributes.is_valid? + assert_includes response_without_attributes.errors, error_msg + end + + it "return false when the inResponseTo value does not match the Request ID" do + settings.soft = true + settings.idp_cert_fingerprint = signature_fingerprint_1 + opts = {} + opts[:settings] = settings + opts[:matches_request_id] = "invalid_request_id" + response_valid_signed = OneLogin::RubySaml::Response.new(response_document_valid_signed, opts) + response_valid_signed.is_valid? + assert_includes response_valid_signed.errors, "The InResponseTo of the Response: _fc4a34b0-7efb-012e-caae-782bcb13bb38, does not match the ID of the AuthNRequest sent by the SP: invalid_request_id" + end + + it "return false when there is no valid audience" do + settings.idp_cert_fingerprint = signature_fingerprint_1 + settings.sp_entity_id = 'invalid' + response_valid_signed.settings = settings + response_valid_signed.is_valid? + + assert_includes response_valid_signed.errors, generate_audience_error(response_valid_signed.settings.sp_entity_id, ['https://someone.example.com/audience']) + end + + it "return false when no ID present in the SAML Response" do + settings.idp_cert_fingerprint = signature_fingerprint_1 + response_no_id.settings = settings + response_no_id.soft = true + response_no_id.is_valid? + assert_includes response_no_id.errors, "Missing ID attribute on SAML Response" + end + + it "return false when no 2.0 Version present in the SAML Response" do + settings.idp_cert_fingerprint = signature_fingerprint_1 + response_no_version.settings = settings + response_no_version.soft = true + error_msg = "Unsupported SAML version" + response_no_version.is_valid? + assert_includes response_no_version.errors, "Unsupported SAML version" + end + + it "return true when a nil URI is given in the ds:Reference" do + settings.idp_cert = ruby_saml_cert_text + settings.assertion_consumer_service_url = "http://localhost:9001/v1/users/authorize/saml" + response_without_reference_uri.settings = settings + response_without_reference_uri.stubs(:conditions).returns(nil) + response_without_reference_uri.is_valid? + assert_empty response_without_reference_uri.errors + assert 'saml@user.com', response_without_reference_uri.attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress'] + end + + it "collect errors when collect_errors=true" do + settings.idp_cert = ruby_saml_cert_text + settings.sp_entity_id = 'invalid' + response_invalid_subjectconfirmation_recipient.settings = settings + collect_errors = true + response_invalid_subjectconfirmation_recipient.is_valid?(collect_errors) + assert_includes response_invalid_subjectconfirmation_recipient.errors, generate_audience_error('invalid', ['http://stuff.com/endpoints/metadata.php']) + assert_includes response_invalid_subjectconfirmation_recipient.errors, "Invalid Signature on SAML Response" + end + end + end + + describe "#validate_audience" do + it "return true when the audience is valid" do + response.settings = settings + response.settings.sp_entity_id = '{audience}' + assert response.send(:validate_audience) + assert_empty response.errors + end + + it "return true when the audience is self closing and strict audience validation is not enabled" do + response_audience_self_closed.settings = settings + response_audience_self_closed.settings.sp_entity_id = '{audience}' + assert response_audience_self_closed.send(:validate_audience) + assert_empty response_audience_self_closed.errors + end + + it "return false when the audience is self closing and strict audience validation is enabled" do + response_audience_self_closed.settings = settings + response_audience_self_closed.settings.security[:strict_audience_validation] = true + response_audience_self_closed.settings.sp_entity_id = '{audience}' + refute response_audience_self_closed.send(:validate_audience) + assert_includes response_audience_self_closed.errors, "Invalid Audiences. The element contained only empty elements. Expected audience {audience}." + end + + it "return false when the audience is invalid" do + response.settings = settings + response.settings.sp_entity_id = 'invalid_audience' + assert !response.send(:validate_audience) + assert_includes response.errors, generate_audience_error(response.settings.sp_entity_id, ['{audience}']) + end + end + + describe "#validate_destination" do + it "return true when the destination of the SAML Response matches the assertion consumer service url" do + response.settings = settings + assert response.send(:validate_destination) + assert_empty response.errors + end + + it "return false when the destination of the SAML Response does not match the assertion consumer service url" do + response.settings = settings + response.settings.assertion_consumer_service_url = 'invalid_acs' + assert !response.send(:validate_destination) + assert_includes response.errors, "The response was received at #{response.destination} instead of #{response.settings.assertion_consumer_service_url}" + end + + it "return false when the destination of the SAML Response is empty" do + response_empty_destination.settings = settings + assert !response_empty_destination.send(:validate_destination) + assert_includes response_empty_destination.errors, "The response has an empty Destination value" + end + + it "return true when the destination of the SAML Response is empty but skip_destination option is used" do + response_empty_destination_with_skip.settings = settings + assert response_empty_destination_with_skip.send(:validate_destination) + assert_empty response_empty_destination.errors + end + + it "returns true on a case insensitive match on the domain" do + response_valid_signed_without_x509certificate.settings = settings + response_valid_signed_without_x509certificate.settings.assertion_consumer_service_url = 'http://APP.muDa.no/sso/consume' + assert response_valid_signed_without_x509certificate.send(:validate_destination) + assert_empty response_valid_signed_without_x509certificate.errors + end + + it "returns true on a case insensitive match on the scheme" do + response_valid_signed_without_x509certificate.settings = settings + response_valid_signed_without_x509certificate.settings.assertion_consumer_service_url = 'HTTP://app.muda.no/sso/consume' + assert response_valid_signed_without_x509certificate.send(:validate_destination) + assert_empty response_valid_signed_without_x509certificate.errors + end + + it "returns false on a case insenstive match on the path" do + response_valid_signed_without_x509certificate.settings = settings + response_valid_signed_without_x509certificate.settings.assertion_consumer_service_url = 'http://app.muda.no/SSO/consume' + assert !response_valid_signed_without_x509certificate.send(:validate_destination) + assert_includes response_valid_signed_without_x509certificate.errors, "The response was received at #{response_valid_signed_without_x509certificate.destination} instead of #{response_valid_signed_without_x509certificate.settings.assertion_consumer_service_url}" + end + + it "returns true if it can't parse out a full URI." do + response_valid_signed_without_x509certificate.settings = settings + response_valid_signed_without_x509certificate.settings.assertion_consumer_service_url = 'presenter' + assert !response_valid_signed_without_x509certificate.send(:validate_destination) + assert_includes response_valid_signed_without_x509certificate.errors, "The response was received at #{response_valid_signed_without_x509certificate.destination} instead of #{response_valid_signed_without_x509certificate.settings.assertion_consumer_service_url}" + end + end + + describe "#validate_issuer" do + it "return true when the issuer of the Message/Assertion matches the IdP entityId" do + response_valid_signed.settings = settings + assert response_valid_signed.send(:validate_issuer) + + response_valid_signed.settings.idp_entity_id = 'https://app.onelogin.com/saml2' + assert response_valid_signed.send(:validate_issuer) + end + + it "return false when the issuer of the Message does not match the IdP entityId" do + response_invalid_issuer_message.settings = settings + response_invalid_issuer_message.settings.idp_entity_id = 'http://idp.example.com/' + assert !response_invalid_issuer_message.send(:validate_issuer) + assert_includes response_invalid_issuer_message.errors, "Doesn't match the issuer, expected: <#{response_invalid_issuer_message.settings.idp_entity_id}>, but was: " + end + + it "return false when the issuer of the Assertion does not match the IdP entityId" do + response_invalid_issuer_assertion.settings = settings + response_invalid_issuer_assertion.settings.idp_entity_id = 'http://idp.example.com/' + assert !response_invalid_issuer_assertion.send(:validate_issuer) + assert_includes response_invalid_issuer_assertion.errors, "Doesn't match the issuer, expected: <#{response_invalid_issuer_assertion.settings.idp_entity_id}>, but was: " + end + end + + describe "#validate_num_assertion" do + it "return true when SAML Response contains 1 assertion" do + assert response.send(:validate_num_assertion) + assert_empty response.errors + end + + it "return false when no 2.0 Version present in the SAML Response" do + assert !response_multi_assertion.send(:validate_num_assertion) + assert_includes response_multi_assertion.errors, "SAML Response must contain 1 assertion" + end + end + + describe "validate_success_status" do + it "return true when the status is 'Success'" do + assert response.send(:validate_success_status) + assert_empty response.errors + end + + it "return false when no Status provided" do + assert !response_no_status.send(:validate_success_status) + assert_includes response_no_status.errors, "The status code of the Response was not Success" + end + + it "return false when no StatusCode provided" do + assert !response_no_statuscode.send(:validate_success_status) + assert_includes response_no_statuscode.errors, "The status code of the Response was not Success" + end + + it "return false when the status is not 'Success'" do + assert !response_statuscode_responder.send(:validate_success_status) + assert_includes response_statuscode_responder.errors, "The status code of the Response was not Success, was Responder" + end + + it "return false when the status is not 'Success', and shows the StatusMessage" do + assert !response_statuscode_responder_and_msg.send(:validate_success_status) + assert_includes response_statuscode_responder_and_msg.errors, "The status code of the Response was not Success, was Responder -> something_is_wrong" + end + + it "return false when the status is not 'Success'" do + assert !response_double_statuscode.send(:validate_success_status) + assert_includes response_double_statuscode.errors, "The status code of the Response was not Success, was Requester => UnsupportedBinding" + end + end + + describe "#validate_structure" do + it "return true when encountering a wellformed SAML Response" do + assert response.send(:validate_structure) + assert_empty response.errors + end + + it "return false when encountering a mailformed element that prevents the document from being valid" do + response_without_attributes.soft = true + response_without_attributes.send(:validate_structure) + assert response_without_attributes.errors.include? "Invalid SAML Response. Not match the saml-schema-protocol-2.0.xsd" + end + + it "raise when encountering a mailformed element that prevents the document from being valid" do + response_without_attributes.soft = false + assert_raises(OneLogin::RubySaml::ValidationError) { + response_without_attributes.send(:validate_structure) + } + end + end + + describe "validate_formatted_x509_certificate" do + let(:response_with_formatted_x509certificate) { + OneLogin::RubySaml::Response.new(read_response("valid_response_with_formatted_x509certificate.xml.base64"), { + :skip_conditions => true, + :skip_subject_confirmation => true }) + } + + it "be able to parse the response wihout errors" do + response_with_formatted_x509certificate.settings = settings + response_with_formatted_x509certificate.settings.idp_cert = ruby_saml_cert_text + assert response_with_formatted_x509certificate.is_valid? + assert_empty response_with_formatted_x509certificate.errors + end + end + + describe "#validate_in_response_to" do + it "return true when the inResponseTo value matches the Request ID" do + response = OneLogin::RubySaml::Response.new(response_document_valid_signed, :settings => settings, :matches_request_id => "_fc4a34b0-7efb-012e-caae-782bcb13bb38") + assert response.send(:validate_in_response_to) + assert_empty response.errors + end + + it "return true when no Request ID is provided for checking" do + response = OneLogin::RubySaml::Response.new(response_document_valid_signed, :settings => settings) + assert response.send(:validate_in_response_to) + assert_empty response.errors + end + + it "return false when the inResponseTo value does not match the Request ID" do + response = OneLogin::RubySaml::Response.new(response_document_valid_signed, :settings => settings, :matches_request_id => "invalid_request_id") + assert !response.send(:validate_in_response_to) + assert_includes response.errors, "The InResponseTo of the Response: _fc4a34b0-7efb-012e-caae-782bcb13bb38, does not match the ID of the AuthNRequest sent by the SP: invalid_request_id" + end + end + + describe "#validate_audience" do + it "return true when the audience is valid" do + response_valid_signed.settings = settings + response_valid_signed.settings.sp_entity_id = "https://someone.example.com/audience" + assert response_valid_signed.send(:validate_audience) + assert_empty response_valid_signed.errors + end + + it "return true when there is not sp_entity_id defined" do + response_valid_signed.settings = settings + response_valid_signed.settings.sp_entity_id = nil + assert response_valid_signed.send(:validate_audience) + assert_empty response_valid_signed.errors + end + + it "return false when there is no valid audience" do + response_invalid_audience.settings = settings + response_invalid_audience.settings.sp_entity_id = "https://invalid.example.com/audience" + assert !response_invalid_audience.send(:validate_audience) + assert_includes response_invalid_audience.errors, generate_audience_error(response_invalid_audience.settings.sp_entity_id, ['http://invalid.audience.com']) + end + + it "return true when there is no valid audience but skip_destination option is used" do + response_invalid_audience_with_skip.settings = settings + response_invalid_audience_with_skip.settings.sp_entity_id = "https://invalid.example.com/audience" + assert response_invalid_audience_with_skip.send(:validate_audience) + assert_empty response_invalid_audience_with_skip.errors + end + end + + describe "#validate_issuer" do + it "return true when the issuer of the Message/Assertion matches the IdP entityId or it was empty" do + response_valid_signed.settings = settings + assert response_valid_signed.send(:validate_issuer) + assert_empty response_valid_signed.errors + + response_valid_signed.settings.idp_entity_id = 'https://app.onelogin.com/saml2' + assert response_valid_signed.send(:validate_issuer) + assert_empty response_valid_signed.errors + end + + it "return false when the issuer of the Message does not match the IdP entityId" do + response_invalid_issuer_message.settings = settings + response_invalid_issuer_message.settings.idp_entity_id = 'http://idp.example.com/' + assert !response_invalid_issuer_message.send(:validate_issuer) + assert_includes response_invalid_issuer_message.errors, "Doesn't match the issuer, expected: <#{response_invalid_issuer_message.settings.idp_entity_id}>, but was: " + end + + it "return false when the issuer of the Assertion does not match the IdP entityId" do + response_invalid_issuer_assertion.settings = settings + response_invalid_issuer_assertion.settings.idp_entity_id = 'http://idp.example.com/' + assert !response_invalid_issuer_assertion.send(:validate_issuer) + assert_includes response_invalid_issuer_assertion.errors, "Doesn't match the issuer, expected: <#{response_invalid_issuer_assertion.settings.idp_entity_id}>, but was: " + end + + it "return false when the no issuer at the Response" do + response_no_issuer_response.settings = settings + response_no_issuer_response.settings.idp_entity_id = 'http://idp.example.com/' + assert !response_no_issuer_response.send(:validate_issuer) + assert_includes response_no_issuer_response.errors, "Issuer of the Response not found or multiple." + end + + it "return false when the no issuer at the Assertion" do + response_no_issuer_assertion.settings = settings + response_no_issuer_assertion.settings.idp_entity_id = 'http://idp.example.com/' + assert !response_no_issuer_assertion.send(:validate_issuer) + assert_includes response_no_issuer_assertion.errors, "Issuer of the Assertion not found or multiple." + end + end + + describe "#validate_subject_confirmation" do + it "return true when valid subject confirmation" do + response_valid_signed.settings = settings + response_valid_signed.settings.assertion_consumer_service_url = 'recipient' + assert response_valid_signed.send(:validate_subject_confirmation) + assert_empty response_valid_signed.errors + end + + it "return false when no subject confirmation data" do + response_no_subjectconfirmation_data.settings = settings + assert !response_no_subjectconfirmation_data.send(:validate_subject_confirmation) + assert_includes response_no_subjectconfirmation_data.errors, "A valid SubjectConfirmation was not found on this Response" + end + + it "return false when no valid subject confirmation method" do + response_no_subjectconfirmation_method.settings = settings + assert !response_no_subjectconfirmation_method.send(:validate_subject_confirmation) + assert_includes response_no_subjectconfirmation_method.errors, "A valid SubjectConfirmation was not found on this Response" + end + + it "return false when invalid inresponse" do + response_invalid_subjectconfirmation_inresponse.settings = settings + assert !response_invalid_subjectconfirmation_inresponse.send(:validate_subject_confirmation) + assert_includes response_invalid_subjectconfirmation_inresponse.errors, "A valid SubjectConfirmation was not found on this Response" + end + + it "return false when invalid NotBefore" do + response_invalid_subjectconfirmation_nb.settings = settings + assert !response_invalid_subjectconfirmation_nb.send(:validate_subject_confirmation) + assert_includes response_invalid_subjectconfirmation_nb.errors, "A valid SubjectConfirmation was not found on this Response" + end + + it "return false when invalid NotOnOrAfter" do + response_invalid_subjectconfirmation_noa.settings = settings + assert !response_invalid_subjectconfirmation_noa.send(:validate_subject_confirmation) + assert_includes response_invalid_subjectconfirmation_noa.errors, "A valid SubjectConfirmation was not found on this Response" + end + + it "return true when valid subject confirmation recipient" do + response_valid_signed.settings = settings + response_valid_signed.settings.assertion_consumer_service_url = 'recipient' + assert response_valid_signed.send(:validate_subject_confirmation) + assert_empty response_valid_signed.errors + assert_empty response_valid_signed.errors + end + + it "return false when invalid subject confirmation recipient" do + response_valid_signed.settings = settings + response_valid_signed.settings.assertion_consumer_service_url = 'not-the-recipient' + assert !response_valid_signed.send(:validate_subject_confirmation) + assert_includes response_valid_signed.errors, "A valid SubjectConfirmation was not found on this Response" + end + + it "return false when invalid subject confirmation recipient, but skipping the check(default)" do + response_valid_signed_without_recipient.settings = settings + response_valid_signed_without_recipient.settings.assertion_consumer_service_url = 'not-the-recipient' + assert response_valid_signed_without_recipient.send(:validate_subject_confirmation) + assert_empty response_valid_signed_without_recipient.errors + end + + it "return true when the skip_subject_confirmation option is passed and the subject confirmation is valid" do + opts = {} + opts[:skip_subject_confirmation] = true + response_with_skip = OneLogin::RubySaml::Response.new(response_document_valid_signed, opts) + response_with_skip.settings = settings + response_with_skip.settings.assertion_consumer_service_url = 'recipient' + Time.expects(:now).times(0) # ensures the test isn't run and thus Time.now.utc is never called within the test + assert response_with_skip.send(:validate_subject_confirmation) + assert_empty response_with_skip.errors + end + + it "return true when the skip_subject_confirmation option is passed and the response has an invalid subject confirmation" do + opts = {} + opts[:skip_subject_confirmation] = true + response_with_skip = OneLogin::RubySaml::Response.new(read_invalid_response("invalid_subjectconfirmation_noa.xml.base64"), opts) + response_with_skip.settings = settings + Time.expects(:now).times(0) # ensures the test isn't run and thus Time.now.utc is never called within the test + assert response_with_skip.send(:validate_subject_confirmation) + assert_empty response_with_skip.errors + end + end + + describe "#validate_session_expiration" do + it "return true when the session has not expired" do + response_valid_signed.settings = settings + assert response_valid_signed.send(:validate_session_expiration) + assert_empty response_valid_signed.errors + end + + it "return false when the session has expired" do + response.settings = settings + assert !response.send(:validate_session_expiration) + assert_includes response.errors, "The attributes have expired, based on the SessionNotOnOrAfter of the AuthnStatement of this Response" + end + + it "returns true when the session has expired, but is still within the allowed_clock_drift" do + drift = (Time.now - Time.parse("2010-11-19T21:57:37Z")) * 60 # seconds ago that this assertion expired + drift += 10 # add a buffer of 10 seconds to make sure the test passes + opts = {} + opts[:allowed_clock_drift] = drift + + response_with_drift = OneLogin::RubySaml::Response.new(response_document_without_recipient, opts) + response_with_drift.settings = settings + assert response_with_drift.send(:validate_session_expiration) + assert_empty response_with_drift.errors + end + end + + describe "#validate_signature" do + it "return true when the signature is valid" do + settings.idp_cert_fingerprint = ruby_saml_cert_fingerprint + response_valid_signed.settings = settings + assert response_valid_signed.send(:validate_signature) + assert_empty response_valid_signed.errors + end + + it "return true when the signature is valid and ds namespace is at the root" do + settings.idp_cert_fingerprint = '5614657ab692b960480389723a36446a5fe1f7ec' + response_with_ds_namespace_at_the_root.settings = settings + assert response_with_ds_namespace_at_the_root.send(:validate_signature) + assert_empty response_with_ds_namespace_at_the_root.errors + end + + it "return true when the signature is valid and fingerprint provided" do + settings.idp_cert_fingerprint = '49:EC:3F:A4:71:8A:1E:C9:DB:70:A7:CC:33:36:96:F0:48:8C:4E:DA' + xml = 'PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIERlc3RpbmF0aW9uPSJodHRwczovL2NvZGVycGFkLmlvL3NhbWwvYWNzIiBJRD0iXzEwOGE1ZTg0MDllYzRjZjlhY2QxYzQ2OWU5ZDcxNGFkIiBJblJlc3BvbnNlVG89Il80ZmZmYWE2MC02OTZiLTAxMzMtMzg4Ni0wMjQxZjY1YzA2OTMiIElzc3VlSW5zdGFudD0iMjAxNS0xMS0wOVQyMzo1NTo0M1oiIFZlcnNpb249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250ZXh0Pjwvc2FtbDpBdXRoblN0YXRlbWVudD48c2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+PHNhbWw6QXR0cmlidXRlIE5hbWU9IkdpdmVuLW5hbWUiPjxzYW1sOkF0dHJpYnV0ZVZhbHVlPk1hdHQ8L3NhbWw6QXR0cmlidXRlVmFsdWU+PC9zYW1sOkF0dHJpYnV0ZT48c2FtbDpBdHRyaWJ1dGUgTmFtZT0iU3VybmFtZSI+PHNhbWw6QXR0cmlidXRlVmFsdWU+SnVyaWs8L3NhbWw6QXR0cmlidXRlVmFsdWU+PC9zYW1sOkF0dHJpYnV0ZT48c2FtbDpBdHRyaWJ1dGUgTmFtZT0iRW1haWwiPjxzYW1sOkF0dHJpYnV0ZVZhbHVlPm1hdHQuanVyaWtAaHVsdS5jb208L3NhbWw6QXR0cmlidXRlVmFsdWU+PC9zYW1sOkF0dHJpYnV0ZT48L3NhbWw6QXR0cmlidXRlU3RhdGVtZW50Pjwvc2FtbDpBc3NlcnRpb24+PC9zYW1scDpSZXNwb25zZT4=' + response_x = OneLogin::RubySaml::Response.new(xml) + response_x.settings = settings + assert response_x.send(:validate_signature) + assert_empty response_x.errors + end + + it "return false when no fingerprint" do + settings.idp_cert_fingerprint = nil + settings.idp_cert = nil + response.settings = settings + assert !response.send(:validate_signature) + assert_includes response.errors, "Invalid Signature on SAML Response" + end + + it "return false when the signature is invalid" do + settings.idp_cert_fingerprint = signature_fingerprint_1 + response.settings = settings + assert !response.send(:validate_signature) + assert_includes response.errors, "Fingerprint mismatch" + assert_includes response.errors, "Invalid Signature on SAML Response" + end + + it "return false when no X509Certificate and not cert provided at settings" do + settings.idp_cert_fingerprint = ruby_saml_cert_fingerprint + settings.idp_cert = nil + response_valid_signed_without_x509certificate.settings = settings + assert !response_valid_signed_without_x509certificate.send(:validate_signature) + assert_includes response_valid_signed_without_x509certificate.errors, "Invalid Signature on SAML Response" + end + + it "return false when cert expired and check_idp_cert_expiration enabled" do + settings.idp_cert_fingerprint = nil + settings.idp_cert = ruby_saml_cert_text + settings.security[:check_idp_cert_expiration] = true + response_valid_signed.settings = settings + assert !response_valid_signed.send(:validate_signature) + assert_includes response_valid_signed.errors, "IdP x509 certificate expired" + end + + it "return false when X509Certificate and the cert provided at settings mismatches" do + settings.idp_cert_fingerprint = nil + settings.idp_cert = signature_1 + response_valid_signed_without_x509certificate.settings = settings + assert !response_valid_signed_without_x509certificate.send(:validate_signature) + assert_includes response_valid_signed_without_x509certificate.errors, "Key validation error" + assert_includes response_valid_signed_without_x509certificate.errors, "Invalid Signature on SAML Response" + end + + it "return false when X509Certificate has invalid content" do + settings.idp_cert_fingerprint = nil + settings.idp_cert = ruby_saml_cert_text + content = read_response('response_with_signed_message_and_assertion.xml') + content = content.sub(/.*<\/ds:X509Certificate>/, + "an-invalid-certificate") + response_invalid_x509certificate = OneLogin::RubySaml::Response.new(content) + response_invalid_x509certificate.settings = settings + assert !response_invalid_x509certificate.send(:validate_signature) + assert_includes response_invalid_x509certificate.errors, "Document Certificate Error" + assert_includes response_invalid_x509certificate.errors, "Invalid Signature on SAML Response" + end + + it "return true when X509Certificate and the cert provided at settings matches" do + settings.idp_cert_fingerprint = nil + settings.idp_cert = ruby_saml_cert_text + response_valid_signed_without_x509certificate.settings = settings + assert response_valid_signed_without_x509certificate.send(:validate_signature) + assert_empty response_valid_signed_without_x509certificate.errors + end + + it "return false when signature wrapping attack" do + signature_wrapping_attack = read_invalid_response("signature_wrapping_attack.xml.base64") + response_wrapped = OneLogin::RubySaml::Response.new(signature_wrapping_attack) + response_wrapped.stubs(:conditions).returns(nil) + response_wrapped.stubs(:validate_subject_confirmation).returns(true) + settings.idp_cert_fingerprint = "afe71c28ef740bc87425be13a2263d37971da1f9" + response_wrapped.settings = settings + assert !response_wrapped.send(:validate_signature) + assert_includes response_wrapped.errors, "Invalid Signature on SAML Response" + assert_includes response_wrapped.errors, "Signed element id #pfxc3d2b542-0f7e-8767-8e87-5b0dc6913375 is not found" + end + end + + describe "#validate_signature with multiple idp certs" do + it "return true when at least a cert on idp_cert_multi is valid" do + settings.idp_cert_multi = { + :signing => [ruby_saml_cert_text2, ruby_saml_cert_text], + :encryption => [] + } + response_valid_signed.settings = settings + res = response_valid_signed.send(:validate_signature) + assert_empty response_valid_signed.errors + end + + it "return false when none cert on idp_cert_multi is valid" do + settings.idp_cert_fingerprint = ruby_saml_cert_fingerprint + settings.idp_cert_multi = { + :signing => [ruby_saml_cert_text2, ruby_saml_cert_text2], + :encryption => [] + } + response_valid_signed.settings = settings + assert !response_valid_signed.send(:validate_signature) + assert_includes response_valid_signed.errors, "Certificate of the Signature element does not match provided certificate" + assert_includes response_valid_signed.errors, "Invalid Signature on SAML Response" + end + end + + describe "#validate nameid" do + it "return false when no nameid element and required by settings" do + settings.security[:want_name_id] = true + response_no_nameid.settings = settings + assert !response_no_nameid.send(:validate_name_id) + assert_includes response_no_nameid.errors, "No NameID element found in the assertion of the Response" + end + + it "return false when no nameid element and required by settings" do + response_empty_nameid.settings = settings + assert !response_empty_nameid.send(:validate_name_id) + assert_includes response_empty_nameid.errors, "An empty NameID value found" + end + + it "return false when no nameid value" do + response_empty_nameid.settings = settings + assert !response_empty_nameid.send(:validate_name_id) + assert_includes response_empty_nameid.errors, "An empty NameID value found" + end + + it "return false when wrong_spnamequalifier" do + settings.sp_entity_id = 'sp_entity_id' + response_wrong_spnamequalifier.settings = settings + assert !response_wrong_spnamequalifier.send(:validate_name_id) + assert_includes response_wrong_spnamequalifier.errors, "The SPNameQualifier value mistmatch the SP entityID value." + end + + it "return true when no nameid element but not required by settings" do + settings.security[:want_name_id] = false + response_no_nameid.settings = settings + assert response_no_nameid.send(:validate_name_id) + end + + it "return true when nameid is valid and response_wrong_spnamequalifier matches the SP issuer" do + settings.sp_entity_id = 'wrong-sp-entityid' + response_wrong_spnamequalifier.settings = settings + assert response_wrong_spnamequalifier.send(:validate_name_id) + end + end + + describe "#nameid" do + it "extract the value of the name id element" do + assert_equal "support@onelogin.com", response.nameid + assert_equal "someone@example.com", response_with_signed_assertion.nameid + end + + it "be extractable from an OpenSAML response" do + response_open_saml = OneLogin::RubySaml::Response.new(fixture(:open_saml)) + assert_equal "someone@example.org", response_open_saml.nameid + end + + it "be extractable from a Simple SAML PHP response" do + response_ssp = OneLogin::RubySaml::Response.new(fixture(:simple_saml_php)) + assert_equal "someone@example.com", response_ssp.nameid + end + end + + describe "#name_id_format" do + it "extract the value of the name id element" do + assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", response.name_id_format + assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", response_with_signed_assertion.name_id_format + end + end + + describe "#sessionindex" do + it "extract the value of the sessionindex element" do + response = OneLogin::RubySaml::Response.new(fixture(:simple_saml_php)) + assert_equal "_51be37965feb5579d803141076936dc2e9d1d98ebf", response.sessionindex + end + end + + describe "#check_one_conditions" do + it "return false when none or more than one conditions element" do + response_no_conditions.soft = true + assert !response_no_conditions.send(:validate_one_conditions) + assert_includes response_no_conditions.errors, "The Assertion must include one Conditions element" + end + + it "return true when one conditions element" do + response.soft = true + assert response.send(:validate_one_conditions) + end + + it "return true when no conditions are present and skip_conditions is true" do + response_no_conditions_with_skip.soft = true + assert response_no_conditions_with_skip.send(:validate_one_conditions) + end + end + + describe "#check_one_authnstatement" do + it "return false when none or more than one authnstatement element" do + response_no_authnstatement.soft = true + assert !response_no_authnstatement.send(:validate_one_authnstatement) + assert_includes response_no_authnstatement.errors, "The Assertion must include one AuthnStatement element" + end + + it "return true when one authnstatement element" do + response.soft = true + assert response.send(:validate_one_authnstatement) + end + + it "return true when SAML Response is empty but skip_authstatement option is used" do + response_no_authnstatement_with_skip.soft = true + assert response_no_authnstatement_with_skip.send(:validate_one_authnstatement) + assert_empty response_empty_destination_with_skip.errors + end + end + + describe "#check_conditions" do + it "check time conditions" do + response.soft = true + assert !response.send(:validate_conditions) + response_time_updated = OneLogin::RubySaml::Response.new(response_document_without_recipient_with_time_updated) + response_time_updated.soft = true + assert response_time_updated.send(:validate_conditions) + Timecop.freeze(Time.parse("2011-06-14T18:25:01.516Z")) do + response_with_saml2_namespace = OneLogin::RubySaml::Response.new(response_document_with_saml2_namespace) + response_with_saml2_namespace.soft = true + assert response_with_saml2_namespace.send(:validate_conditions) + end + end + + it "optionally allows for clock drift on NotBefore" do + settings.soft = true + + # The NotBefore condition in the document is 2011-06-14T18:21:01.516Z + Timecop.freeze(Time.parse("2011-06-14T18:21:01Z")) do + special_response_with_saml2_namespace = OneLogin::RubySaml::Response.new( + response_document_with_saml2_namespace, + :allowed_clock_drift => 0.515, + :settings => settings + ) + assert !special_response_with_saml2_namespace.send(:validate_conditions) + + special_response_with_saml2_namespace = OneLogin::RubySaml::Response.new( + response_document_with_saml2_namespace, + :allowed_clock_drift => 0.516 + ) + assert special_response_with_saml2_namespace.send(:validate_conditions) + + special_response_with_saml2_namespace = OneLogin::RubySaml::Response.new( + response_document_with_saml2_namespace, + :allowed_clock_drift => '0.515', + :settings => settings + ) + assert !special_response_with_saml2_namespace.send(:validate_conditions) + + special_response_with_saml2_namespace = OneLogin::RubySaml::Response.new( + response_document_with_saml2_namespace, + :allowed_clock_drift => '0.516' + ) + assert special_response_with_saml2_namespace.send(:validate_conditions) + end + end + + it "optionally allows for clock drift on NotOnOrAfter" do + # Java Floats behave differently than MRI + java = defined?(RUBY_ENGINE) && %w[jruby truffleruby].include?(RUBY_ENGINE) + + settings.soft = true + + # The NotBefore condition in the document is 2011-06-1418:31:01.516Z + Timecop.freeze(Time.parse("2011-06-14T18:31:02Z")) do + special_response_with_saml2_namespace = OneLogin::RubySaml::Response.new( + response_document_with_saml2_namespace, + :allowed_clock_drift => 0.483, + :settings => settings + ) + assert !special_response_with_saml2_namespace.send(:validate_conditions) + + special_response_with_saml2_namespace = OneLogin::RubySaml::Response.new( + response_document_with_saml2_namespace, + :allowed_clock_drift => java ? 0.485 : 0.484 + ) + assert special_response_with_saml2_namespace.send(:validate_conditions) + + special_response_with_saml2_namespace = OneLogin::RubySaml::Response.new( + response_document_with_saml2_namespace, + :allowed_clock_drift => '0.483', + :settings => settings + ) + assert !special_response_with_saml2_namespace.send(:validate_conditions) + + special_response_with_saml2_namespace = OneLogin::RubySaml::Response.new( + response_document_with_saml2_namespace, + :allowed_clock_drift => java ? '0.485' : '0.484' + ) + assert special_response_with_saml2_namespace.send(:validate_conditions) + end + end + end + + describe "#attributes" do + it "extract the first attribute in a hash accessed via its symbol" do + assert_equal "demo", response.attributes[:uid] + end + + it "extract the first attribute in a hash accessed via its name" do + assert_equal "demo", response.attributes["uid"] + end + + it "extract all attributes" do + assert_equal "demo", response.attributes[:uid] + assert_equal "value", response.attributes[:another_value] + end + + it "work for implicit namespaces" do + assert_equal "someone@example.com", response_with_signed_assertion.attributes["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"] + end + + it "extract attributes from all AttributeStatement tags" do + assert_equal "smith", response_with_multiple_attribute_statements.attributes[:surname] + assert_equal "bob", response_with_multiple_attribute_statements.attributes[:firstname] + end + + it "not raise on responses without attributes" do + assert_equal OneLogin::RubySaml::Attributes.new, response_unsigned.attributes + end + + describe "#encrypted attributes" do + it "raise error when the assertion contains encrypted attributes but no private key to decrypt" do + settings.private_key = nil + response_encrypted_attrs.settings = settings + assert_raises(OneLogin::RubySaml::ValidationError, "An EncryptedAttribute found and no SP private key found on the settings to decrypt it") do + attrs = response_encrypted_attrs.attributes + end + end + + it "extract attributes when the assertion contains encrypted attributes and the private key is provided" do + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + response_encrypted_attrs.settings = settings + attributes = response_encrypted_attrs.attributes + assert_equal "test", attributes[:uid] + assert_equal "test@example.com", attributes[:mail] + end + end + + it "return false when validating a response with duplicate attributes" do + response_duplicated_attributes.settings = settings + response_duplicated_attributes.options[:check_duplicated_attributes] = true + assert !response_duplicated_attributes.send(:validate_no_duplicated_attributes) + assert_includes response_duplicated_attributes.errors, "Found an Attribute element with duplicated Name" + end + + it "return true when validating a response with duplicate attributes but skip check" do + response_duplicated_attributes.settings = settings + assert response_duplicated_attributes.send(:validate_no_duplicated_attributes) + end + + describe "#multiple values" do + it "extract single value as string" do + assert_equal "demo", response_multiple_attr_values.attributes[:uid] + end + + it "extract single value as string in compatibility mode off" do + OneLogin::RubySaml::Attributes.single_value_compatibility = false + assert_equal ["demo"], response_multiple_attr_values.attributes[:uid] + # classes are not reloaded between tests so restore default + OneLogin::RubySaml::Attributes.single_value_compatibility = true + end + + it "extract first of multiple values as string for b/w compatibility" do + assert_equal 'value1', response_multiple_attr_values.attributes[:another_value] + end + + it "extract first of multiple values as string for b/w compatibility in compatibility mode off" do + OneLogin::RubySaml::Attributes.single_value_compatibility = false + assert_equal ['value1', 'value2'], response_multiple_attr_values.attributes[:another_value] + OneLogin::RubySaml::Attributes.single_value_compatibility = true + end + + it "return array with all attributes when asked in XML order" do + assert_equal ['value1', 'value2'], response_multiple_attr_values.attributes.multi(:another_value) + end + + it "return array with all attributes when asked in XML order in compatibility mode off" do + OneLogin::RubySaml::Attributes.single_value_compatibility = false + assert_equal ['value1', 'value2'], response_multiple_attr_values.attributes.multi(:another_value) + OneLogin::RubySaml::Attributes.single_value_compatibility = true + end + + it "return first of multiple values when multiple Attribute tags in XML" do + assert_equal 'role1', response_multiple_attr_values.attributes[:role] + end + + it "return first of multiple values when multiple Attribute tags in XML in compatibility mode off" do + OneLogin::RubySaml::Attributes.single_value_compatibility = false + assert_equal ['role1', 'role2', 'role3'], response_multiple_attr_values.attributes[:role] + OneLogin::RubySaml::Attributes.single_value_compatibility = true + end + + it "return all of multiple values in reverse order when multiple Attribute tags in XML" do + assert_equal ['role1', 'role2', 'role3'], response_multiple_attr_values.attributes.multi(:role) + end + + it "return all of multiple values in reverse order when multiple Attribute tags in XML in compatibility mode off" do + OneLogin::RubySaml::Attributes.single_value_compatibility = false + assert_equal ['role1', 'role2', 'role3'], response_multiple_attr_values.attributes.multi(:role) + OneLogin::RubySaml::Attributes.single_value_compatibility = true + end + + it "return all of multiple values when multiple Attribute tags in multiple AttributeStatement tags" do + OneLogin::RubySaml::Attributes.single_value_compatibility = false + assert_equal ['role1', 'role2', 'role3'], response_with_multiple_attribute_statements.attributes.multi(:role) + OneLogin::RubySaml::Attributes.single_value_compatibility = true + end + + it "return nil value correctly" do + assert_nil response_multiple_attr_values.attributes[:attribute_with_nil_value] + end + + it "return nil value correctly when not in compatibility mode off" do + OneLogin::RubySaml::Attributes.single_value_compatibility = false + assert_equal [nil], response_multiple_attr_values.attributes[:attribute_with_nil_value] + OneLogin::RubySaml::Attributes.single_value_compatibility = true + end + + it "return multiple values including nil and empty string" do + response = OneLogin::RubySaml::Response.new(fixture(:response_with_multiple_attribute_values)) + assert_equal ["", "valuePresent", nil, nil], response.attributes.multi(:attribute_with_nils_and_empty_strings) + end + + it "return multiple values from [] when not in compatibility mode off" do + OneLogin::RubySaml::Attributes.single_value_compatibility = false + assert_equal ["", "valuePresent", nil, nil], response_multiple_attr_values.attributes[:attribute_with_nils_and_empty_strings] + OneLogin::RubySaml::Attributes.single_value_compatibility = true + end + + it "check what happens when trying retrieve attribute that does not exists" do + assert_nil response_multiple_attr_values.attributes[:attribute_not_exists] + assert_nil response_multiple_attr_values.attributes.single(:attribute_not_exists) + assert_nil response_multiple_attr_values.attributes.multi(:attribute_not_exists) + + OneLogin::RubySaml::Attributes.single_value_compatibility = false + assert_nil response_multiple_attr_values.attributes[:attribute_not_exists] + assert_nil response_multiple_attr_values.attributes.single(:attribute_not_exists) + assert_nil response_multiple_attr_values.attributes.multi(:attribute_not_exists) + OneLogin::RubySaml::Attributes.single_value_compatibility = true + end + + end + end + + describe "#session_expires_at" do + it "extract the value of the SessionNotOnOrAfter attribute" do + assert response.session_expires_at.is_a?(Time) + end + + it "return nil when the value of the SessionNotOnOrAfter is not set" do + assert_nil response_without_attributes.session_expires_at + end + end + + describe "#success" do + it "find a status code that says success" do + response.success? + end + end + + describe '#xpath_first_from_signed_assertion' do + it 'not allow arbitrary code execution' do + malicious_response_document = fixture('response_eval', false) + malicious_response = OneLogin::RubySaml::Response.new(malicious_response_document) + malicious_response.send(:xpath_first_from_signed_assertion) + assert_nil $evalled + end + end + + describe '#sign_document' do + it 'Sign an unsigned SAML Response XML and initiate the SAML object with it' do + xml = Base64.decode64(fixture("test_sign.xml")) + + document = XMLSecurity::Document.new(xml) + + formatted_cert = OneLogin::RubySaml::Utils.format_cert(ruby_saml_cert_text) + cert = OpenSSL::X509::Certificate.new(formatted_cert) + + formatted_private_key = OneLogin::RubySaml::Utils.format_private_key(ruby_saml_key_text) + private_key = OpenSSL::PKey::RSA.new(formatted_private_key) + document.sign_document(private_key, cert) + + signed_response = OneLogin::RubySaml::Response.new(document.to_s) + settings.assertion_consumer_service_url = "http://recipient" + settings.idp_cert = ruby_saml_cert_text + signed_response.settings = settings + Timecop.freeze(Time.parse("2015-03-18T04:50:24Z")) do + assert signed_response.is_valid? + end + assert_empty signed_response.errors + end + end + + describe '#want_assertion_signed' do + before do + settings.security[:want_assertions_signed] = true + @signed_assertion = OneLogin::RubySaml::Response.new(response_document_with_signed_assertion, :settings => settings) + @no_signed_assertion = OneLogin::RubySaml::Response.new(response_document_valid_signed, :settings => settings) + end + + + it 'returns false if :want_assertion_signed enabled and Assertion not signed' do + assert !@no_signed_assertion.send(:validate_signed_elements) + assert_includes @no_signed_assertion.errors, "The Assertion of the Response is not signed and the SP requires it" + + end + + it 'returns true if :want_assertion_signed enabled and Assertion is signed' do + assert @signed_assertion.send(:validate_signed_elements) + assert_empty @signed_assertion.errors + end + end + + describe "retrieve nameID" do + it 'is possible when nameID inside the assertion' do + response_valid_signed.settings = settings + assert_equal "test@onelogin.com", response_valid_signed.nameid + end + + it 'is not possible when encryptID inside the assertion but no private key' do + response_encrypted_nameid.settings = settings + assert_raises(OneLogin::RubySaml::ValidationError, "An EncryptedID found and no SP private key found on the settings to decrypt it") do + assert_equal "test@onelogin.com", response_encrypted_nameid.nameid + end + + assert_raises(OneLogin::RubySaml::ValidationError, "An EncryptedID found and no SP private key found on the settings to decrypt it") do + assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", response_encrypted_nameid.name_id_format + end + end + + it 'is possible when encryptID inside the assertion and settings has the private key' do + settings.private_key = ruby_saml_key_text + response_encrypted_nameid.settings = settings + assert_equal "test@onelogin.com", response_encrypted_nameid.nameid + assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", response_encrypted_nameid.name_id_format + end + + end + + describe 'try to initialize an encrypted response' do + it 'raise if an encrypted assertion is found and no sp private key to decrypt it' do + error_msg = "An EncryptedAssertion found and no SP private key found on the settings to decrypt it. Be sure you provided the :settings parameter at the initialize method" + + assert_raises(OneLogin::RubySaml::ValidationError, error_msg) do + response = OneLogin::RubySaml::Response.new(signed_message_encrypted_unsigned_assertion) + end + + assert_raises(OneLogin::RubySaml::ValidationError, error_msg) do + response2 = OneLogin::RubySaml::Response.new(signed_message_encrypted_unsigned_assertion, :settings => settings) + end + + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + assert_raises(OneLogin::RubySaml::ValidationError, error_msg) do + response3 = OneLogin::RubySaml::Response.new(signed_message_encrypted_unsigned_assertion) + response3.settings + end + end + + it 'raise if an encrypted assertion is found and the sp private key is wrong' do + settings.certificate = ruby_saml_cert_text + wrong_private_key = ruby_saml_key_text.sub!('A', 'B') + settings.private_key = wrong_private_key + + error_msg = "Neither PUB key nor PRIV key: nested asn1 error" + assert_raises(OpenSSL::PKey::RSAError, error_msg) do + response = OneLogin::RubySaml::Response.new(signed_message_encrypted_unsigned_assertion, :settings => settings) + end + end + + it 'return true if an encrypted assertion is found and settings initialized with private_key' do + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + response = OneLogin::RubySaml::Response.new(signed_message_encrypted_unsigned_assertion, :settings => settings) + assert response.decrypted_document + + response2 = OneLogin::RubySaml::Response.new(signed_message_encrypted_signed_assertion, :settings => settings) + assert response2.decrypted_document + + response3 = OneLogin::RubySaml::Response.new(unsigned_message_encrypted_signed_assertion, :settings => settings) + assert response3.decrypted_document + + response4 = OneLogin::RubySaml::Response.new(unsigned_message_encrypted_unsigned_assertion, :settings => settings) + assert response4.decrypted_document + + assert OneLogin::RubySaml::Response.new( + Base64.encode64(File.read('test/responses/unsigned_encrypted_adfs.xml')), + :settings => settings + ).decrypted_document + end + end + + describe "retrieve nameID and attributes from encrypted assertion" do + + before do + settings.idp_cert_fingerprint = 'EE:17:4E:FB:A8:81:71:12:0D:2A:78:43:BC:E7:0C:07:58:79:F4:F4' + settings.sp_entity_id = 'http://rubysaml.com:3000/saml/metadata' + settings.assertion_consumer_service_url = 'http://rubysaml.com:3000/saml/acs' + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + end + + it 'is possible when signed_message_encrypted_unsigned_assertion' do + response = OneLogin::RubySaml::Response.new(signed_message_encrypted_unsigned_assertion, :settings => settings) + Timecop.freeze(Time.parse("2015-03-19T14:30:31Z")) do + assert response.is_valid? + assert_empty response.errors + assert_equal "test", response.attributes[:uid] + assert_equal "98e2bb61075e951b37d6b3be6954a54b340d86c7", response.nameid + end + end + + it 'is possible when signed_message_encrypted_signed_assertion' do + response = OneLogin::RubySaml::Response.new(signed_message_encrypted_signed_assertion, :settings => settings) + Timecop.freeze(Time.parse("2015-03-19T14:30:31Z")) do + assert response.is_valid? + assert_empty response.errors + assert_equal "test", response.attributes[:uid] + assert_equal "98e2bb61075e951b37d6b3be6954a54b340d86c7", response.nameid + end + end + + it 'is possible when unsigned_message_encrypted_signed_assertion' do + response = OneLogin::RubySaml::Response.new(unsigned_message_encrypted_signed_assertion, :settings => settings) + Timecop.freeze(Time.parse("2015-03-19T14:30:31Z")) do + assert response.is_valid? + assert_empty response.errors + assert_equal "test", response.attributes[:uid] + assert_equal "98e2bb61075e951b37d6b3be6954a54b340d86c7", response.nameid + end + end + + it 'is not possible when unsigned_message_encrypted_unsigned_assertion' do + response = OneLogin::RubySaml::Response.new(unsigned_message_encrypted_unsigned_assertion, :settings => settings) + Timecop.freeze(Time.parse("2015-03-19T14:30:31Z")) do + assert !response.is_valid? + assert_includes response.errors, "Found an unexpected number of Signature Element. SAML Response rejected" + end + end + end + + describe "#decrypt_assertion" do + before do + settings.private_key = ruby_saml_key_text + end + + describe "check right settings" do + + it "is not possible to decrypt the assertion if no private key" do + response = OneLogin::RubySaml::Response.new(signed_message_encrypted_unsigned_assertion, :settings => settings) + + encrypted_assertion_node = REXML::XPath.first( + response.document, + "(/p:Response/EncryptedAssertion/)|(/p:Response/a:EncryptedAssertion/)", + { "p" => "urn:oasis:names:tc:SAML:2.0:protocol", "a" => "urn:oasis:names:tc:SAML:2.0:assertion" } + ) + response.settings.private_key = nil + + error_msg = "An EncryptedAssertion found and no SP private key found on the settings to decrypt it" + assert_raises(OneLogin::RubySaml::ValidationError, error_msg) do + decrypted = response.send(:decrypt_assertion, encrypted_assertion_node) + end + end + + it "is possible to decrypt the assertion if private key" do + response = OneLogin::RubySaml::Response.new(signed_message_encrypted_unsigned_assertion, :settings => settings) + + encrypted_assertion_node = REXML::XPath.first( + response.document, + "(/p:Response/EncryptedAssertion/)|(/p:Response/a:EncryptedAssertion/)", + { "p" => "urn:oasis:names:tc:SAML:2.0:protocol", "a" => "urn:oasis:names:tc:SAML:2.0:assertion" } + ) + decrypted = response.send(:decrypt_assertion, encrypted_assertion_node) + + encrypted_assertion_node2 = REXML::XPath.first( + decrypted, + "(/p:Response/EncryptedAssertion/)|(/p:Response/a:EncryptedAssertion/)", + { "p" => "urn:oasis:names:tc:SAML:2.0:protocol", "a" => "urn:oasis:names:tc:SAML:2.0:assertion" } + ) + assert_nil encrypted_assertion_node2 + assert decrypted.name, "Assertion" + end + + it "is possible to decrypt the assertion if private key provided and EncryptedKey RetrievalMethod presents in response" do + settings.private_key = ruby_saml_key_text + resp = read_response('response_with_retrieval_method.xml') + response = OneLogin::RubySaml::Response.new(resp, :settings => settings) + + encrypted_assertion_node = REXML::XPath.first( + response.document, + "(/p:Response/EncryptedAssertion/)|(/p:Response/a:EncryptedAssertion/)", + { "p" => "urn:oasis:names:tc:SAML:2.0:protocol", "a" => "urn:oasis:names:tc:SAML:2.0:assertion" } + ) + decrypted = response.send(:decrypt_assertion, encrypted_assertion_node) + + encrypted_assertion_node2 = REXML::XPath.first( + decrypted, + "(/p:Response/EncryptedAssertion/)|(/p:Response/a:EncryptedAssertion/)", + { "p" => "urn:oasis:names:tc:SAML:2.0:protocol", "a" => "urn:oasis:names:tc:SAML:2.0:assertion" } + ) + + assert_nil encrypted_assertion_node2 + assert decrypted.name, "Assertion" + end + + it "is possible to decrypt the assertion if private key but no saml namespace on the Assertion Element that is inside the EncryptedAssertion" do + unsigned_message_encrypted_assertion_without_saml_namespace = read_response('unsigned_message_encrypted_assertion_without_saml_namespace.xml.base64') + response = OneLogin::RubySaml::Response.new(unsigned_message_encrypted_assertion_without_saml_namespace, :settings => settings) + encrypted_assertion_node = REXML::XPath.first( + response.document, + "(/p:Response/EncryptedAssertion/)|(/p:Response/a:EncryptedAssertion/)", + { "p" => "urn:oasis:names:tc:SAML:2.0:protocol", "a" => "urn:oasis:names:tc:SAML:2.0:assertion" } + ) + decrypted = response.send(:decrypt_assertion, encrypted_assertion_node) + + encrypted_assertion_node2 = REXML::XPath.first( + decrypted, + "(/p:Response/EncryptedAssertion/)|(/p:Response/a:EncryptedAssertion/)", + { "p" => "urn:oasis:names:tc:SAML:2.0:protocol", "a" => "urn:oasis:names:tc:SAML:2.0:assertion" } + ) + assert_nil encrypted_assertion_node2 + assert decrypted.name, "Assertion" + end + end + + describe "check different encrypt methods supported" do + it "EncryptionMethod DES-192 && Key Encryption Algorithm RSA-1_5" do + unsigned_message_des192_encrypted_signed_assertion = read_response('unsigned_message_des192_encrypted_signed_assertion.xml.base64') + response = OneLogin::RubySaml::Response.new(unsigned_message_des192_encrypted_signed_assertion, :settings => settings) + assert_equal "test", response.attributes[:uid] + assert_equal "_ce3d2948b4cf20146dee0a0b3dd6f69b6cf86f62d7", response.nameid + end + + it "EncryptionMethod AES-128 && Key Encryption Algorithm RSA-OAEP-MGF1P" do + unsigned_message_aes128_encrypted_signed_assertion = read_response('unsigned_message_aes128_encrypted_signed_assertion.xml.base64') + response = OneLogin::RubySaml::Response.new(unsigned_message_aes128_encrypted_signed_assertion, :settings => settings) + assert_equal "test", response.attributes[:uid] + assert_equal "_ce3d2948b4cf20146dee0a0b3dd6f69b6cf86f62d7", response.nameid + end + + it "EncryptionMethod AES-192 && Key Encryption Algorithm RSA-OAEP-MGF1P" do + unsigned_message_aes192_encrypted_signed_assertion = read_response('unsigned_message_aes192_encrypted_signed_assertion.xml.base64') + response = OneLogin::RubySaml::Response.new(unsigned_message_aes192_encrypted_signed_assertion, :settings => settings) + assert_equal "test", response.attributes[:uid] + assert_equal "_ce3d2948b4cf20146dee0a0b3dd6f69b6cf86f62d7", response.nameid + end + + it "EncryptionMethod AES-256 && Key Encryption Algorithm RSA-OAEP-MGF1P" do + unsigned_message_aes256_encrypted_signed_assertion = read_response('unsigned_message_aes256_encrypted_signed_assertion.xml.base64') + response = OneLogin::RubySaml::Response.new(unsigned_message_aes256_encrypted_signed_assertion, :settings => settings) + assert_equal "test", response.attributes[:uid] + assert_equal "_ce3d2948b4cf20146dee0a0b3dd6f69b6cf86f62d7", response.nameid + end + + it "EncryptionMethod AES-128-GCM && Key Encryption Algorithm RSA-OAEP-MGF1P" do + return unless OpenSSL::Cipher.ciphers.include? 'AES-128-GCM' + unsigned_message_aes128gcm_encrypted_signed_assertion = read_response('unsigned_message_aes128gcm_encrypted_signed_assertion.xml.base64') + response = OneLogin::RubySaml::Response.new(unsigned_message_aes128gcm_encrypted_signed_assertion, :settings => settings) + assert_equal "test", response.attributes[:uid] + assert_equal "_ce3d2948b4cf20146dee0a0b3dd6f69b6cf86f62d7", response.nameid + end + + it "EncryptionMethod AES-192-GCM && Key Encryption Algorithm RSA-OAEP-MGF1P" do + return unless OpenSSL::Cipher.ciphers.include? 'AES-192-GCM' + unsigned_message_aes192gcm_encrypted_signed_assertion = read_response('unsigned_message_aes192gcm_encrypted_signed_assertion.xml.base64') + response = OneLogin::RubySaml::Response.new(unsigned_message_aes192gcm_encrypted_signed_assertion, :settings => settings) + assert_equal "test", response.attributes[:uid] + assert_equal "_ce3d2948b4cf20146dee0a0b3dd6f69b6cf86f62d7", response.nameid + end + + it "EncryptionMethod AES-256-GCM && Key Encryption Algorithm RSA-OAEP-MGF1P" do + return unless OpenSSL::Cipher.ciphers.include? 'AES-256-GCM' + unsigned_message_aes256gcm_encrypted_signed_assertion = read_response('unsigned_message_aes256gcm_encrypted_signed_assertion.xml.base64') + response = OneLogin::RubySaml::Response.new(unsigned_message_aes256gcm_encrypted_signed_assertion, :settings => settings) + assert_equal "test", response.attributes[:uid] + assert_equal "_ce3d2948b4cf20146dee0a0b3dd6f69b6cf86f62d7", response.nameid + end + end + + end + + describe "#status_code" do + it 'urn:oasis:names:tc:SAML:2.0:status:Responder' do + assert_equal response_statuscode_responder.status_code, 'urn:oasis:names:tc:SAML:2.0:status:Responder' + end + + it 'urn:oasis:names:tc:SAML:2.0:status:Requester and urn:oasis:names:tc:SAML:2.0:status:UnsupportedBinding' do + assert_equal response_double_statuscode.status_code, 'urn:oasis:names:tc:SAML:2.0:status:Requester | urn:oasis:names:tc:SAML:2.0:status:UnsupportedBinding' + end + end + describe "test qualified name id in attributes" do + + it "parsed the nameid" do + response = OneLogin::RubySaml::Response.new(read_response("signed_nameid_in_atts.xml"), :settings => settings) + response.settings.idp_cert_fingerprint = 'c51985d947f1be57082025050846eb27f6cab783' + assert_empty response.errors + assert_equal "test", response.attributes[:uid] + assert_equal "http://idp.example.com/metadata.php/ZdrjpwEdw22vKoxWAbZB78/gQ7s=", response.attributes.single('urn:oid:1.3.6.1.4.1.5923.1.1.1.10') + end + end + + describe "test unqualified name id in attributes" do + + it "parsed the nameid" do + response = OneLogin::RubySaml::Response.new(read_response("signed_unqual_nameid_in_atts.xml"), :settings => settings) + response.settings.idp_cert_fingerprint = 'c51985d947f1be57082025050846eb27f6cab783' + assert_empty response.errors + assert_equal "test", response.attributes[:uid] + assert_equal "ZdrjpwEdw22vKoxWAbZB78/gQ7s=", response.attributes.single('urn:oid:1.3.6.1.4.1.5923.1.1.1.10') + end + end + + describe "signature wrapping attack with encrypted assertion" do + it "should not be valid" do + settings.private_key = ruby_saml_key_text + signature_wrapping_attack = read_invalid_response("encrypted_new_attack.xml.base64") + response_wrapped = OneLogin::RubySaml::Response.new(signature_wrapping_attack, :settings => settings) + response_wrapped.stubs(:conditions).returns(nil) + response_wrapped.stubs(:validate_subject_confirmation).returns(true) + settings.idp_cert_fingerprint = "385b1eec71143f00db6af936e2ea12a28771d72c" + assert !response_wrapped.is_valid? + assert_includes response_wrapped.errors, "Found an invalid Signed Element. SAML Response rejected" + end + end + + describe "signature wrapping attack - concealed SAML response body" do + it "should not be valid" do + signature_wrapping_attack = read_invalid_response("response_with_concealed_signed_assertion.xml") + response_wrapped = OneLogin::RubySaml::Response.new(signature_wrapping_attack, :settings => settings) + settings.idp_cert_fingerprint = '4b68c453c7d994aad9025c99d5efcf566287fe8d' + response_wrapped.stubs(:conditions).returns(nil) + response_wrapped.stubs(:validate_subject_confirmation).returns(true) + assert !response_wrapped.is_valid? + assert_includes response_wrapped.errors, "SAML Response must contain 1 assertion" + end + end + + describe "signature wrapping attack - doubled signed assertion SAML response" do + it "should not be valid" do + signature_wrapping_attack = read_invalid_response("response_with_doubled_signed_assertion.xml") + response_wrapped = OneLogin::RubySaml::Response.new(signature_wrapping_attack, :settings => settings) + settings.idp_cert_fingerprint = '4b68c453c7d994aad9025c99d5efcf566287fe8d' + response_wrapped.stubs(:conditions).returns(nil) + response_wrapped.stubs(:validate_subject_confirmation).returns(true) + assert !response_wrapped.is_valid? + assert_includes response_wrapped.errors, "SAML Response must contain 1 assertion" + end + end + end +end diff --git a/ruby-saml-custom/test/responses/adfs_response_sha1.xml b/ruby-saml-custom/test/responses/adfs_response_sha1.xml new file mode 100644 index 0000000..a44ccad --- /dev/null +++ b/ruby-saml-custom/test/responses/adfs_response_sha1.xml @@ -0,0 +1,46 @@ + + + http://login.example.com/issuer + + + + + http://login.example.com/issuer + + + + + + + + + + + tGpkynNC34A5SFqDSfXmPSiIGpU= + + + WXtmslqh2npLtwhvU8yVx0pvH7E1s8ASksv7VtWirQDFrRRO9k+sNnQcGzA75QNyd6nP+T2e+ofIWyj8G70Rd6gEU4ZmV1vlGVq49Ilc7r/oxauitIuasOvrmpyHCXRbttYeWz4T5xoTCDx9RZQvI4fdrFugrymFT2OREFx1lSk= + + + LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURxekNDQXhTZ0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRc0ZBRENCaGpFTE1Ba0dBMVVFQmhNQ1FWVXgKRERBS0JnTlZCQWdUQTA1VFZ6RVBNQTBHQTFVRUJ4TUdVM2xrYm1WNU1Rd3dDZ1lEVlFRS0RBTlFTVlF4Q1RBSApCZ05WQkFzTUFERVlNQllHQTFVRUF3d1BiR0YzY21WdVkyVndhWFF1WTI5dE1TVXdJd1lKS29aSWh2Y05BUWtCCkRCWnNZWGR5Wlc1alpTNXdhWFJBWjIxaGFXd3VZMjl0TUI0WERURXlNRFF4T1RJeU5UUXhPRm9YRFRNeU1EUXgKTkRJeU5UUXhPRm93Z1lZeEN6QUpCZ05WQkFZVEFrRlZNUXd3Q2dZRFZRUUlFd05PVTFjeER6QU5CZ05WQkFjVApCbE41Wkc1bGVURU1NQW9HQTFVRUNnd0RVRWxVTVFrd0J3WURWUVFMREFBeEdEQVdCZ05WQkFNTUQyeGhkM0psCmJtTmxjR2wwTG1OdmJURWxNQ01HQ1NxR1NJYjNEUUVKQVF3V2JHRjNjbVZ1WTJVdWNHbDBRR2R0WVdsc0xtTnYKYlRDQm56QU5CZ2txaGtpRzl3MEJBUUVGQUFPQmpRQXdnWWtDZ1lFQXFqaWUzUjJvaStwRGFldndJeXMvbWJVVApubkdsa3h0ZGlrcnExMXZ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@example.com + + + + + + + example.com + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport + + + + \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/adfs_response_sha256.xml b/ruby-saml-custom/test/responses/adfs_response_sha256.xml new file mode 100644 index 0000000..6dc30f4 --- /dev/null +++ b/ruby-saml-custom/test/responses/adfs_response_sha256.xml @@ -0,0 +1,46 @@ + + + http://login.example.com/issuer + + + + + http://login.example.com/issuer + + + + + + + + + + + 5mUndDm7OQSGNYVTevsJw3JRVZiwvlDnR2nprJ+6Mhc= + + + MmuXQdjutiuP7soIaB7nk9wSR8OGkmyH5n9aelMTOrV7gTVNDazgQ/GXMmYXTTrhdvGN65duLO0oYdsYGxwNIjlA1lYhoGeBgYuIB/4iKZ6oLSDgjMcQxHkSW1OJ8pIEuUa/3MPUUjaSlTg0me4WRxVdXp34A9Mtlj0DgrK9m0A= + + + LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUQwRENDQXptZ0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRVUZBRENCaGpFTE1Ba0dBMVVFQmhNQ1FWVXgKRERBS0JnTlZCQWdUQTA1VFZ6RVBNQTBHQTFVRUJ4TUdVM2xrYm1WNU1Rd3dDZ1lEVlFRS0RBTlFTVlF4Q1RBSApCZ05WQkFzTUFERVlNQllHQTFVRUF3d1BiR0YzY21WdVkyVndhWFF1WTI5dE1TVXdJd1lKS29aSWh2Y05BUWtCCkRCWnNZWGR5Wlc1alpTNXdhWFJBWjIxaGFXd3VZMjl0TUI0WERURXlNRFF4T0RBMU1qVTFPVm9YRFRNeU1EUXgKTXpBMU1qVTFPVm93Z1lZeEN6QUpCZ05WQkFZVEFrRlZNUXd3Q2dZRFZRUUlFd05PVTFjeER6QU5CZ05WQkFjVApCbE41Wkc1bGVURU1NQW9HQTFVRUNnd0RVRWxVTVFrd0J3WURWUVFMREFBeEdEQVdCZ05WQkFNTUQyeGhkM0psCmJtTmxjR2ww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dqdlNpSytNbndQRWsralRRdDZZYXIxMkRacWVnRGhrWC92OGplTWh4VnpwaStBcHA4M0YKYWFmUE54UFJYc01FTFRCblhDQUJ1YzZEakxBaFlvNGQ4TDhCWUovVjlxLzZRMzdNYVZmc0ZKWVVKNmFBQUppWQpwd1RMUWJidFpqaytZc0s5TzZFR1U4ZjE5djg9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K + + + + + hello@example.com + + + + + + + example.com + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport + + + + \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/adfs_response_sha384.xml b/ruby-saml-custom/test/responses/adfs_response_sha384.xml new file mode 100644 index 0000000..9e817c0 --- /dev/null +++ b/ruby-saml-custom/test/responses/adfs_response_sha384.xml @@ -0,0 +1,46 @@ + + + http://login.example.com/issuer + + + + + http://login.example.com/issuer + + + + + + + + + + + XU0mb78TVA+VwcA71jxe5osjiOzOP/OwDcJ8t/mn2d9+/V2zxejEo9+fkSY2ZR0Z + + + bq1zDllmAFzx0O3HAAoedSqQIl/n2+mK2Vx1pK0/yEpuc84ovwmau/ZfHk3MFNQjuxL+JmlO7I3c6CEmOGeAupFTpnFGkRfJGSu6ilvcL4yasPq80LNEcCYhApiEW2pJXs5t3sfOdG2MJHTuMvz4MtnrLd9Cuf/EQK2a27HDrB4= + + + LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURxekNDQXhTZ0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRc0ZBRENCaGpFTE1Ba0dBMVVFQmhNQ1FWVXgKRERBS0JnTlZCQWdUQTA1VFZ6RVBNQTBHQTFVRUJ4TUdVM2xrYm1WNU1Rd3dDZ1lEVlFRS0RBTlFTVlF4Q1RBSApCZ05WQkFzTUFERVlNQllHQTFVRUF3d1BiR0YzY21WdVkyVndhWFF1WTI5dE1TVXdJd1lKS29aSWh2Y05BUWtCCkRCWnNZWGR5Wlc1alpTNXdh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WQkFNTUQyeGhkM0psYm1ObGNHbDBMbU52YlRFbE1DTUdDU3FHU0liM0RRRUoKQVF3V2JHRjNjbVZ1WTJVdWNHbDBRR2R0WVdsc0xtTnZiWUlCQVRBTkJna3Foa2lHOXcwQkFRc0ZBQU9CZ1FDRQpUQWVKVERTQVc2ejFVRlRWN1FyZWg0VUxGT1JhajkrZUN1RjNLV0RIYyswSVFDajlyZG5ERzRRL3dmNy9yYVEwCkpuUFFDU0NkclBMSmV5b1BIN1FhVHdvYUY3ZHpWdzRMQ3N5TkpURld4NGNNNTBWdzZSNWZET2dpQzhic2ZmUzgKQkptb3VscnJaRE5OVmpHOG1XNmNMeHJZdlZRT3JSVmVjQ0ZJZ3NzQ2JBPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= + + + + + hello@example.com + + + + + + + example.com + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport + + + + \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/adfs_response_sha512.xml b/ruby-saml-custom/test/responses/adfs_response_sha512.xml new file mode 100644 index 0000000..77a001c --- /dev/null +++ b/ruby-saml-custom/test/responses/adfs_response_sha512.xml @@ -0,0 +1,46 @@ + + + http://login.example.com/issuer + + + + + http://login.example.com/issuer + + + + + + + + + + + ZiOdC+GEvslNaP+yncB5droDFBwPeK9EjIpQ2LEI+y/3KPtIjGlp+eEQTVROxq3pqxJiNmSHJvtHzxytxzZsew== + + + JyaWS+PkmpsYZOcjb1Hws3RL1hlyfBY9VeUb7R/5UbeaESpS5Pe2dpfbYWZiOmY/3aYmkv9AEgveVwjddwp+wTQ4jZ91LG8L+ObX1Coq/j0Yj8aXeOBMxdueYmvJQGjHSEn2z0oKypGnbzM5gP/V8Aixa+e1/Kv+A/GcOX1K4SA= + + + LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURxekNDQXhTZ0F3SUJBZ0lCQVRBTkJna3Foa2lHOXcwQkFRc0ZBRENCaGpFTE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XdnYk1HQTFVZEl3U0IKcXpDQnFJQVVrVGpmQmlmS1B2STRCYlk1TGNHWGFzZWdVY21oZ1l5a2dZa3dnWVl4Q3pBSkJnTlZCQVlUQWtGVgpNUXd3Q2dZRFZRUUlFd05PVTFjeER6QU5CZ05WQkFjVEJsTjVaRzVsZVRFTU1Bb0dBMVVFQ2d3RFVFbFVNUWt3CkJ3WURWUVFMREFBeEdEQVdCZ05WQkFNTUQyeGhkM0psYm1ObGNHbDBMbU52YlRFbE1DTUdDU3FHU0liM0RRRUoKQVF3V2JHRjNjbVZ1WTJVdWNHbDBRR2R0WVdsc0xtTnZiWUlCQVRBTkJna3Foa2lHOXcwQkFRc0ZBQU9CZ1FDRQpUQWVKVERTQVc2ejFVRlRWN1FyZWg0VUxGT1JhajkrZUN1RjNLV0RIYyswSVFDajlyZG5ERzRRL3dmNy9yYVEwCkpuUFFDU0NkclBMSmV5b1BIN1FhVHdvYUY3ZHpWdzRMQ3N5TkpURld4NGNNNTBWdzZSNWZET2dpQzhic2ZmUzgKQkptb3VscnJaRE5OVmpHOG1XNmNMeHJZdlZRT3JSVmVjQ0ZJZ3NzQ2JBPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= + + + + + hello@example.com + + + + + + + example.com + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport + + + + \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/adfs_response_xmlns.xml b/ruby-saml-custom/test/responses/adfs_response_xmlns.xml new file mode 100644 index 0000000..f51a646 --- /dev/null +++ b/ruby-saml-custom/test/responses/adfs_response_xmlns.xml @@ -0,0 +1,45 @@ + + http://login.example.com/issuer + + + + + http://login.example.com/issuer + + + + + + + + + + + 5mUndDm7OQSGNYVTevsJw3JRVZiwvlDnR2nprJ+6Mhc= + + + Ck3p/BPGWEY4PCkMuQv1q4ZkOTwIJletF8eXVsS00JWVakW07FBMRehtjDBOzQ3yN+nJFqoLs8Za1wFCZoW//kAlhchR5XVDr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bkxuQ1FaeFlmCnd2QUhwSkVRRFlLMk03TFdCWlVhYVJCOHVCOEJ6WHc2ZkpHbUxnM0JZRmVoSUVwVmZIbHRmd2w3NmZESUFmQXMKR0dWN2FtRzJFaUpCSFoxc0UxaDczaXNDQXdFQUFhTXhNQzh3RGdZRFZSMFBBUUgvQkFRREFnZUFNQjBHQTFVZApEZ1FXQkJTYVNZS2Y4NlJhOFl4VGVRUExTcDJtUkQwWGdqQU5CZ2txaGtpRzl3MEJBUXNGQUFPQ0FRRUFJckhSCjQwRzk4WHl2Wk8yQ1ZrRjRxN0wvTTZNa0FELzlTajdmc2JoTE5tU2NXaHBaUGZPdWpBMEtndjJrSkt4OWRRb2MKZ1NNS2F2amVHL0dFZ3NBM3BnVEhHZWQ1SW16UjNGMUpuNVlVbmt0Z1ROREhSVjRDTTM5WEx1S1J4VzlVNUN2OAp1dGg1U1JSeVFFMGJ2a0RhOEZNUW9TVW9XSW9yZG94WmE0ZkhkYXFabmswdzF5VUg5cE9EdTFnRGJpTE9jWS91CjNPT0t5ZVFReWwwbzVZSTY5RnhReG81aFQwc3drWkNwTDAvTmlxWFlDdFR3aXpiRHc5M0xIN0V0VjRaUGlpaDQKRE1KYVJSUTlKcm1zaHp0enpqdzBmd2VuTmY0U096cFBTVmp2YXFTUkVPWjg2NTgwUG5HUHJyOFMyNGNwSGt2OQpqbFpjZHRic2NYTjhIS3NsT2c9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg== + + + + + hello@example.com + + + + + + + example.com + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport + + + + diff --git a/ruby-saml-custom/test/responses/attackxee.xml b/ruby-saml-custom/test/responses/attackxee.xml new file mode 100644 index 0000000..6755d14 --- /dev/null +++ b/ruby-saml-custom/test/responses/attackxee.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +]> +&lol9; \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/duplicated_attributes.xml.base64 b/ruby-saml-custom/test/responses/invalids/duplicated_attributes.xml.base64 new file mode 100644 index 0000000..9ee4d7a --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/duplicated_attributes.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeDYwOGY2ZGIxLTJiN2MtNDljMi0yNmQ1LTZjM2YyODlkNGZmNyIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTQtMDItMTlUMDE6Mzc6MDFaIiBEZXN0aW5hdGlvbj0iaHR0cDovL2xvY2FsaG9zdDo4MDgwL2phdmEtc2FtbC1qc3BzYW1wbGUvYWNzLmpzcCIgSW5SZXNwb25zZVRvPSJPTkVMT0dJTl81ZmU5ZDZlNDk5YjJmMDkxMzIwNmFhYjNmNzE5MTcyOTA0OWJiODA3Ij48c2FtbDpJc3N1ZXI+aHR0cHM6Ly9waXRidWxrLm5vLWlwLm9yZy9zaW1wbGVzYW1sL3NhbWwyL2lkcC9tZXRhZGF0YS5waHA8L3NhbWw6SXNzdWVyPjxkczpTaWduYXR1cmUgeG1sbnM6ZHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyMiPg0KICA8ZHM6U2lnbmVkSW5mbz48ZHM6Q2Fub25pY2FsaXphdGlvbk1ldGhvZCBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvMTAveG1sLWV4Yy1jMTRuIyIvPg0KICAgIDxkczpTaWduYXR1cmVNZXRob2QgQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjcnNhLXNoYTEiLz4NCiAgPGRzOlJlZmVy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wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+PHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+Smhvbjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48L3NhbWw6QXR0cmlidXRlPjxzYW1sOkF0dHJpYnV0ZSBOYW1lPSJzbiIgTmFtZUZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+PHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+RG9lPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PHNhbWw6QXR0cmlidXRlIE5hbWU9ImVkdVBlcnNvbkFmZmlsaWF0aW9uIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj51c2VyPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPmFkbWluPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD48L3NhbWw6QXNzZXJ0aW9uPjwvc2FtbHA6UmVzcG9uc2U+ \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/empty_destination.xml.base64 b/ruby-saml-custom/test/responses/invalids/empty_destination.xml.base64 new file mode 100644 index 0000000..352988c --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/empty_destination.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA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GVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj5hZG1pbjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48L3NhbWw6QXR0cmlidXRlPjwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+PC9zYW1sOkFzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg== \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/empty_nameid.xml.base64 b/ruby-saml-custom/test/responses/invalids/empty_nameid.xml.base64 new file mode 100644 index 0000000..72350d1 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/empty_nameid.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeDQ0MTM5Y2JkLWE2NTQtOWM1Mi00Njk3LTdjMDVkMzAyM2QyZiIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTQtMDItMTlUMDE6Mzc6MDFaIiBEZXN0aW5hdGlvbj0iaHR0cHM6Ly9waXRidWxrLm5vLWlwLm9yZy9uZXdvbmVsb2dpbi9kZW1vMS9pbmRleC5waHA/YWNzIiBJblJlc3BvbnNlVG89Ik9ORUxPR0lOXzVmZTlkNmU0OTliMmYwOTEzMjA2YWFiM2Y3MTkxNzI5MDQ5YmI4MDciPjxzYW1sOklzc3Vlcj5odHRwczovL3BpdGJ1bGsubm8taXAub3JnL3NpbXBsZXNhbWwvc2FtbDIvaWRwL21ldGFkYXRhLnBocDwvc2FtbDpJc3N1ZXI+PGRzOlNpZ25hdHVyZSB4bWxuczpkcz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnIyI+DQogIDxkczpTaW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NuIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj5NYXJ0aW4yPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PHNhbWw6QXR0cmlidXRlIE5hbWU9ImVkdVBlcnNvbkFmZmlsaWF0aW9uIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj51c2VyPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPmFkbWluPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD48L3NhbWw6QXNzZXJ0aW9uPjwvc2FtbHA6UmVzcG9uc2U+ \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/encrypted_new_attack.xml.base64 b/ruby-saml-custom/test/responses/invalids/encrypted_new_attack.xml.base64 new file mode 100644 index 0000000..506be67 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/encrypted_new_attack.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIElEPSJuZXctaWQiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDE0LTAzLTIxVDEz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NmUvQVh1eUVYbGNhSXREYUFsSnNPa1VyZ291NGQ5T1U0dnF6NzRwb2VSaFdlRFJaMlpYa2VGeVcveUtjRENxVzVubnZraUdieUtvTExDNXV6RlkxeXE3c0M3ZURoRlhIK1hmaEN4R0V3bHp0eC96ZXROQUdXWWJjWEwwd2lkREFzWkZabDJYMXhPL0JLWnQ2alpwV29ZNk1kSDl6eUYyYjRGbUJxTDhEdDQ8L3hlbmM6Q2lwaGVyVmFsdWU+CiAgIDwveGVuYzpDaXBoZXJEYXRhPgo8L3hlbmM6RW5jcnlwdGVkRGF0YT48L3NhbWw6RW5jcnlwdGVkQXNzZXJ0aW9uPjwvc2FtbHA6UmVzcG9uc2U+Cg== diff --git a/ruby-saml-custom/test/responses/invalids/invalid_audience.xml.base64 b/ruby-saml-custom/test/responses/invalids/invalid_audience.xml.base64 new file mode 100644 index 0000000..a34b12c --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/invalid_audience.xml.base64 @@ -0,0 +1 @@ +tVdZc7JIF76fqvkPlu9lyrAqQiWpQVDjgoLglpsplgZRNmkQ5Nd/DS4xMcnMO1XflXL6bM9zTvfpfoK670XcDMAoDCCo5b4XQK4SPtfTOOBCHbqQC3QfQC4xOZWXxhz5iHNRHCahGXr1G5OfLXQIQZy4YVCvDcTnemTnFm1aOkO1Gi29RTRwlmo3GNwEDaqNt0HbZO2mBeq1BYghsnquIyfIFMIUDAKY6EGCRDiBDFsNgtEImmvSHEG/1WsigIkb6ElltUmSiMMwmKS2/WiGPgYCKwrdIIE3/3QTPkabCLkPLlRo4XP97yZjmIbN4A3GIOwGTpCgYbZJosG0SbRAUIZBtesvf/5Rqz2VBHBVdvHLOaZrRY8g1/3IA1XkJ+xW6cmCnOo6KM80vhBvwWvCWZY9ZtRjGDsYieM4hrMY0rGg6/w6RzzbA2sQ2GHlTtCDMHBN3XOLCr0Ekk1o1XjPCWM32fjfOCcwAi+dN0BuNkyCDn7VsSrEe5AqyX/p7kOuMdQbcKMTZ4+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jtJvmwjd4HWsSpCRLByzS4lQmhBWrVjvt57sNKm1NT0wQQXuYAduf+NEH5yy3hPBFz6H57/q6ksWpugK833OpCYIL61eqfja7XEKZNEyxLoEOcoewGjVPNBiABmvQEmkE4ICwK0P/hGnLL2W9dDG7t1NTYAjM5yy7SCSJ5INZUufyjpGje2y6IEWTgeWHpsV7rofGjJ99XhngkKolrNexKlUOUuB5vWXFZpRcY+iAMwF83aZ6zPAX/lNE5TyEMbLf0VhbwNPF+bg7T5wygxyCuXx3+4LJs3NokTKbBNObtpIRM4iR+Qz17ugHOgOlGLihr8/+//2HvXGDfZX4pKvZFVU9wkbbllqqwRNgBqCqg6qxbeBRHl/DuKCDuKPhUHz613HL+I3RJ7Jo3Kd3rXLs0OKDOsh71s/ymB66qn5B/H+as8I7yA3g+TTZBeRYAHxWtVn1+v7twBnGgojZFfr6lgiSv74Gz6iCwQF4WlTAAxbCtpg2MZpNhrTZOETSBMy2WalkmCViLsNg2MOx7FlFeCEIC8uQL+t4XBQ+9dtCl6+XHB5HJmaUeEsvoJwtj60rjF67uqL7L5XblSuZHnhNUFiNNwOflO4Vauc2f6+WZUK/+/9OBUiFC1qX0cqQYSM+839nXINX0qKEjnkuOEYqWo3ckWgqcn86fj9Z3tFxWP3HyNfDL6mXolHdH7OOT+OV/ \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/invalid_issuer_assertion.xml.base64 b/ruby-saml-custom/test/responses/invalids/invalid_issuer_assertion.xml.base64 new file mode 100644 index 0000000..217caa9 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/invalid_issuer_assertion.xml.base64 @@ -0,0 +1 @@ +nVdbc6rKEn4/Vec/WK7HlOEuYiXZZwQ1XlARNCYvp2AYBOUmg4L++j3gJSYm2Xutp8Se7p7v+3pmunn4Kw/8yg4l2IvCxypzT1f/evrvfx6wGfhxc4pwHIUYVYhTiJuF8bG6TcJmZGIPN0MzQLiZwqYO1GGTvaebJsYoSUmq6lVI/HNMnERpBCO/W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n13I+KsZL6+LX89Dc= \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/invalid_issuer_message.xml.base64 b/ruby-saml-custom/test/responses/invalids/invalid_issuer_message.xml.base64 new file mode 100644 index 0000000..e63c0f4 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/invalid_issuer_message.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeDY1YzllMWQ5LTY2MjItNGE4MC1kMjNjLTE4ZWQwOTdkZTU1MCIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTEtMDYtMTdUMTQ6NTQ6MTRaIiBEZXN0aW5hdGlvbj0iaHR0cDovL3N0dWZmLmNvbS9lbmRwb2ludHMvZW5kcG9pbnRzL2Fjcy5waHAiIEluUmVzcG9uc2VUbz0iXzU3YmNiZjcwLTdiMWYtMDEyZS1jODIxLTc4MmJjYjEzYmIzOCI+DQogIDxzYW1sOklzc3Vlcj5odHRwOi8vaW52YWxpZC5pc3N1ZXIuZXhhbXBsZS5jb20vPC9zYW1sOklzc3Vlcj48ZHM6U2lnbmF0dXJlIHhtbG5zOmRzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjIj4NCiAgPGRzOlNpZ25lZEluZm8+PGRzOkNhbm9uaWNhbGl6YXRpb25NZXRob2QgQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzEwL3htbC1leGMtYzE0biMiLz4NCiAgICA8ZHM6U2lnbmF0dXJlTWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnI3JzYS1z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jIuMDphdHRybmFtZS1mb3JtYXQ6YmFzaWMiPg0KICAgICAgICA8c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj5zb21lb25lQGV4YW1wbGUuY29tPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPg0KICAgICAgPC9zYW1sOkF0dHJpYnV0ZT4NCiAgICA8L3NhbWw6QXR0cmlidXRlU3RhdGVtZW50Pg0KICA8L3NhbWw6QXNzZXJ0aW9uPg0KPC9zYW1scDpSZXNwb25zZT4= \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/invalid_signature_position.xml.base64 b/ruby-saml-custom/test/responses/invalids/invalid_signature_position.xml.base64 new file mode 100644 index 0000000..1cc8af6 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/invalid_signature_position.xml.base64 @@ -0,0 +1 @@ +pVbbkqpKEn2fiPkHw/1o2BQXQY1uz5SgthdUGrTVlwkoCkG5KIWCfv0p8LLbPt377DPzpJWVtXLlysosnv/IAr90xDHxovClzD6B8h+tf//rmZiBv2u+YbKLQoJL1Ckkzdz4Uj7EYTMyiUeaoRlg0kxQU4fqqMk9gaZJCI4TClX+cGT36zO7OEoiFPnlUl95Ke+czEJ1TjQdu4obDq7avGNV7bokVJEgAYB47ABUL5fmN84Ugx4l5ID7IUnMMKEmwApVIFaBYACuyXFNwK3KJQWTxAvNpDjlJsmuyTDmbvcUHGzzKYwYQiIG0XQPAaaA4S15I3op/9dBgskLFqhKmNIBLIeryDRxVapzFrJY3rL4erlVyNYsuMStPAK5hohC7EdrL3xCUcDkTtwz89H3qreemMmBPK7kyMaluekf8K9lJIV3Uz8ghAkpM61LhEfQJrwV6FqfjNylSNP0KeWfonjNcACwzEId6cjFgVm++3p/71z1iiIg/JcKXYrbqLGiBRy+KtR4scoCR6wi0TGrDduucTxmhUYd/VY5/0+xqVDWBqPkuhpTPftKqRvFgZl8LzT7xBYWz646hWuTpuz50LbjXPRWQq/Yfz7Gv0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qpIX/sJO6UyuYqxZn76xNR1VhdOFMo72910K133NUCHqyvu/pfYtXtE6uEYRCbwwVue1pNBVNicSgoq2OS43JRqDjj9aH3ZDVFLQcCU5tirYpGa/1xm52nEvO2djLr9u64Y4yYytwqsapaEAmeDaYTyWuPnRPwaYr77P1VJgf0rdtI95BH1QC9ySqU/u0OUGxxwqbWHnXxdqJjJA7FBLmmO46yhnomt+JeuxWPfu+Hkjnlc4vYryGkrIZm7Oltk/7CtRg+3NO7UtObThSuWNP9jTmGFRM8SiAynzBne39K+Q0hj12Wc/SzoOaoA7kyfz9SCpHbeGsuq4dgMlU5fqxMpOi/XE43U/FbALxYCi+gtNUUoXliHfMRD/2l0HgnBZyY5vw+vHMjE/x63nqzsIBOGGGzPRFFp61LEUB05imcB9rJuS1nbZ9rUknq8tMovg0xRXOLdri80W/Gy+twHxskoc2un803z7+W38C \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/invalid_subjectconfirmation_inresponse.xml.base64 b/ruby-saml-custom/test/responses/invalids/invalid_subjectconfirmation_inresponse.xml.base64 new file mode 100644 index 0000000..c9991c2 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/invalid_subjectconfirmation_inresponse.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeDY3MjlmMTI0LTc3ZjQtMzVkMS0xMjQ5LTVhNjhhODZlZGEwZSIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTEtMDYtMTdUMTQ6NTQ6MTRaIiBEZXN0aW5hdGlvbj0iaHR0cDovL3N0dWZmLmNvbS9lbmRwb2ludHMvZW5kcG9pbnRzL2Fjcy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U1NzlkODAzMTQxMDc2OTM2ZGMyZTlkMWQ5OGViZiI+DQogICAgICA8c2FtbDpBdXRobkNvbnRleHQ+DQogICAgICAgIDxzYW1sOkF1dGhuQ29udGV4dENsYXNzUmVmPnVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphYzpjbGFzc2VzOlBhc3N3b3JkPC9zYW1sOkF1dGhuQ29udGV4dENsYXNzUmVmPg0KICAgICAgPC9zYW1sOkF1dGhuQ29udGV4dD4NCiAgICA8L3NhbWw6QXV0aG5TdGF0ZW1lbnQ+DQogICAgPHNhbWw6QXR0cmlidXRlU3RhdGVtZW50Pg0KICAgICAgPHNhbWw6QXR0cmlidXRlIE5hbWU9Im1haWwiIE5hbWVGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphdHRybmFtZS1mb3JtYXQ6YmFzaWMiPg0KICAgICAgICA8c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj5zb21lb25lQGV4YW1wbGUuY29tPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPg0KICAgICAgPC9zYW1sOkF0dHJpYnV0ZT4NCiAgICA8L3NhbWw6QXR0cmlidXRlU3RhdGVtZW50Pg0KICA8L3NhbWw6QXNzZXJ0aW9uPg0KPC9zYW1scDpSZXNwb25zZT4= \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/invalid_subjectconfirmation_nb.xml.base64 b/ruby-saml-custom/test/responses/invalids/invalid_subjectconfirmation_nb.xml.base64 new file mode 100644 index 0000000..e7799e6 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/invalid_subjectconfirmation_nb.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm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OkF1ZGllbmNlUmVzdHJpY3Rpb24+DQogICAgPC9zYW1sOkNvbmRpdGlvbnM+DQogICAgPHNhbWw6QXV0aG5TdGF0ZW1lbnQgQXV0aG5JbnN0YW50PSIyMDExLTA2LTE3VDE0OjU0OjA3WiIgU2Vzc2lvbk5vdE9uT3JBZnRlcj0iMjAyMS0wNi0xN1QyMjo1NDoxNFoiIFNlc3Npb25JbmRleD0iXzUxYmUzNzk2NWZlYjU1NzlkODAzMTQxMDc2OTM2ZGMyZTlkMWQ5OGViZiI+DQogICAgICA8c2FtbDpBdXRobkNvbnRleHQ+DQogICAgICAgIDxzYW1sOkF1dGhuQ29udGV4dENsYXNzUmVmPnVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphYzpjbGFzc2VzOlBhc3N3b3JkPC9zYW1sOkF1dGhuQ29udGV4dENsYXNzUmVmPg0KICAgICAgPC9zYW1sOkF1dGhuQ29udGV4dD4NCiAgICA8L3NhbWw6QXV0aG5TdGF0ZW1lbnQ+DQogICAgPHNhbWw6QXR0cmlidXRlU3RhdGVtZW50Pg0KICAgICAgPHNhbWw6QXR0cmlidXRlIE5hbWU9Im1haWwiIE5hbWVGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphdHRybmFtZS1mb3JtYXQ6YmFzaWMiPg0KICAgICAgICA8c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj5zb21lb25lQGV4YW1wbGUuY29tPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPg0KICAgICAgPC9zYW1sOkF0dHJpYnV0ZT4NCiAgICA8L3NhbWw6QXR0cmlidXRlU3RhdGVtZW50Pg0KICA8L3NhbWw6QXNzZXJ0aW9uPg0KPC9zYW1scDpSZXNwb25zZT4= \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/invalid_subjectconfirmation_noa.xml.base64 b/ruby-saml-custom/test/responses/invalids/invalid_subjectconfirmation_noa.xml.base64 new file mode 100644 index 0000000..2946ba8 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/invalid_subjectconfirmation_noa.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeGE3YjFlZGIwLTQwNzctNDU1OC0wNDVlLWU3OGUwNTc5NDViYSIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTEtMDYtMTdUMTQ6NTQ6MTRaIiBEZXN0aW5hdGlvbj0iaHR0cDovL3N0dWZmLmNvbS9lbmRwb2ludHMvZW5kcG9pbnRzL2Fjcy5waHAiIEluUmVzcG9uc2VUbz0iXzU3YmNiZjcwLTdiMWYtMDEyZS1jODIxLTc4MmJjYjEzYmIzOCI+DQogIDxzYW1sOklzc3Vlcj5odHRwOi8vaWRwLmV4YW1wbGUuY29tLzwvc2FtbDpJc3N1ZXI+PGRzOlNpZ25hdHVyZSB4bWxuczpkcz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnIyI+DQogIDxkczpTaWduZWRJbmZvPjxkczpDYW5vbmljYWxpemF0aW9uTWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS8xMC94bWwtZXhjLWMxNG4jIi8+DQogICAgPGRzOlNpZ25hdHVyZU1ldGhvZCBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyNyc2Etc2hhMSIvPg0KICA8ZHM6UmVmZXJlbmNlIFVSST0iI3BmeGE3YjFlZGIwLTQwNzctNDU1OC0wNDVlLWU3OGUwNTc5NDViYSI+PGRzOlRyYW5zZm9ybXM+PGRzOlRyY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NhbWw6QXR0cmlidXRlVmFsdWU+DQogICAgICA8L3NhbWw6QXR0cmlidXRlPg0KICAgIDwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogIDwvc2FtbDpBc3NlcnRpb24+DQo8L3NhbWxwOlJlc3BvbnNlPg== \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/invalid_subjectconfirmation_recipient.xml.base64 b/ruby-saml-custom/test/responses/invalids/invalid_subjectconfirmation_recipient.xml.base64 new file mode 100644 index 0000000..b2e6e80 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/invalid_subjectconfirmation_recipient.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeDc5MDA1OWViLWMzMjUtNjU3Yy01MjBmLTY2NTM5MGIxYmY3NyIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTEtMDYtMTdUMTQ6NTQ6MTRaIiBEZXN0aW5hdGlvbj0iaHR0cDovL3N0dWZmLmNvbS9lbmRwb2ludHMvZW5kcG9pbnRzL2Fjcy5waHAiIEluUmVzcG9uc2VUbz0iXzU3YmNiZjcwLTdiMWYtMDEyZS1jODIxLTc4MmJjYjEzYmIzOCI+DQogIDxzYW1sOklzc3Vlcj5odHRwOi8vaWRwLmV4YW1wbGUuY29tLzwvc2FtbDpJc3N1ZXI+PGRzOlNpZ25hdHVyZSB4bWxuczpkcz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnIyI+DQogIDxkczpTaWduZWRJbmZvPjxkczpDYW5vbmljYWxpemF0aW9uTWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3d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GVtZW50Pg0KICAgIDxzYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgICAgIDxzYW1sOkF0dHJpYnV0ZSBOYW1lPSJtYWlsIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj4NCiAgICAgICAgPHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+c29tZW9uZUBleGFtcGxlLmNvbTwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT4NCiAgICAgIDwvc2FtbDpBdHRyaWJ1dGU+DQogICAgPC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgPC9zYW1sOkFzc2VydGlvbj4NCjwvc2FtbHA6UmVzcG9uc2U+ \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/multiple_assertions.xml.base64 b/ruby-saml-custom/test/responses/invalids/multiple_assertions.xml.base64 new file mode 100644 index 0000000..228906e --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/multiple_assertions.xml.base64 @@ -0,0 +1,2 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIElEPSJHT1NBTUxSMTI5MDExNzQ1NzE3OTQiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDEwLTExLTE4VDIxOjU3OjM3WiIgRGVzdGluYXRpb249IntyZWNpcGllbnR9Ij4NCiAgPHNhbWxwOlN0YXR1cz4NCiAgICA8c2FtbHA6U3RhdHVzQ29kZSBWYWx1ZT0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnN0YXR1czpTdWNjZXNzIi8+PC9zYW1scDpTdGF0dXM+DQogIDxzYW1sO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Fzc2VzOlBhc3N3b3JkPC9zYW1sOkF1dGhuQ29udGV4dENsYXNzUmVmPg0KICAgICAgPC9zYW1sOkF1dGhuQ29udGV4dD4NCiAgICA8L3NhbWw6QXV0aG5TdGF0ZW1lbnQ+DQogICAgPHNhbWw6QXR0cmlidXRlU3RhdGVtZW50Pg0KICAgICAgPHNhbWw6QXR0cmlidXRlIE5hbWU9InVpZCI+DQogICAgICAgIDxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhtbG5zOnhzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIgeHNpOnR5cGU9InhzOnN0cmluZyI+ZGVtbzwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT4NCiAgICAgIDwvc2FtbDpBdHRyaWJ1dGU+DQogICAgICA8c2FtbDpBdHRyaWJ1dGUgTmFtZT0iYW5vdGhlcl92YWx1ZSI+DQogICAgICAgIDxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhtbG5zOnhzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIgeHNpOnR5cGU9InhzOnN0cmluZyI+dmFsdWU8L3NhbWw6QXR0cmlidXRlVmFsdWU+DQogICAgICA8L3NhbWw6QXR0cmlidXRlPg0KICAgIDwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogIDwvc2FtbDpBc3NlcnRpb24+DQo8L3NhbWxwOlJlc3BvbnNlPg== + diff --git a/ruby-saml-custom/test/responses/invalids/multiple_signed.xml.base64 b/ruby-saml-custom/test/responses/invalids/multiple_signed.xml.base64 new file mode 100644 index 0000000..1bc4fec --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/multiple_signed.xml.base64 @@ -0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sdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+U2l4dG8zPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PHNhbWw6QXR0cmlidXRlIE5hbWU9InNuIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj5NYXJ0aW4yPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PHNhbWw6QXR0cmlidXRlIE5hbWU9ImVkdVBlcnNvbkFmZmlsaWF0aW9uIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj51c2VyPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPmFkbWluPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD48L3NhbWw6QXNzZXJ0aW9uPjwvc2FtbHA6UmVzcG9uc2U+ \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/no_authnstatement.xml.base64 b/ruby-saml-custom/test/responses/invalids/no_authnstatement.xml.base64 new file mode 100644 index 0000000..d116b7b --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/no_authnstatement.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMD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0ZSBOYW1lPSJzbiIgTmFtZUZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+PHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+TWFydGluMjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48L3NhbWw6QXR0cmlidXRlPjxzYW1sOkF0dHJpYnV0ZSBOYW1lPSJlZHVQZXJzb25BZmZpbGlhdGlvbiIgTmFtZUZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+PHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+dXNlcjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj5hZG1pbjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48L3NhbWw6QXR0cmlidXRlPjwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+PC9zYW1sOkFzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg== \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/no_conditions.xml.base64 b/ruby-saml-custom/test/responses/invalids/no_conditions.xml.base64 new file mode 100644 index 0000000..4b73a83 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/no_conditions.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeGQyMjJkZWI1LTZkMjktNWFiZC05NmM0LWF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1lPSJzbiIgTmFtZUZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+PHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+TWFydGluMjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48L3NhbWw6QXR0cmlidXRlPjxzYW1sOkF0dHJpYnV0ZSBOYW1lPSJlZHVQZXJzb25BZmZpbGlhdGlvbiIgTmFtZUZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+PHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+dXNlcjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj5hZG1pbjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48L3NhbWw6QXR0cmlidXRlPjwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+PC9zYW1sOkFzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg== \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/no_id.xml.base64 b/ruby-saml-custom/test/responses/invalids/no_id.xml.base64 new file mode 100644 index 0000000..11db265 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/no_id.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDE0LTAyLTE5VDAxOjA1OjQ5WiIgRGVzdGluYXRpb249Imh0dHBzO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0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+PHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+dXNlcjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj5hZG1pbjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48L3NhbWw6QXR0cmlidXRlPjwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+PC9zYW1sOkFzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg== diff --git a/ruby-saml-custom/test/responses/invalids/no_issuer_assertion.xml.base64 b/ruby-saml-custom/test/responses/invalids/no_issuer_assertion.xml.base64 new file mode 100644 index 0000000..46094a6 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/no_issuer_assertion.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeDBlNmM5NjUzLTEwNjgtYzhjNS1iNzVjLWU2OTA1ZTE0M2Q0NCIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTQtMDItMTlUMDE6Mzc6MDFaIiBEZXN0aW5hdGlvbj0iaHR0cHM6Ly9waXRidWxrLm5vLWlwLm9yZy9uZXdvbmVsb2dpbi9kZW1vMS9pbmRleC5waHA/YWNzIiBJblJlc3BvbnNlVG89Ik9ORUxPR0lOXzVmZTlkNmU0OTliMmYwOTEzMjA2YWFiM2Y3MTkxNzI5MDQ5YmI4MDciPjxzYW1sOklzc3Vlcj5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2ljIj48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj5NYXJ0aW4yPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PHNhbWw6QXR0cmlidXRlIE5hbWU9ImVkdVBlcnNvbkFmZmlsaWF0aW9uIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj51c2VyPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPmFkbWluPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD48L3NhbWw6QXNzZXJ0aW9uPjwvc2FtbHA6UmVzcG9uc2U+ \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/no_issuer_response.xml.base64 b/ruby-saml-custom/test/responses/invalids/no_issuer_response.xml.base64 new file mode 100644 index 0000000..0e498d4 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/no_issuer_response.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIElEPSJwZnhmMTA1MTkwNy0wZDZjLWI0NjctZjBiNC1kMDI4YTU4ZjNmNzIiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDE0LTAyLTE5VDAxOjM3OjAxWiIgRGVzdGluYXRpb249Imh0dHBzOi8vcGl0Y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2FtbDpBdHRyaWJ1dGVWYWx1ZT48L3NhbWw6QXR0cmlidXRlPjxzYW1sOkF0dHJpYnV0ZSBOYW1lPSJzbiIgTmFtZUZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+PHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+TWFydGluMjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48L3NhbWw6QXR0cmlidXRlPjxzYW1sOkF0dHJpYnV0ZSBOYW1lPSJlZHVQZXJzb25BZmZpbGlhdGlvbiIgTmFtZUZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+PHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+dXNlcjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj5hZG1pbjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48L3NhbWw6QXR0cmlidXRlPjwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+PC9zYW1sOkFzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg== \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/no_nameid.xml.base64 b/ruby-saml-custom/test/responses/invalids/no_nameid.xml.base64 new file mode 100644 index 0000000..3c2b6d9 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/no_nameid.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjO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DQogICAgICA8L3NhbWw6QXV0aG5Db250ZXh0Pg0KICAgIDwvc2FtbDpBdXRoblN0YXRlbWVudD4NCiAgICA8c2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogICAgICA8c2FtbDpBdHRyaWJ1dGUgTmFtZT0ibWFpbCIgTmFtZUZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+DQogICAgICAgIDxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPnNvbWVvbmVAZXhhbXBsZS5jb208L3NhbWw6QXR0cmlidXRlVmFsdWU+DQogICAgICA8L3NhbWw6QXR0cmlidXRlPg0KICAgIDwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogIDwvc2FtbDpBc3NlcnRpb24+DQo8L3NhbWxwOlJlc3BvbnNlPg== diff --git a/ruby-saml-custom/test/responses/invalids/no_saml2.xml.base64 b/ruby-saml-custom/test/responses/invalids/no_saml2.xml.base64 new file mode 100644 index 0000000..71e7fbe --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/no_saml2.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlDQogICAgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjEuMDpwcm90b2NvbCINCiAgICBNYWpvclZlcnNpb249IjEiIE1pbm9yVmVyc2lvbj0iMSINCiAgICBSZXNwb25zZUlEPSJiMDdiODA0Yy03YzI5LWVhMTYtNzMwMC00ZjNkNmY3OTI4YWMiDQogICAgSW5SZXNwb25zZVRvPSJhYWYyMzE5Ni0xNzczLTIxMTMtNDc0YS1mZTExNDQxMmFiNzIiDQogICAgSXNzdWVJbnN0YW50PSIyMDA2LTA3LTE3VDIyOjI2OjQxWiI+DQogIDxzYW1sOkFzc2VydGlvbg0KICAgIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW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Rob2Q+DQogICAgICAgIDwvc2FtbDpTdWJqZWN0Q29uZmlybWF0aW9uPg0KICAgICAgPC9zYW1sOlN1YmplY3Q+DQogICAgPC9zYW1sOkF1dGhlbnRpY2F0aW9uU3RhdGVtZW50Pg0KICA8L3NhbWw6QXNzZXJ0aW9uPg0KICA8L3NhbWxwOlJlc3BvbnNlPg== \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/no_signature.xml.base64 b/ruby-saml-custom/test/responses/invalids/no_signature.xml.base64 new file mode 100644 index 0000000..bed73c5 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/no_signature.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIElEPSJwZngwNWYzY2UxMC0xNjE1LWYzZWEtYTk4OC02MGUzODBiMzI5OWYiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDE0LTAyLTE5VDAxOjM3OjAxWiIgRGVzdGluYXRpb249Imh0dHBzOi8vZXhhbXBsZS5jb20vbmV3b25lbG9naW4vZGVtbzEvaW5kZXgucGhwP2FjcyIgSW5SZXNwb25zZVRvPSJPTkVMT0dJTl81ZmU5ZDZlNDk5YjJmMDkxMzIwNmFhYjNmNzE5MTcyOTA0OWJiODA3Ij48c2FtbDpJc3N1ZXI+aHR0cHM6Ly9leGFtcGxlLmNvbS9zaW1wbGVzYW1sL3NhbWwyL2lkcC9tZXRhZGF0YS5waHA8L3NhbWw6SXNzdWVyPjxzYW1scDpTdGF0dXM+PHNhbWxwOlN0YXR1c0NvZGUgVmFsdWU9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpzdGF0dXM6U3VjY2VzcyIvPjwvc2FtbHA6U3RhdHVzPjxzYW1sOkFzc2Vyd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48c2FtbDpDb25kaXRpb25zIE5vdEJlZm9yZT0iMjAxNC0wMi0xOVQwMTozNjozMVoiIE5vdE9uT3JBZnRlcj0iMjAyMy0wOC0yM1QwNjo1NzowMVoiPjxzYW1sOkF1ZGllbmNlUmVzdHJpY3Rpb24+PHNhbWw6QXVkaWVuY2U+aHR0cHM6Ly9leGFtcGxlLmNvbS9uZXdvbmVsb2dpbi9kZW1vMS9tZXRhZGF0YS5waHA8L3NhbWw6QXVkaWVuY2U+PC9zYW1sOkF1ZGllbmNlUmVzdHJpY3Rpb24+PC9zYW1sOkNvbmRpdGlvbnM+PHNhbWw6QXV0aG5TdGF0ZW1lbnQgQXV0aG5JbnN0YW50PSIyMDE0LTAyLTE5VDAxOjM3OjAxWiIgU2Vzc2lvbk5vdE9uT3JBZnRlcj0iMjAxNC0wMi0xOVQwOTozNzowMVoiIFNlc3Npb25JbmRleD0iXzYyNzNkNzdiOGNkZTBjMzMzZWM3OWQyMmE5ZmEwMDAzYjlmZTJkNzVjYiI+PHNhbWw6QXV0aG5Db250ZXh0PjxzYW1sOkF1dGhuQ29udGV4dENsYXNzUmVmPnVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphYzpjbGFzc2VzOlBhc3N3b3JkPC9zYW1sOkF1dGhuQ29udGV4dENsYXNzUmVmPjwvc2FtbDpBdXRobkNvbnRleHQ+PC9zYW1sOkF1dGhuU3RhdGVtZW50Pjwvc2FtbDpBc3NlcnRpb24+PC9zYW1scDpSZXNwb25zZT4= diff --git a/ruby-saml-custom/test/responses/invalids/no_status.xml.base64 b/ruby-saml-custom/test/responses/invalids/no_status.xml.base64 new file mode 100644 index 0000000..4f5905e --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/no_status.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIHhtbG5zOnNhbWxwPSJ1cm46b2Fza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imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4c2k6dHlwZT0ieHM6c3RyaW5nIj5kZW1vPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPg0KICAgICAgPC9zYW1sOkF0dHJpYnV0ZT4NCiAgICAgIDxzYW1sOkF0dHJpYnV0ZSBOYW1lPSJhbm90aGVyX3ZhbHVlIj4NCiAgICAgICAgPHNhbWw6QXR0cmlidXRlVmFsdWUgeG1sbnM6eHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4c2k6dHlwZT0ieHM6c3RyaW5nIj52YWx1ZTwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT4NCiAgICAgIDwvc2FtbDpBdHRyaWJ1dGU+DQogICAgPC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgPC9zYW1sOkFzc2VydGlvbj4NCjwvc2FtbHA6UmVzcG9uc2U+ diff --git a/ruby-saml-custom/test/responses/invalids/no_status_code.xml.base64 b/ruby-saml-custom/test/responses/invalids/no_status_code.xml.base64 new file mode 100644 index 0000000..94c439b --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/no_status_code.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIElEPSJHT1NBTUxSMTI5MDExNzQ1NzE3OTQiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDEwLTExLTE4VDIxOjU3OjM3WiIgRGVzd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luc3RhbmNlIiB4c2k6dHlwZT0ieHM6c3RyaW5nIj5kZW1vPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPg0KICAgICAgPC9zYW1sOkF0dHJpYnV0ZT4NCiAgICAgIDxzYW1sOkF0dHJpYnV0ZSBOYW1lPSJhbm90aGVyX3ZhbHVlIj4NCiAgICAgICAgPHNhbWw6QXR0cmlidXRlVmFsdWUgeG1sbnM6eHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4c2k6dHlwZT0ieHM6c3RyaW5nIj52YWx1ZTwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT4NCiAgICAgIDwvc2FtbDpBdHRyaWJ1dGU+DQogICAgPC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgPC9zYW1sOkFzc2VydGlvbj4NCjwvc2FtbHA6UmVzcG9uc2U+ diff --git a/ruby-saml-custom/test/responses/invalids/no_subjectconfirmation_data.xml.base64 b/ruby-saml-custom/test/responses/invalids/no_subjectconfirmation_data.xml.base64 new file mode 100644 index 0000000..146df03 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/no_subjectconfirmation_data.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeDg0MDhlZmYyLTBmMTYtMTNlZC00YWY5LTc2NzBjOTE4ODBlZCIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTEtMDYtMTdUMTQ6NTQ6MTRaIiBEZXN0aW5hdGlvbj0iaHR0cD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wOmFjOmNsYXNzZXM6UGFzc3dvcmQ8L3NhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+DQogICAgICA8L3NhbWw6QXV0aG5Db250ZXh0Pg0KICAgIDwvc2FtbDpBdXRoblN0YXRlbWVudD4NCiAgICA8c2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogICAgICA8c2FtbDpBdHRyaWJ1dGUgTmFtZT0ibWFpbCIgTmFtZUZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+DQogICAgICAgIDxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPnNvbWVvbmVAZXhhbXBsZS5jb208L3NhbWw6QXR0cmlidXRlVmFsdWU+DQogICAgICA8L3NhbWw6QXR0cmlidXRlPg0KICAgIDwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogIDwvc2FtbDpBc3NlcnRpb24+DQo8L3NhbWxwOlJlc3BvbnNlPg== diff --git a/ruby-saml-custom/test/responses/invalids/no_subjectconfirmation_method.xml.base64 b/ruby-saml-custom/test/responses/invalids/no_subjectconfirmation_method.xml.base64 new file mode 100644 index 0000000..f1b3561 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/no_subjectconfirmation_method.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeDg0MzIyNzdmLTdmNDYtZjRlMi1kZGExLThhZTU4ZTk1NjYwZSIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTEtMDYtMTdUMTQ6NTQ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tMTdUMTQ6NTQ6MDdaIiBTZXNzaW9uTm90T25PckFmdGVyPSIyMDIxLTA2LTE3VDIyOjU0OjE0WiIgU2Vzc2lvbkluZGV4PSJfNTFiZTM3OTY1ZmViNTU3OWQ4MDMxNDEwNzY5MzZkYzJlOWQxZDk4ZWJmIj4NCiAgICAgIDxzYW1sOkF1dGhuQ29udGV4dD4NCiAgICAgICAgPHNhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+dXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFjOmNsYXNzZXM6UGFzc3dvcmQ8L3NhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+DQogICAgICA8L3NhbWw6QXV0aG5Db250ZXh0Pg0KICAgIDwvc2FtbDpBdXRoblN0YXRlbWVudD4NCiAgICA8c2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogICAgICA8c2FtbDpBdHRyaWJ1dGUgTmFtZT0ibWFpbCIgTmFtZUZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+DQogICAgICAgIDxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPnNvbWVvbmVAZXhhbXBsZS5jb208L3NhbWw6QXR0cmlidXRlVmFsdWU+DQogICAgICA8L3NhbWw6QXR0cmlidXRlPg0KICAgIDwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogIDwvc2FtbDpBc3NlcnRpb24+DQo8L3NhbWxwOlJlc3BvbnNlPg== \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/response_invalid_signed_element.xml.base64 b/ruby-saml-custom/test/responses/invalids/response_invalid_signed_element.xml.base64 new file mode 100644 index 0000000..e10fb88 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/response_invalid_signed_element.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIHhtb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uIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj51c2VyPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPmFkbWluPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD48L3NhbWw6QXNzZXJ0aW9uPjwvc2FtbHA6UmVzcG9uc2U+ \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/response_with_concealed_signed_assertion.xml b/ruby-saml-custom/test/responses/invalids/response_with_concealed_signed_assertion.xml new file mode 100644 index 0000000..62c152a --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/response_with_concealed_signed_assertion.xml @@ -0,0 +1,51 @@ + + + idp.example.com + + + + + idp.myexample.org + + + FA0AbR4w9oYdx7MFjERARVJAHps=GDH5jhCNX9PFxW+71SOJPyusAOwzECwmd57NDhvA/VKWHnV3PpvpNkOLyamoBNdZ4qxponnobg2zneLESrFnLJdJ1cgs51YvtBJTxKoA7oZMMNKReZFST8g7pDdrBC82n5rTdzxclaJkpwz1yjcho3K3TjxK+gU1svVrEKMUwyo= +MIICGzCCAYQCCQCNNcQXom32VDANBgkqhkiG9w0BAQUFADBSMQswCQYDVQQGEwJVUzELMAkGA1UECBMCSU4xFTATBgNVBAcTDEluZGlhbmFwb2xpczERMA8GA1UEChMIT25lTG9naW4xDDAKBgNVBAsTA0VuZzAeFw0xNDA0MjMxODQxMDFaFw0xNTA0MjMxODQxMDFaMFIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJJTjEVMBMGA1UEBxMMSW5kaWFuYXBvbGlzMREwDwYDVQQKEwhPbmVMb2dpbjEMMAoGA1UECxMDRW5nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDo6m+QZvYQ/xL0ElLgupK1QDcYL4f5PckwsNgS9pUvV7fzTqCHk8ThLxTk42MQ2McJsOeUJVP728KhymjFCqxgP4VuwRk9rpAl0+mhy6MPdyjyA6G14jrDWS65ysLchK4t/vwpEDz0SQlEoG1kMzllSm7zZS3XregA7DjNaUYQqwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBALM2vGCiQ/vm+a6v40+VX2zdqHA2Q/1vF1ibQzJ54MJCOVWvs+vQXfZFhdm0OPM2IrDU7oqvKPqP6xOAeJK6H0yP7M4YL3fatSvIYmmfyXC9kt3Svz/NyrHzPhUnJ0ye/sUSXxnzQxwcm/9PwAqrQaA3QpQkH57ybF/OoryPe+2h + + victim@example.com + + + + + + + example.com + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport + + + + + + idp.myexample.org + + someone@example.org + + + + + + + example.com + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport + + + + + diff --git a/ruby-saml-custom/test/responses/invalids/response_with_doubled_signed_assertion.xml b/ruby-saml-custom/test/responses/invalids/response_with_doubled_signed_assertion.xml new file mode 100644 index 0000000..f03e068 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/response_with_doubled_signed_assertion.xml @@ -0,0 +1,49 @@ + + + idp.example.com + + + + + idp.myexample.org + + + FA0AbR4w9oYdx7MFjERARVJAHps=GDH5jhCNX9PFxW+71SOJPyusAOwzECwmd57NDhvA/VKWHnV3PpvpNkOLyamoBNdZ4qxponnobg2zneLESrFnLJdJ1cgs51YvtBJTxKoA7oZMMNKReZFST8g7pDdrBC82n5rTdzxclaJkpwz1yjcho3K3TjxK+gU1svVrEKMUwyo= +MIICGzCCAYQCCQCNNcQXom32VDANBgkqhkiG9w0BAQUFADBSMQswCQYDVQQGEwJVUzELMAkGA1UECBMCSU4xFTATBgNVBAcTDEluZGlhbmFwb2xpczERMA8GA1UEChMIT25lTG9naW4xDDAKBgNVBAsTA0VuZzAeFw0xNDA0MjMxODQxMDFaFw0xNTA0MjMxODQxMDFaMFIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJJTjEVMBMGA1UEBxMMSW5kaWFuYXBvbGlzMREwDwYDVQQKEwhPbmVMb2dpbjEMMAoGA1UECxMDRW5nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDo6m+QZvYQ/xL0ElLgupK1QDcYL4f5PckwsNgS9pUvV7fzTqCHk8ThLxTk42MQ2McJsOeUJVP728KhymjFCqxgP4VuwRk9rpAl0+mhy6MPdyjyA6G14jrDWS65ysLchK4t/vwpEDz0SQlEoG1kMzllSm7zZS3XregA7DjNaUYQqwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBALM2vGCiQ/vm+a6v40+VX2zdqHA2Q/1vF1ibQzJ54MJCOVWvs+vQXfZFhdm0OPM2IrDU7oqvKPqP6xOAeJK6H0yP7M4YL3fatSvIYmmfyXC9kt3Svz/NyrHzPhUnJ0ye/sUSXxnzQxwcm/9PwAqrQaA3QpQkH57ybF/OoryPe+2h + + victim@example.com + + + + + + + example.com + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport + + + + + idp.myexample.org + + someone@example.org + + + + + + + example.com + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport + + + + diff --git a/ruby-saml-custom/test/responses/invalids/signature_wrapping_attack.xml.base64 b/ruby-saml-custom/test/responses/invalids/signature_wrapping_attack.xml.base64 new file mode 100644 index 0000000..dc2c9ca --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/signature_wrapping_attack.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpT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cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj5oYWNrZXI8L3NhbWw6QXR0cmlidXRlVmFsdWU+PC9zYW1sOkF0dHJpYnV0ZT48c2FtbDpBdHRyaWJ1dGUgTmFtZT0ic24iIE5hbWVGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphdHRybmFtZS1mb3JtYXQ6YmFzaWMiPjxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPndhYTI8L3NhbWw6QXR0cmlidXRlVmFsdWU+PC9zYW1sOkF0dHJpYnV0ZT48c2FtbDpBdHRyaWJ1dGUgTmFtZT0iZWR1UGVyc29uQWZmaWxpYXRpb24iIE5hbWVGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphdHRybmFtZS1mb3JtYXQ6YmFzaWMiPjxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPnVzZXI8L3NhbWw6QXR0cmlidXRlVmFsdWU+PHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+YWRtaW48L3NhbWw6QXR0cmlidXRlVmFsdWU+PC9zYW1sOkF0dHJpYnV0ZT48L3NhbWw6QXR0cmlidXRlU3RhdGVtZW50Pjwvc2FtbDpBc3NlcnRpb24+PC9zYW1scDpSZXNwb25zZT4= \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/invalids/status_code_responder.xml.base64 b/ruby-saml-custom/test/responses/invalids/status_code_responder.xml.base64 new file mode 100644 index 0000000..56996dd --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/status_code_responder.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlDQp4bWxuczpzYW1scD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3RvY29sIg0KQ29uc2VudD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmNvbnNlbnQ6dW5zcGVjaWZpZWQiIERlc3RpbmF0aW9uPSINCmh0dHBzOi8vZXhhbXBsZS5jb20vb3BlbnNzby9Db25zdW1lci9tZXRhQWxpYXMvc3AiDQpJRD0iX2E3MWJiZjIyLTkwYTktNGE5Ni1iOWNlLWVhNWJhMzBhZWU2NSINCkluUmVzcG9uc2VUbz0iczIxMjAzYjI3ZDM4ZDBhMDdlYTJjNzEzZTdhMDA0NWNmOGQxZTMyODExIg0KSXNzdWVJbnN0YW50PSIyMDExLTA4LTI0VDE2OjM2OjMwLjM2NVoiIFZlcnNpb249IjIuMCI+PElzc3Vlcg0KeG1sbnM9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iPg0KaHR0cDovL2lkcC5leGFtcGxlLmNvbS9hZGZzL3NlcnZpY2VzL3RydXN0PC9Jc3N1ZXI+PHNhbWxwOlN0YXR1cz48c2FtbHA6U3RhdHVzQ29kZQ0KVmFsdWU9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpzdGF0dXM6UmVzcG9uZGVyIi8+PC9zYW1scDpTdGF0dXM+PC9zYW1scDpSZXNwb25zZT4NCg== diff --git a/ruby-saml-custom/test/responses/invalids/status_code_responer_and_msg.xml.base64 b/ruby-saml-custom/test/responses/invalids/status_code_responer_and_msg.xml.base64 new file mode 100644 index 0000000..d2697a6 --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/status_code_responer_and_msg.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlDQp4bWxuczpzYW1scD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3RvY29sIg0KQ29uc2VudD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmNvbnNlbnQ6dW5zcGVjaWZpZWQiIERlc3RpbmF0aW9uPSINCmh0dHBzOi8vZXhhbXBsZS5jb20vb3BlbnNzby9Db25zdW1lci9tZXRhQWxpYXMvc3AiDQpJRD0iX2E3MWJiZjIyLTkwYTktNGE5Ni1iOWNlLWVhNWJhMzBhZWU2NSINCkluUmVzcG9uc2VUbz0iczIxMjAzYjI3ZDM4ZDBhMDdlYTJjNzEzZTdhMDA0NWNmOGQxZTMyODExIg0KSXNzdWVJbnN0YW50PSIyMDExLTA4LTI0VDE2OjM2OjMwLjM2NVoiIFZlcnNpb249IjIuMCI+PElzc3Vlcg0KeG1sbnM9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iPg0KaHR0cDovL2lkcC5leGFtcGxlLmNvbS9hZGZzL3NlcnZpY2VzL3RydXN0PC9Jc3N1ZXI+PHNhbWxwOlN0YXR1cz48c2FtbHA6U3RhdHVzQ29kZSBWYWx1ZT0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnN0YXR1czpSZXNwb25kZXIiLz48c2FtbHA6U3RhdHVzTWVzc2FnZT5zb21ldGhpbmdfaXNfd3Jvbmc8L3NhbWxwOlN0YXR1c01lc3NhZ2U+PC9zYW1scDpTdGF0dXM+PC9zYW1scDpSZXNwb25zZT4= diff --git a/ruby-saml-custom/test/responses/invalids/wrong_spnamequalifier.xml.base64 b/ruby-saml-custom/test/responses/invalids/wrong_spnamequalifier.xml.base64 new file mode 100644 index 0000000..48e1fbf --- /dev/null +++ b/ruby-saml-custom/test/responses/invalids/wrong_spnamequalifier.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9InBmeDEzN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RlPjxzYW1sOkF0dHJpYnV0ZSBOYW1lPSJjbiIgTmFtZUZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+PHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+U2l4dG8zPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PHNhbWw6QXR0cmlidXRlIE5hbWU9InNuIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj5NYXJ0aW4yPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PHNhbWw6QXR0cmlidXRlIE5hbWU9ImVkdVBlcnNvbkFmZmlsaWF0aW9uIiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OmJhc2ljIj48c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj51c2VyPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPmFkbWluPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD48L3NhbWw6QXNzZXJ0aW9uPjwvc2FtbHA6UmVzcG9uc2U+ \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/no_signature_ns.xml b/ruby-saml-custom/test/responses/no_signature_ns.xml new file mode 100644 index 0000000..f336ac1 --- /dev/null +++ b/ruby-saml-custom/test/responses/no_signature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RFLS0tLS0K + + + + + someone@example.org + + + + + + + example.com + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport + + + + diff --git a/ruby-saml-custom/test/responses/open_saml_response.xml b/ruby-saml-custom/test/responses/open_saml_response.xml new file mode 100644 index 0000000..67dea72 --- /dev/null +++ b/ruby-saml-custom/test/responses/open_saml_response.xml @@ -0,0 +1,56 @@ + + + https://idm.orademo.com + + + + + + + + + + + + + uHuSry39P16Yh7srS32xESmj4Lw= + + + fdghdfggfd= + + + dfghjkl + + + + + + + + https://idm.orademo.com + + someone@example.org + + + + + + + hello.com + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport + + + + + Someone + + + Special + + + + diff --git a/ruby-saml-custom/test/responses/response_assertion_wrapped.xml.base64 b/ruby-saml-custom/test/responses/response_assertion_wrapped.xml.base64 new file mode 100644 index 0000000..a185427 --- /dev/null +++ b/ruby-saml-custom/test/responses/response_assertion_wrapped.xml.base64 @@ -0,0 +1,93 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0 +YzpTQU1MOjIuMDphc3NlcnRpb24iIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6 +bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIElEPSJHT1NBTUxSMTMwNzE1 +NDEyMjM0MDkiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDExLTA2 +LTA0VDAyOjIyOjAyWiIgRGVzdGluYXRpb249InJlY2lwaWVudCI+PHNhbWw6 +SXNzdWVyPmh0dHBzOi8vYXBwLm9uZWxvZ2luLmNvbS9zYW1sMjwvc2FtbDpJ +c3N1ZXI+PHNhbWxwOlN0YXR1cz48c2FtbHA6U3RhdHVzQ29kZSBWYWx1ZT0i +dXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnN0YXR1czpTdWNjZXNzIi8+ +PC9zYW1scDpTdGF0dXM+PHN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jbTpiZWFyZXIiPjxzYW1sOlN1YmplY3RDb25maXJt +YXRpb25EYXRhIE5vdE9uT3JBZnRlcj0iMjAxMS0wNi0wNFQwMjoyNzowMloi +IFJlY2lwaWVudD0icmVjaXBpZW50Ii8+PC9zYW1sOlN1YmplY3RDb25maXJt +YXRpb24+PC9zYW1sOlN1YmplY3Q+PHNhbWw6Q29uZGl0aW9ucyBOb3RCZWZv +cmU9IjIwMTEtMDYtMDRUMDI6MTc6MDJaIiBOb3RPbk9yQWZ0ZXI9IjIwMTEt +MDYtMDRUMDI6Mjc6MDJaIj48c2FtbDpBdWRpZW5jZVJlc3RyaWN0aW9uPjxz +YW1sOkF1ZGllbmNlPmF1ZGllbmNlPC9zYW1sOkF1ZGllbmNlPjwvc2FtbDpB +dWRpZW5jZVJlc3RyaWN0aW9uPjwvc2FtbDpDb25kaXRpb25zPjxzYW1sOkF1 +dGhuU3RhdGVtZW50IEF1dGhuSW5zdGFudD0iMjAxMS0wNi0wNFQwMjoyMjow +MloiIFNlc3Npb25Ob3RPbk9yQWZ0ZXI9IjIwMTEtMDYtMDVUMDI6MjI6MDJa +IiBTZXNzaW9uSW5kZXg9Il8xNmY1NzBmYmMwMzE1MDA3YTAzNTVkZmVhNmIz +YzQ2YyI+PHNhbWw6QXV0aG5Db250ZXh0PjxzYW1sOkF1dGhuQ29udGV4dENs +YXNzUmVmPnVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphYzpjbGFzc2Vz +OlBhc3N3b3JkUHJvdGVjdGVkVHJhbnNwb3J0PC9zYW1sOkF1dGhuQ29udGV4 +dENsYXNzUmVmPjwvc2FtbDpBdXRobkNvbnRleHQ+PC9zYW1sOkF1dGhuU3Rh +dGVtZW50Pjwvc2FtbDpBc3NlcnRpb24+PC9zYW1scDpSZXNwb25zZT4= \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/response_audience_self_closed_tag.xml.base64 b/ruby-saml-custom/test/responses/response_audience_self_closed_tag.xml.base64 new file mode 100644 index 0000000..1bac221 --- /dev/null +++ b/ruby-saml-custom/test/responses/response_audience_self_closed_tag.xml.base64 @@ -0,0 +1 @@ +tVdbc7JIE77fqv0Plu9lynBUhEpSi6DGAwqCp9xscRgQ5SQDgvz6b8BDTEyy+27Vd6U03T3P8/T09PAEdd+LuBmAURhAUMt9L4BcZXyup3HAhTp0IRfoPoBcYnIqL4058hHnojhMQjP06jchP0foEII4ccOgXhuIz/XIzi3atHSGajVaeoto4CzVbjC4CRpUG2+DtsnaTQvUawsQQxT1XEdJUCiEKRgEMNGDBJlwAgW2GgSjETTXpDmCfqvXRAATN9CTKmqTJBGHYTBJbfvRDH0MBFYUukECb/7pJnyMNhFKH1yk0MLn+t9NxjANm8EbjEHYDZwgQcNsk0SDaZPoBUEZBtWuv/z5R632VArAVejil/OarhU9glz3Iw9UKz9ht05PFuRU10E40/givAWvgLMse8yoxzB2MBLHcQxnMeRjQdf5dV7xHA+sQWCHVTpBD8LANXXPLSr2Ekg2oVXjPSeM3WTjf5OcwAi8TN4AudkwCTr4VceqJd4XqUD+y3QfsMZQb8CNTpwzlvlmwAYxCExQm88Gz/Vf/3YnVBS1WA+gHcY+/Pj4e6hAcABeGAGrAS/kEMDfS/ilak/YPUbRddCG/C/inYV7T7LQvRS8QCZfazNsO57s11lOE4HdabnxA0ilwXMF4Na5MlwlPz1+2jbXAp8iNLu1c/qddqyZCbbM4dzx5mE4XmbEdtjVZcPrFSvzQY7CjjOcGTE207diRyX94pgdX2eOHUz3vmU/OMkILBXYksJk7so7fGPsRvJq6NjOzmHhwc4cbCVPx1NsnB6T42D+Ng2yV2X3uqaWbkSHKq7mUbpz1ON8uysYeZhNV7sMBjGlHtR0XiSENMefr3Ru8P/5R0lqBI5Xgqsmzop6ol8fhPIkslGnJOBFGgyEfiEI/FoRBEWYTExlFfoUuRD5ScfZ7Tc7t89meIdX5j0eEZUUmAnKWlwoSr+bDRfzojuW+F2fJ+ZdoSMJ6pzOexqvdZzJosObmtj10re+tzH8XmaQeWQ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plmWSgLUIi20Dw77XBuFCFBKQJ1+I8v5S8NA3DLpKvfz4mWNyZumHzDL6ycLYusr4Rao7qe+w3L65ivlR5wSVxUgT8Pn1nUOtbN7netnp9er/Px0TFSMUXVovB4WB/Mz7fr0uUs2EGjq4ueQYodVy9HWIXgXOT6fKx+g7WS5vP2nyNfHL28soKW+E2McP3Zf/AQ== diff --git a/ruby-saml-custom/test/responses/response_double_status_code.xml.base64 b/ruby-saml-custom/test/responses/response_double_status_code.xml.base64 new file mode 100644 index 0000000..07daa39 --- /dev/null +++ b/ruby-saml-custom/test/responses/response_double_status_code.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgSUQ9InBmeGJjODI2YWZkLWU5ZmUtZDNmYi1kODc0LWM0NzAwYzNlZjBjOCIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTQtMDYtMDRUMDI6MjI6MDJaIiBEZXN0aW5hdGlvbj0iaHR0cDovL2FwcC5tdWRhLm5vL3Nzby9jb25zdW1lIiBJblJlc3BvbnNlVG89Il9mYzRhMzRiMC03ZWZiLTAxMmUtY2FhZS03ODJiY2IxM2JiMzgiPjxzYW1sOklzc3Vlcj5odHRwczovL2FwcC5vbmVsb2dpbi5jb20vc2FtbDI8L3NhbWw6SXNzdWVyPjxzYW1scDpTdGF0dXM+PHNhbWxwOlN0YXR1c0NvZGUgVmFsdWU9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpzdGF0dXM6UmVxdWVzdGVyIj4gIDxzYW1scDpTdGF0dXNDb2RlIFZhbHVlPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6c3RhdHVzO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hhbXBsZS5jb20vYXVkaWVuY2U8L3NhbWw6QXVkaWVuY2U+PC9zYW1sOkF1ZGllbmNlUmVzdHJpY3Rpb24+PC9zYW1sOkNvbmRpdGlvbnM+PHNhbWw6QXV0aG5TdGF0ZW1lbnQgQXV0aG5JbnN0YW50PSIyMDE0LTA2LTA0VDAyOjIyOjAyWiIgU2Vzc2lvbk5vdE9uT3JBZnRlcj0iMjA5MC0wNi0wNVQwMjoyMjowMloiIFNlc3Npb25JbmRleD0iXzE2ZjU3MGZiYzAzMTUwMDdhMDM1NWRmZWE2YjNjNDZjIj48c2FtbDpBdXRobkNvbnRleHQ+PHNhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+dXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFjOmNsYXNzZXM6UGFzc3dvcmRQcm90ZWN0ZWRUcmFuc3BvcnQ8L3NhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+PC9zYW1sOkF1dGhuQ29udGV4dD48L3NhbWw6QXV0aG5TdGF0ZW1lbnQ+PC9zYW1sOkFzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg== \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/response_encrypted_attrs.xml.base64 b/ruby-saml-custom/test/responses/response_encrypted_attrs.xml.base64 new file mode 100644 index 0000000..89746a2 --- /dev/null +++ b/ruby-saml-custom/test/responses/response_encrypted_attrs.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgRGVzdGluYXRpb249Imh0dHA6Ly9zdHVmZi5jb20vZW5kcG9pbnRzL2VuZHBvaW50cy9hY3MucGhwIiBJRD0icGZ4ODM2M2M2YTctZ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qWk9Fdk5LRVB0enRHZituNlFiSXF2bmxSTllNST08L3hlbmM6Q2lwaGVyVmFsdWU+DQogICA8L3hlbmM6Q2lwaGVyRGF0YT4NCjwveGVuYzpFbmNyeXB0ZWREYXRhPjwvc2FtbDpFbmNyeXB0ZWRBdHRyaWJ1dGU+PC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgPC9zYW1sOkFzc2VydGlvbj4NCjwvc2FtbHA6UmVzcG9uc2U+ \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/response_encrypted_nameid.xml.base64 b/ruby-saml-custom/test/responses/response_encrypted_nameid.xml.base64 new file mode 100644 index 0000000..2dec37f --- /dev/null +++ b/ruby-saml-custom/test/responses/response_encrypted_nameid.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgSUQ9InBmeDUxOWI1Y2JiLWNiNmYtOTQzNS0xNjNmLWJkMzVjZTM1YzNmMCIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTQtMDYtMDRUMDI6MjI6MDJaIiBEZXN0aW5hdGlvbj0iaHR0cDovL2FwcC5tdWRhLm5vL3Nzby9jb25zdW1lIiBJblJlc3BvbnNlVG89Il9mYzRhMzRiMC03ZWZiLTAxMmUtY2FhZS03ODJiY2IxM2JiMzgiPjxzYW1sOklzc3Vlcj5odHRwczovL2FwcC5vbmVsb2dpbi5jb20vc2FtbDI8L3NhbWw6SXNzdWVyPjxkczpTaWduYXR1cmUgeG1sbnM6ZHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyMiPg0KICA8ZHM6U2lnbmVkSW5mbz48ZHM6Q2Fub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wvc2FtbDpTdWJqZWN0PjxzYW1sOkNvbmRpdGlvbnMgTm90QmVmb3JlPSIyMDExLTA2LTA0VDAyOjE3OjAyWiIgTm90T25PckFmdGVyPSIyMDMwLTA2LTA0VDAyOjI3OjAyWiI+PHNhbWw6QXVkaWVuY2VSZXN0cmljdGlvbj48c2FtbDpBdWRpZW5jZT5odHRwczovL3NvbWVvbmUuZXhhbXBsZS5jb20vYXVkaWVuY2U8L3NhbWw6QXVkaWVuY2U+PC9zYW1sOkF1ZGllbmNlUmVzdHJpY3Rpb24+PC9zYW1sOkNvbmRpdGlvbnM+PHNhbWw6QXV0aG5TdGF0ZW1lbnQgQXV0aG5JbnN0YW50PSIyMDE0LTA2LTA0VDAyOjIyOjAyWiIgU2Vzc2lvbk5vdE9uT3JBZnRlcj0iMjAzMC0wNi0wNVQwMjoyMjowMloiIFNlc3Npb25JbmRleD0iXzE2ZjU3MGZiYzAzMTUwMDdhMDM1NWRmZWE2YjNjNDZjIj48c2FtbDpBdXRobkNvbnRleHQ+PHNhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+dXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFjOmNsYXNzZXM6UGFzc3dvcmRQcm90ZWN0ZWRUcmFuc3BvcnQ8L3NhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+PC9zYW1sOkF1dGhuQ29udGV4dD48L3NhbWw6QXV0aG5TdGF0ZW1lbnQ+PC9zYW1sOkFzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg== \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/response_eval.xml b/ruby-saml-custom/test/responses/response_eval.xml new file mode 100644 index 0000000..9f5ad6f --- /dev/null +++ b/ruby-saml-custom/test/responses/response_eval.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ruby-saml-custom/test/responses/response_no_cert_and_encrypted_attrs.xml b/ruby-saml-custom/test/responses/response_no_cert_and_encrypted_attrs.xml new file mode 100644 index 0000000..9cc3725 --- /dev/null +++ b/ruby-saml-custom/test/responses/response_no_cert_and_encrypted_attrs.xml @@ -0,0 +1,29 @@ +https://hw6dldc.vmwdemo.com/SAAS/API/1.0/GET/metadata/idp.xml + + + + + + + + + +HS49Xqi+JftXvslmp/boT9ixzp8= + + + +gdY9y3GNOgOqBOlEx981yILKAssUG79fXw639MJB3uJjLYokqY+Y5KFFtAU4FGvh/L6Romghx0is +rxukFkfw9coxKOhCoDZiaYPvvuC2qqhTwTAZ0Spvwuffrj3UwztSWbS6JGXtebo4ghKnae4hH5lF +tRawV9HnbLJmhL3cVPSu+7SF3iWov0PZyZczH1P6sZrYeX5X32h3RhXXxMi3kgHGWxaVTQmgTEgu +xN3GD7lnsf+WOAvdPAPgFrJjEGJZDd/MClS/x5ZwLnMZ82r7XHoFhiC47eq3Te+JE9qZvSbIs/om +dpuFSaFKxxdM8C+vHTRUDDaGckqckPc5Y7wlgA== + +akjoshi87+du@gmail.comvmwdemo.socialcast.comurn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransportDemoakjoshi87+du@gmail.comUserIdFfvxdt+YBaLSkWfcxuGqiPDyiQtpklGkJZFW+UoZXMhopZXmW/ekfEAf1VpzIlDlo3xwY2y8Rw +zZwASwjiuHoQSMZQzZ6Ws184f1pWh9un23wgHzYc/jwXF0pXfcVL944SSxxNO4zO+DMJz6Px9rvk +Rpac86uujfBuqXlo684=/+Noi1tNN1HcY+bW/iyBkwOYR4X32pTPzq7EjQO/HB3L0B2RtpsYkvC9750eb6KydbsBSGCyNt3k +grjcI1nUgvvY488NhIo9+PWv3MhAqnljKhDzl6AcfE00Lq3HA1FcTCwrE0VLjUV4NtztK2JVCZwu +ToViUJMlu1SGL8U7uRfsRpbrXoIEv1AwFHjz+XZgwD3nxl79iAcnm3FFX7nIkjUQIPPBWC/U4XJN +u+u5svSoUpIOFqdeNcDQUq5+P5lXT46O5LcULQrEY8xHNGToxOwINMOrU+rCgwyAVbP/SaY9ywYe +bxpESNkHmkjLAI7GBvLRRkTEE88Q6/uV9D1A5X3rT4BMQJ0N7BfgnOJ7IMga2Q9wU9oPuoCsqL9I +bP9IY1vCLcAAEsMR0EgZaInLCiLoXdmDHllSo2fyKQqBGxE+KpZhvVdCOVzLN3+TrW3k/xl/kx6w +AIPFlXd6TRVzmg== diff --git a/ruby-saml-custom/test/responses/response_node_text_attack.xml.base64 b/ruby-saml-custom/test/responses/response_node_text_attack.xml.base64 new file mode 100644 index 0000000..ba9f2f1 --- /dev/null +++ b/ruby-saml-custom/test/responses/response_node_text_attack.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIElEPSJHT1NBTUxSMTI5MDExNzQ1NzE3OTQiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDEwLTExLTE4VDIxOjU3OjM3WiIgRGVzdGluYXRpb249IntyZWNpcGllbnR9Ij4NCiAgPHNhbWxwOlN0YXR1cz4NCiAgICA8c2FtbHA6U3RhdHVzQ29kZSBWYWx1ZT0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnN0YXR1czpTdWNjZXNzIi8+PC9zYW1scDpTdGF0dXM+DQogIDxzYW1sOkFzc2VydGlvbiB4bWxuczp4cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIFZlcnNpb249IjIuMCIgSUQ9InBmeGE0NjU3NGRmLWIzYjAtYTA2YS0yM2M4LTYzNjQxMzE5ODc3MiIgSXNzdWVJbnN0YW50PSIyMDEwLTExLTE4VDIxOjU3OjM3WiI+DQogICAgPHNhbWw6SXNzdWVyPmh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by-saml-custom/test/responses/response_node_text_attack2.xml.base64 b/ruby-saml-custom/test/responses/response_node_text_attack2.xml.base64 new file mode 100644 index 0000000..59d049c --- /dev/null +++ b/ruby-saml-custom/test/responses/response_node_text_attack2.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgSUQ9InBmeGJjODI2YWZkLWU5ZmUtZDNmYi1kODc0LWM0NzAwYzNlZjBjOCIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTQtMDYtMDRUMDI6MjI6MDJaIiBEZXN0aW5hdGlvbj0iaHR0cDovL2FwcC5tdWRhLm5vL3Nzby9jb25zdW1lIiBJblJlc3BvbnNlVG89Il9mYzRhMzRiMC03ZWZiLTAxMmUtY2FhZS03ODJiY2IxM2JiMzgiPjxzYW1sOklzc3Vlcj5odHRwczovL2FwcC5vbmVsb2dpbi5jb20vc2FtbDI8L3NhbWw6SXNzdWVyPjxkczpTaWduYXR1cmUgeG1sbnM6ZHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyMiPg0KICA8ZHM6U2lnbmVkSW5mbz48ZHM6Q2Fub25pY2FsaXphdGlvbk1ldGhvZCBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvMTAveG1sLWV4Yy1jMTRuIyIvPg0KICAgIDxkczpTaWduYXR1cmVNZXRob2QgQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjcnNhLXNoYTEiLz4NCiAgPGRzOlJlZmVyZW5jZSBVUkk9IiNwZnhiYzgyNmFmZC1lOWZlLWQzZmItZDg3NC1jNDcwMGM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LTA0VDAyOjIyOjAyWiIgU2Vzc2lvbk5vdE9uT3JBZnRlcj0iMjAzMC0wNi0wNVQwMjoyMjowMloiIFNlc3Npb25JbmRleD0iXzE2ZjU3MGZiYzAzMTUwMDdhMDM1NWRmZWE2YjNjNDZjIj48c2FtbDpBdXRobkNvbnRleHQ+PHNhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+dXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFjOmNsYXNzZXM6UGFzc3dvcmRQcm90ZWN0ZWRUcmFuc3BvcnQ8L3NhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+PC9zYW1sOkF1dGhuQ29udGV4dD48L3NhbWw6QXV0aG5TdGF0ZW1lbnQ+PC9zYW1sOkFzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg== \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/response_node_text_attack3.xml.base64 b/ruby-saml-custom/test/responses/response_node_text_attack3.xml.base64 new file mode 100644 index 0000000..3ecce91 --- /dev/null +++ b/ruby-saml-custom/test/responses/response_node_text_attack3.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgSUQ9InBmeGJjODI2YWZkLWU5ZmUtZDNmYi1kODc0LWM0NzAwYzNlZjBjOCIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTQtMDYtMDRUMDI6MjI6MDJaIiBEZXN0aW5hdGlvbj0iaHR0cDovL2FwcC5tdWRhLm5vL3Nzby9jb25zdW1lIiBJblJlc3BvbnNlVG89Il9mYzRhMzRiMC03ZWZiLTAxMmUtY2FhZS03ODJiY2IxM2JiMzgiPjxzYW1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tMDYtMDRUMDI6Mjc6MDJaIiBSZWNpcGllbnQ9InJlY2lwaWVudCIvPjwvc2FtbDpTdWJqZWN0Q29uZmlybWF0aW9uPjwvc2FtbDpTdWJqZWN0PjxzYW1sOkNvbmRpdGlvbnMgTm90QmVmb3JlPSIyMDExLTA2LTA0VDAyOjE3OjAyWiIgTm90T25PckFmdGVyPSIyMDMwLTA2LTA0VDAyOjI3OjAyWiI+PHNhbWw6QXVkaWVuY2VSZXN0cmljdGlvbj48c2FtbDpBdWRpZW5jZT5odHRwczovL3NvbWVvbmUuZXhhbXBsZS5jb20vYXVkaWVuY2U8L3NhbWw6QXVkaWVuY2U+PC9zYW1sOkF1ZGllbmNlUmVzdHJpY3Rpb24+PC9zYW1sOkNvbmRpdGlvbnM+PHNhbWw6QXV0aG5TdGF0ZW1lbnQgQXV0aG5JbnN0YW50PSIyMDE0LTA2LTA0VDAyOjIyOjAyWiIgU2Vzc2lvbk5vdE9uT3JBZnRlcj0iMjAzMC0wNi0wNVQwMjoyMjowMloiIFNlc3Npb25JbmRleD0iXzE2ZjU3MGZiYzAzMTUwMDdhMDM1NWRmZWE2YjNjNDZjIj48c2FtbDpBdXRobkNvbnRleHQ+PHNhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+dXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFjOmNsYXNzZXM6UGFzc3dvcmRQcm90ZWN0ZWRUcmFuc3BvcnQ8L3NhbWw6QXV0aG5Db250ZXh0Q2xhc3NSZWY+PC9zYW1sOkF1dGhuQ29udGV4dD48L3NhbWw6QXV0aG5TdGF0ZW1lbnQ+PC9zYW1sOkFzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg== \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/response_unsigned_xml_base64 b/ruby-saml-custom/test/responses/response_unsigned_xml_base64 new file mode 100644 index 0000000..ab02e39 --- /dev/null +++ b/ruby-saml-custom/test/responses/response_unsigned_xml_base64 @@ -0,0 +1 @@ +rVXbbtowGL6ftHeIcg+JnSNWS8eKJiH1tFJV024mx/5TPCVxFDuDd9vFHmmvMDsESqGwaeoNkJ////IdfPj989fZxaosnB/QKCGrcxcNfdeBikkuqqdzt9X5IHUvxu/fnSlaFjW5B1XLSoFjpipFuqJpayoiqRKKVLQERTQj88n1FcFDn9SN1JLJwt0ZOT1BlYJGGzquM5ueu99wHPk4zMLYxzmLU+ajMGIxjFiUIJ7mMUYjiFkOYKg/boRgK2SmVAuzSmlaaVPyERr48QAFDygmPiY4+uo6U1BaVFR3Uwuta+J5hWS0WEilvXpRDyxjjxnVbQlDUzC41caHB2kIBjgMMU1ZwFFGU6AoiJlrPHOczjXS0WjGFlwZdMFrT4myLqBDth+4K5agKaea2pecebujW6yazDXVreoqe7VLycF5pEULp/1VXTeZt4yBUq7jreG9A/w1+8kmjj7AlRJbo5bL5XAZDGXz5GHfR96X66s5W0BJB6JznYG7nfr7UJ93HGQ+BQoMZ1kWRmmeIBQFOUapzxLMwmAUIB6wEf6fvHeNe6NgNmjzNvsOTPe1TfXG+D+bOvM7++NzSwuRC2jO3c3Kcp1PsimpPp4ZGqKuIvgg71qJ8UoUE84bm9+4kVJ/gBW1xIdMlj3D9Yv32PQcL2WVCwtlY70GvZD89JphJcmANtC4W8ATkFPjlXMj9W1120xybeXuhZGsN989MFELsGm94dbrV3RH0TvGcROd90p2a2GmmwvbqqyWj2DMhwMhiERWyD+I3Uti0nIjnIGRoxvBdigd9ow3XvRst/U9mccx+4ZnSS+UTlq9qOzGh9Jk4XSPr24jTMKEBIERPDdLz+Ac0R0++P72hO1bZxWHlYksGo1CyrIIp0mKkjT3cRbHEI8CDhkEoZ/gKBnFjGN2aJnhZSRoWOnxvlPPf10W5ga5h3x88pJhhNk+U74zX0vZ8K2Jr0AdGL3D5IXDL63cOVmfz1F7m3ovr9PxHw== \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/response_with_ampersands.xml b/ruby-saml-custom/test/responses/response_with_ampersands.xml new file mode 100644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dHJpYnV0ZVN0YXRlbWVu +dD4KICA8L3NhbWw6QXNzZXJ0aW9uPgo8L1Jlc3BvbnNlPgo= diff --git a/ruby-saml-custom/test/responses/response_with_ampersands.xml.base64 b/ruby-saml-custom/test/responses/response_with_ampersands.xml.base64 new file mode 100644 index 0000000..a185427 --- /dev/null +++ b/ruby-saml-custom/test/responses/response_with_ampersands.xml.base64 @@ -0,0 +1,93 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0 +YzpTQU1MOjIuMDphc3NlcnRpb24iIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6 +bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIElEPSJHT1NBTUxSMTMwNzE1 +NDEyMjM0MDkiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDExLTA2 +LTA0VDAyOjIyOjAyWiIgRGVzdGluYXRpb249InJlY2lwaWVudCI+PHNhbWw6 +SXNzdWVyPmh0dHBzOi8vYXBwLm9uZWxvZ2luLmNvbS9zYW1sMjwvc2FtbDpJ +c3N1ZXI+PHNhbWxwOlN0YXR1cz48c2FtbHA6U3RhdHVzQ29kZSBWYWx1ZT0i +dXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnN0YXR1czpTdWNjZXNzIi8+ +PC9zYW1scDpTdGF0dXM+PHNhbWw6QXNzZXJ0aW9uIHhtbG5zOnhzPSJodHRw +Oi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM6eHNpPSJodHRw +Oi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIgVmVyc2lv +bj0iMi4wIiBJRD0iZmFrZV9hc3NlcnRpb24iIElzc3VlSW5zdGFudD0iMjAx +MS0wNi0wNFQwMjoyMjowMloiPjxzYW1sOklzc3Vlcj5odHRwczovL2FwcC5v +bmVsb2dpbi5jb20vc2FtbDI8L3NhbWw6SX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pBdWRpZW5jZVJlc3RyaWN0aW9uPjxz +YW1sOkF1ZGllbmNlPmF1ZGllbmNlPC9zYW1sOkF1ZGllbmNlPjwvc2FtbDpB +dWRpZW5jZVJlc3RyaWN0aW9uPjwvc2FtbDpDb25kaXRpb25zPjxzYW1sOkF1 +dGhuU3RhdGVtZW50IEF1dGhuSW5zdGFudD0iMjAxMS0wNi0wNFQwMjoyMjow +MloiIFNlc3Npb25Ob3RPbk9yQWZ0ZXI9IjIwMTEtMDYtMDVUMDI6MjI6MDJa +IiBTZXNzaW9uSW5kZXg9Il8xNmY1NzBmYmMwMzE1MDA3YTAzNTVkZmVhNmIz +YzQ2YyI+PHNhbWw6QXV0aG5Db250ZXh0PjxzYW1sOkF1dGhuQ29udGV4dENs +YXNzUmVmPnVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphYzpjbGFzc2Vz +OlBhc3N3b3JkUHJvdGVjdGVkVHJhbnNwb3J0PC9zYW1sOkF1dGhuQ29udGV4 +dENsYXNzUmVmPjwvc2FtbDpBdXRobkNvbnRleHQ+PC9zYW1sOkF1dGhuU3Rh +dGVtZW50Pjwvc2FtbDpBc3NlcnRpb24+PC9zYW1scDpSZXNwb25zZT4= \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/response_with_ds_namespace_at_the_root.xml.base64 b/ruby-saml-custom/test/responses/response_with_ds_namespace_at_the_root.xml.base64 new file mode 100644 index 0000000..48893cd --- /dev/null +++ b/ruby-saml-custom/test/responses/response_with_ds_namespace_at_the_root.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiDQp4bWxuczpkcz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnIyIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9Il84Z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FsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+dGVzdEBleGFtcGxlLmNvbTwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT4NCiAgICAgIDwvc2FtbDpBdHRyaWJ1dGU+DQogICAgICA8c2FtbDpBdHRyaWJ1dGUgTmFtZT0iZWR1UGVyc29uQWZmaWxpYXRpb24iIE5hbWVGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphdHRybmFtZS1mb3JtYXQ6YmFzaWMiPg0KICAgICAgICA8c2FtbDpBdHRyaWJ1dGVWYWx1ZSB4c2k6dHlwZT0ieHM6c3RyaW5nIj51c2Vyczwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT4NCiAgICAgICAgPHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+ZXhhbXBsZXJvbGUxPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPg0KICAgICAgPC9zYW1sOkF0dHJpYnV0ZT4NCiAgICA8L3NhbWw6QXR0cmlidXRlU3RhdGVtZW50Pg0KICA8L3NhbWw6QXNzZXJ0aW9uPg0KPC9zYW1scDpSZXNwb25zZT4= \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/response_with_multiple_attribute_statements.xml b/ruby-saml-custom/test/responses/response_with_multiple_attribute_statements.xml new file mode 100644 index 0000000..2ef9782 --- /dev/null +++ b/ruby-saml-custom/test/responses/response_with_multiple_attribute_statements.xml @@ -0,0 +1,72 @@ + + + + + https://app.onelogin.com/saml/metadata/13590 + + + + + + + + + + + pJQ7MS/ek4KRRWGmv/H43ReHYMs= + + + yiveKcPdDpuDNj6shrQ3ABwr/cA3CryD2phG/xLZszKWxU5/mlaKt8ewbZOdKKvtOs2pHBy5Dua3k94AF+zxGyel5gOowmoyXJr+AOr+kPO0vli1V8o3hPPUZwRgSX6Q9pS1CqQghKiEasRyylqqJUaPYzmOzOE8/XlMkwiWmO0= + + + MIIBrTCCAaGgAwIBAgIBATADBgEAMGcxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRUwEwYDVQQHDAxTYW50YSBNb25pY2ExETAPBgNVBAoMCE9uZUxvZ2luMRkwFwYDVQQDDBBhcHAub25lbG9naW4uY29tMB4XDTEwMDMwOTA5NTg0NVoXDTE1MDMwOTA5NTg0NVowZzELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFTATBgNVBAcMDFNhbnRhIE1vbmljYTERMA8GA1UECgwIT25lTG9naW4xGTAXBgNVBAMMEGFwcC5vbmVsb2dpbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOjSu1fjPy8d5w4QyL1+zd4hIw1Mkkff4WY/TLG8OZkU5YTSWmmHPD5kvYH5uoXS/6qQ81qXpR2wV8CTowZJULg09ddRdRn8Qsqj1FyOC5slE3y2bZ2oFua72of/49fpujnFT6KnQ61CBMqlDoTQqOT62vGJ8nP6MZWvA6sxqud5AgMBAAEwAwYBAAMBAA== + + + + + support@onelogin.com + + + + + + {audience} + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:Password + + + + + smith + + + value1 + value2 + + + role1 + + + + + bob + + + role2 + role3 + + + + + + + valuePresent + + + + + + diff --git a/ruby-saml-custom/test/responses/response_with_multiple_attribute_values.xml b/ruby-saml-custom/test/responses/response_with_multiple_attribute_values.xml new file mode 100644 index 0000000..1821117 --- /dev/null +++ b/ruby-saml-custom/test/responses/response_with_multiple_attribute_values.xml @@ -0,0 +1,67 @@ + + + + + https://app.onelogin.com/saml/metadata/13590 + + + + + + + + + + + pJQ7MS/ek4KRRWGmv/H43ReHYMs= + + + yiveKcPdDpuDNj6shrQ3ABwr/cA3CryD2phG/xLZszKWxU5/mlaKt8ewbZOdKKvtOs2pHBy5Dua3k94AF+zxGyel5gOowmoyXJr+AOr+kPO0vli1V8o3hPPUZwRgSX6Q9pS1CqQghKiEasRyylqqJUaPYzmOzOE8/XlMkwiWmO0= + + + MIIBrTCCAaGgAwIBAgIBATADBgEAMGcxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRUwEwYDVQQHDAxTYW50YSBNb25pY2ExETAPBgNVBAoMCE9uZUxvZ2luMRkwFwYDVQQDDBBhcHAub25lbG9naW4uY29tMB4XDTEwMDMwOTA5NTg0NVoXDTE1MDMwOTA5NTg0NVowZzELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFTATBgNVBAcMDFNhbnRhIE1vbmljYTERMA8GA1UECgwIT25lTG9naW4xGTAXBgNVBAMMEGFwcC5vbmVsb2dpbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOjSu1fjPy8d5w4QyL1+zd4hIw1Mkkff4WY/TLG8OZkU5YTSWmmHPD5kvYH5uoXS/6qQ81qXpR2wV8CTowZJULg09ddRdRn8Qsqj1FyOC5slE3y2bZ2oFua72of/49fpujnFT6KnQ61CBMqlDoTQqOT62vGJ8nP6MZWvA6sxqud5AgMBAAEwAwYBAAMBAA== + + + + + support@onelogin.com + + + + + + {audience} + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:Password + + + + + demo + + + value1 + value2 + + + role1 + + + role2 + role3 + + + + + + + valuePresent + + + + + + diff --git a/ruby-saml-custom/test/responses/response_with_retrieval_method.xml b/ruby-saml-custom/test/responses/response_with_retrieval_method.xml new file mode 100644 index 0000000..d56cac5 --- /dev/null +++ b/ruby-saml-custom/test/responses/response_with_retrieval_method.xml @@ -0,0 +1,26 @@ +http://www.okta.com/exk4jkh2xxJIrTmGP0x748q4xnELjn82APp25kO4+wAdOCLN3BdNvZP7IGP2yW8=IisXGT9N0ewlZfvkrfNqqhXHnFkfXG8Z9zIybYIBrJ2WtkBh2gJiEmLGFwnaMyJmDhvrk42jlied6UrxpbZK9jwugJoVsj1CFJ7VHYkqX21yYXs0fwW7xKUvYyMDD0BS6FN96mdM8PD4RUNoxh6UymRs/akwPXCNYZqur2Sz/imEn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q9aIVF9LUn0JMkTFnTaLSq749P76XBmiZRuD1OZOlUYt1vXAviiQ6+6fgIt7tpfDl8MxVPoMAV53c7mhIgxHSalONunVlKVnk0P2XaGHKK2EZloXK408= diff --git a/ruby-saml-custom/test/responses/response_with_saml2_namespace.xml.base64 b/ruby-saml-custom/test/responses/response_with_saml2_namespace.xml.base64 new file mode 100644 index 0000000..c1b54d9 --- /dev/null +++ b/ruby-saml-custom/test/responses/response_with_saml2_namespace.xml.base64 @@ -0,0 +1,102 @@ +PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHNhbWwy +cDpSZXNwb25zZSB4bWxuczpzYW1sMnA9InVybjpvYXNpczpuYW1lczp0YzpT +QU1MOjIuMDpwcm90b2NvbCIKICAgICAgICAgICAgICAgICBEZXN0aW5hdGlv +bj0iaHR0cHM6Ly9leGFtcGxlc2FtbC5mb29ibGUuY29tL2FjY2Vzcy9zYW1s +IiBJRD0iaWQ0MzUwMDE5MDE0NzE3NzIxMDMwODIzNjI0IgogICAgICAgICAg +ICAgICAgIElzc3VlSW5zdGFudD0iMjAxMS0wNi0xNFQxODoyNjowMS41MTVa +IiBWZXJzaW9uPSIyLjAiPgogICAgPHNhbWwyOklzc3VlciB4bWxuczpzYW1s +Mj0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIKICAg +ICAgICAgICAgICAgICAgRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FN +TDoyLjA6bmFtZWlkLWZvcm1hdDplbnRpdHkiPmV4YW1wbGUKICAgIDwvc2Ft +bDI6SXNzdWVyPgogICAgPHNhbWwycDpTdGF0dXMgeG1sbnM6c2FtbDJwPSJ1 +cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiPgogICAgICAg +IDxzYW1sMnA6U3RhdHVzQ29kZSBWYWx1ZT0idXJuOm9hc2lzOm5hbWVzOnRj +OlNBTUw6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cmcv +MjAwMC8wOS94bWxkc2lnI3JzYS1zaGExIgogICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICB4bWxuczpkcz0iaHR0cDovL3d3dy53My5vcmcv +MjAwMC8wOS94bWxkc2lnIyIvPgogICAgICAgICAgICAgICAgPGRzOlJlZmVy +ZW5jZSBVUkk9IiNpZDQzNTAwMTkwMTY3MjM3NzE1ODQ2MDQ3NCIgeG1sbnM6 +ZHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyMiPgogICAg +ICAgICAgICAgICAgICAgIDxkczpUcmFuc2Zvcm1zIHhtbG5zOmRzPSJodHRw +Oi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjIj4KICAgICAgICAgICAg +ICAgICAgICAgICAgPGRzOlRyYW5zZm9ybSBBbGdvcml0aG09Imh0dHA6Ly93 +d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyNlbnZlbG9wZWQtc2lnbmF0dXJl +IgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhtbG5z +OmRzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjIi8+CiAg +ICAgICAgICAgICAgICAgICAgICAgIDxkczpUcmFuc2Zvcm0gQWxnb3JpdGht +PSJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzEwL3htbC1leGMtYzE0biMiCiAg +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeG1sbnM6ZHM9 +Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyMiPgogICAgICAg +ICAgICAgICAgICAgICAgICAgICAgPGVjOkluY2x1c2l2ZU5hbWVzcGFjZXMg +eG1sbnM6ZWM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvMTAveG1sLWV4Yy1j +MTRuIyIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgIFByZWZpeExpc3Q9ImRzIHNhbWwyIi8+CiAgICAgICAg +ICAgICAgICAgICAgICAgIDwvZHM6VHJhbnNmb3JtPgogICAgICAgICAgICAg +ICAgICAgIDwvZHM6VHJhbnNmb3Jtcz4KICAgICAgICAgICAgICAgICAgICA8 +ZHM6RGlnZXN0TWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcv +MjAwMC8wOS94bWxkc2lnI3NoYTEiCiAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICB4bWxuczpkcz0iaHR0cDovL3d3dy53My5vcmcvMjAw +MC8wOS94bWxkc2lnIyIvPgogICAgICAgICAgICAgICAgICAgIDxkczpEaWdl +c3RWYWx1ZSB4bWxuczpkcz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94 +bWxkc2lnIyI+c3R1ZmZpZ0wyeTAybVBXUWxHSU9sbz0KICAgICAgICAgICAg +ICAgICAgICA8L2RzOkRpZ2VzdFZhbHVlPgogICAgICAgICAgICAgICAgPC9k +czpSZWZlcmVuY2U+CiAgICAgICAgICAgIDwvZHM6U2lnbmVkSW5mbz4KICAg +ICAgICAgICAgPGRzOlNpZ25hdHVyZVZhbHVlIHhtbG5zOmRzPSJodHRwOi8v +d3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjIj4KICAgICAgICAgICAgICAg +IE85REFPSWVFazFYbFgyWVZkaHFVemd4amJBam9XQjdnam1VQmtWdlRFb1dO +akYrK2QvcnVFWkFicnVHMXhtblR2VHJ4TXN0S08wRmYKICAgICAgICAgICAg +ICAgIDk0VVAyN05yeWM1OExmZlF0dzhEVXQ0WVNtR3k5OFM3aFVqS28yeTcy +VTdPQVp1TnJoV0JYcTZodEc0ZzBJNDk4MTNkSWROS2xkS2QKICAgICAgICAg +ICAgICAgIGJMSitRMTJIbEM1aUtUWG9pQjQ9CiAgICAgICAgICAgIDwvZHM6 +U2lnbmF0dXJlVmFsdWU+CiAgICAgICAgICAgIDxkczpLZXlJbmZvPgogICAg +ICAgICAgICAgICAgPGRzOlg1MDlEYXRhPgogICAgICAgICAgICAgICAgICAg +IDxkczpYNTA5Q2VydGlmaWNhdGU+CiAgICAgICAgICAgICAgICAgICAgICAg +IHN0dWZmLzZwTW9Mc2NaaDJHTUsrVkE9PQogICAgICAgICAgICAgICAgICAg +IDwvZHM6WDUwOUNlcnRpZmljYXRlPgogICAgICAgICAgICAgICAgPC9kczpY +NTA5RGF0YT4KICAgICAgICAgICAgPC9kczpLZXlJbmZvPgogICAgICAgIDwv +ZHM6U2lnbmF0dXJlPgogICAgICAgIDxzYW1sMjpTdWJqZWN0IHhtbG5zOnNh +bWwyPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXNzZXJ0aW9uIj4K +ICAgICAgICAgICAgPHNhbWwyOk5hbWVJRD5zb21lb25lLmV4YW1wbGVAZ21h +aWwuY29tPC9zYW1sMjpOYW1lSUQ+CiAgICAgICAgICAgIDxzYW1sMjpTdWJq +ZWN0Q29uZmlybWF0aW9uIE1ldGhvZD0idXJuOm9hc2lzOm5hbWVzOnRjOlNB +TUw6Mi4wOmNtOmJlYXJlciI+CiAgICAgICAgICAgICAgICA8c2FtbDI6U3Vi +amVjdENvbmZpcm1hdGlvbkRhdGEgTm90T25PckFmdGVyPSIyMDExLTA2LTE0 +VDE4OjMxOjAxLjUxNloiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICAgICAgICAgICAgUmVjaXBpZW50PSJodHRwczovL2V4YW1wbGVz +YW1sLmZvb2JsZS5jb20vYWNjZXNzL3NhbWwvIi8+CiAgICAgICAgICAgIDwv +c2FtbDI6U3ViamVjdENvbmZpcm1hdGlvbj4KICAgICAgICA8L3NhbWwyOlN1 +YmplY3Q+CiAgICAgICAgPHNhbWwyOkNvbmRpdGlvbnMgTm90QmVmb3JlPSIy +MDExLTA2LTE0VDE4OjIxOjAxLjUxNloiIE5vdE9uT3JBZnRlcj0iMjAxMS0w +Ni0xNFQxODozMTowMS41MTZaIgogICAgICAgICAgICAgICAgICAgICAgICAg +IHhtbG5zOnNhbWwyPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXNz +ZXJ0aW9uIj4KICAgICAgICAgICAgPHNhbWwyOkF1ZGllbmNlUmVzdHJpY3Rp +b24+CiAgICAgICAgICAgICAgICA8c2FtbDI6QXVkaWVuY2U+Zm9vYmxlLmNv +bTwvc2FtbDI6QXVkaWVuY2U+CiAgICAgICAgICAgIDwvc2FtbDI6QXVkaWVu +Y2VSZXN0cmljdGlvbj4KICAgICAgICA8L3NhbWwyOkNvbmRpdGlvbnM+CiAg +ICAgICAgPHNhbWwyOkF1dGhuU3RhdGVtZW50IEF1dGhuSW5zdGFudD0iMjAx +MS0wNi0xNFQxODoyNjowMS41MTVaIgogICAgICAgICAgICAgICAgICAgICAg +ICAgICAgICB4bWxuczpzYW1sMj0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6 +Mi4wOmFzc2VydGlvbiI+CiAgICAgICAgICAgIDxzYW1sMjpBdXRobkNvbnRl +eHQ+CiAgICAgICAgICAgICAgICA8c2FtbDI6QXV0aG5Db250ZXh0Q2xhc3NS +ZWY+dXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFjOmNsYXNzZXM6UGFz +c3dvcmRQcm90ZWN0ZWRUcmFuc3BvcnQKICAgICAgICAgICAgICAgIDwvc2Ft +bDI6QXV0aG5Db250ZXh0Q2xhc3NSZWY+CiAgICAgICAgICAgIDwvc2FtbDI6 +QXV0aG5Db250ZXh0PgogICAgICAgIDwvc2FtbDI6QXV0aG5TdGF0ZW1lbnQ+ +CiAgICA8L3NhbWwyOkFzc2VydGlvbj4KPC9zYW1sMnA6UmVzcG9uc2U+ diff --git a/ruby-saml-custom/test/responses/response_with_signed_assertion.xml.base64 b/ruby-saml-custom/test/responses/response_with_signed_assertion.xml.base64 new file mode 100644 index 0000000..d0e55f7 --- /dev/null +++ b/ruby-saml-custom/test/responses/response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Ag +IDwvQXVkaWVuY2VSZXN0cmljdGlvbj4KICAgIDwvQ29uZGl0aW9ucz4KICAg +IDxBdHRyaWJ1dGVTdGF0ZW1lbnQ+CiAgICAgIDxBdHRyaWJ1dGUgTmFtZT0i +aHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0 +eS9jbGFpbXMvZW1haWxhZGRyZXNzIj4KICAgICAgICA8QXR0cmlidXRlVmFs +dWU+c29tZW9uZUBleGFtcGxlLmNvbTwvQXR0cmlidXRlVmFsdWU+CiAgICAg +IDwvQXR0cmlidXRlPgogICAgPC9BdHRyaWJ1dGVTdGF0ZW1lbnQ+CiAgICA8 +QXV0aG5TdGF0ZW1lbnQgQXV0aG5JbnN0YW50PSIyMDExLTA1LTAyVDE5OjQz +OjU0LjI4NVoiIFNlc3Npb25JbmRleD0iX2RiZTZhMzY1LTk1ODItNDYwZi1i +NGIxLTFmNzliZjcwZjc2YiI+CiAgICAgIDxBdXRobkNvbnRleHQ+CiAgICAg +ICAgPEF1dGhuQ29udGV4dENsYXNzUmVmPnVybjpvYXNpczpuYW1lczp0YzpT +QU1MOjIuMDphYzpjbGFzc2VzOlBhc3N3b3JkUHJvdGVjdGVkVHJhbnNwb3J0 +PC9BdXRobkNvbnRleHRDbGFzc1JlZj4KICAgICAgPC9BdXRobkNvbnRleHQ+ +CiAgICA8L0F1dGhuU3RhdGVtZW50PgogIDwvQXNzZXJ0aW9uPgo8L3NhbWxw +OlJlc3BvbnNlPgo= diff --git a/ruby-saml-custom/test/responses/response_with_signed_assertion_2.xml.base64 b/ruby-saml-custom/test/responses/response_with_signed_assertion_2.xml.base64 new file mode 100644 index 0000000..106d68c --- /dev/null +++ b/ruby-saml-custom/test/responses/response_with_signed_assertion_2.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wi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yI+e1NTSEF9RVB2V3V1bkMxU1p0Nk5OdHMveTdpcFRJcVVMVjZJVWU8L3NhbWw6QXR0cmlidXRlVmFsdWU+PC9zYW1sOkF0dHJpYnV0ZT48c2FtbDpBdHRyaWJ1dGUgTmFtZT0idXJuOm9pZDowLjkuMjM0Mi4xOTIwMDMwMC4xMDAuMS45IiBOYW1lRm9ybWF0PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXR0cm5hbWUtZm9ybWF0OnVyaSI+PHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+Kjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48L3NhbWw6QXR0cmlidXRlPjxzYW1sOkF0dHJpYnV0ZSBOYW1lPSJ1cm46b2lkOjIuMTYuODQwLjEuMTEzNzMwLjMuMS4zOSIgTmFtZUZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDp1cmkiPjxzYW1sOkF0dHJpYnV0ZVZhbHVlIHhzaTp0eXBlPSJ4czpzdHJpbmciPmVuPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPjwvc2FtbDpBdHRyaWJ1dGU+PC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD48L3NhbWw6QXNzZXJ0aW9uPjwvc2FtbHA6UmVzcG9uc2U+ \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/response_with_signed_assertion_3.xml b/ruby-saml-custom/test/responses/response_with_signed_assertion_3.xml new file mode 100644 index 0000000..00d9cdf --- /dev/null +++ b/ruby-saml-custom/test/responses/response_with_signed_assertion_3.xml @@ -0,0 +1,30 @@ + + + idp.example.com + + + + + idp.myexample.org + + + FA0AbR4w9oYdx7MFjERARVJAHps=GDH5jhCNX9PFxW+71SOJPyusAOwzECwmd57NDhvA/VKWHnV3PpvpNkOLyamoBNdZ4qxponnobg2zneLESrFnLJdJ1cgs51YvtBJTxKoA7oZMMNKReZFST8g7pDdrBC82n5rTdzxclaJkpwz1yjcho3K3TjxK+gU1svVrEKMUwyo= +MIICGzCCAYQCCQCNNcQXom32VDANBgkqhkiG9w0BAQUFADBSMQswCQYDVQQGEwJVUzELMAkGA1UECBMCSU4xFTATBgNVBAcTDEluZGlhbmFwb2xpczERMA8GA1UEChMIT25lTG9naW4xDDAKBgNVBAsTA0VuZzAeFw0xNDA0MjMxODQxMDFaFw0xNTA0MjMxODQxMDFaMFIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJJTjEVMBMGA1UEBxMMSW5kaWFuYXBvbGlzMREwDwYDVQQKEwhPbmVMb2dpbjEMMAoGA1UECxMDRW5nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDo6m+QZvYQ/xL0ElLgupK1QDcYL4f5PckwsNgS9pUvV7fzTqCHk8ThLxTk42MQ2McJsOeUJVP728KhymjFCqxgP4VuwRk9rpAl0+mhy6MPdyjyA6G14jrDWS65ysLchK4t/vwpEDz0SQlEoG1kMzllSm7zZS3XregA7DjNaUYQqwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBALM2vGCiQ/vm+a6v40+VX2zdqHA2Q/1vF1ibQzJ54MJCOVWvs+vQXfZFhdm0OPM2IrDU7oqvKPqP6xOAeJK6H0yP7M4YL3fatSvIYmmfyXC9kt3Svz/NyrHzPhUnJ0ye/sUSXxnzQxwcm/9PwAqrQaA3QpQkH57ybF/OoryPe+2h + + someone@example.org + + + + + + + example.com + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport + + + + diff --git a/ruby-saml-custom/test/responses/response_with_signed_message_and_assertion.xml b/ruby-saml-custom/test/responses/response_with_signed_message_and_assertion.xml new file mode 100644 index 0000000..a5bca26 --- /dev/null +++ b/ruby-saml-custom/test/responses/response_with_signed_message_and_assertion.xml @@ -0,0 +1,34 @@ + + + idp.example.com + + + hi2Ouec0ovl90Cz+OXAP6FD5X70=tJiaa5aZNzLFbBiIsyc0MBI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= +MIICGzCCAYQCCQCNNcQXom32VDANBgkqhkiG9w0BAQUFADBSMQswCQYDVQQGEwJVUzELMAkGA1UECBMCSU4xFTATBgNVBAcTDEluZGlhbmFwb2xpczERMA8GA1UEChMIT25lTG9naW4xDDAKBgNVBAsTA0VuZzAeFw0xNDA0MjMxODQxMDFaFw0xNTA0MjMxODQxMDFaMFIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJJTjEVMBMGA1UEBxMMSW5kaWFuYXBvbGlzMREwDwYDVQQKEwhPbmVMb2dpbjEMMAoGA1UECxMDRW5nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDo6m+QZvYQ/xL0ElLgupK1QDcYL4f5PckwsNgS9pUvV7fzTqCHk8ThLxTk42MQ2McJsOeUJVP728KhymjFCqxgP4VuwRk9rpAl0+mhy6MPdyjyA6G14jrDWS65ysLchK4t/vwpEDz0SQlEoG1kMzllSm7zZS3XregA7DjNaUYQqwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBALM2vGCiQ/vm+a6v40+VX2zdqHA2Q/1vF1ibQzJ54MJCOVWvs+vQXfZFhdm0OPM2IrDU7oqvKPqP6xOAeJK6H0yP7M4YL3fatSvIYmmfyXC9kt3Svz/NyrHzPhUnJ0ye/sUSXxnzQxwcm/9PwAqrQaA3QpQkH57ybF/OoryPe+2h + + someone@example.org + + + + + + + example.com + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport + + + + \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/response_with_undefined_recipient.xml.base64 b/ruby-saml-custom/test/responses/response_with_undefined_recipient.xml.base64 new file mode 100644 index 0000000..201c524 --- /dev/null +++ b/ruby-saml-custom/test/responses/response_with_undefined_recipient.xml.base64 @@ -0,0 +1 @@ +DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgeG1sbnM6c2FtbHA9In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DpBdXRoblN0YXRlbWVudD4NCiAgICA8c2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+DQogICAgICA8c2FtbDpBdHRyaWJ1dGUgTmFtZT0idWlkIj4NCiAgICAgICAgPHNhbWw6QXR0cmlidXRlVmFsdWUgeG1sbnM6eHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4c2k6dHlwZT0ieHM6c3RyaW5nIj5kZW1vPC9zYW1sOkF0dHJpYnV0ZVZhbHVlPg0KICAgICAgPC9zYW1sOkF0dHJpYnV0ZT4NCiAgICAgIDxzYW1sOkF0dHJpYnV0ZSBOYW1lPSJhbm90aGVyX3ZhbHVlIj4NCiAgICAgICAgPHNhbWw6QXR0cmlidXRlVmFsdWUgeG1sbnM6eHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4c2k6dHlwZT0ieHM6c3RyaW5nIj52YWx1ZTwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT4NCiAgICAgIDwvc2FtbDpBdHRyaWJ1dGU+DQogICAgPC9zYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgPC9zYW1sOkFzc2VydGlvbj4NCjwvc2FtbHA6UmVzcG9uc2U+DQo= \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/response_without_attributes.xml.base64 b/ruby-saml-custom/test/responses/response_without_attributes.xml.base64 new file mode 100644 index 0000000..b4ef73a --- /dev/null +++ b/ruby-saml-custom/test/responses/response_without_attributes.xml.base64 @@ -0,0 +1,79 @@ +PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHNhbWwy +cDpSZXNwb25zZSB4bWxuczpzYW1sM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lcnRpb24iIEF1dGhu +SW5zdGFudD0iMjAxMS0wNC0xOFQxNToxMjowNS45OTRaIj4KICAgICAgPHNh +bWwyOkF1dGhuQ29udGV4dD4KICAgICAgICA8c2FtbDI6QXV0aG5Db250ZXh0 +Q2xhc3NSZWY+dXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFjOmNsYXNz +ZXM6UGFzc3dvcmRQcm90ZWN0ZWRUcmFuc3BvcnQ8L3NhbWwyOkF1dGhuQ29u +dGV4dENsYXNzUmVmPgogICAgICA8L3NhbWwyOkF1dGhuQ29udGV4dD4KICAg +IDwvc2FtbDI6QXV0aG5TdGF0ZW1lbnQ+CiAgPC9zYW1sMjpBc3NlcnRpb24+ +Cjwvc2FtbDJwOlJlc3BvbnNlPgo= \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/response_without_reference_uri.xml.base64 b/ruby-saml-custom/test/responses/response_without_reference_uri.xml.base64 new file mode 100644 index 0000000..603fceb --- /dev/null +++ b/ruby-saml-custom/test/responses/response_without_reference_uri.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgSUQ9InBmeGQ1OTQzNDdkLTQ5NWYtYjhkMS0wZWUyLTQxY2ZkYTE0ZGQzNSIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTUtMDEtMDJUMjI6NDg6NDhaIiBEZXN0aW5hdGlvbj0iaHR0cDovL2xvY2FsaG9zdDo5MDAxL3YxL3VzZXJzL2F1dGhvcml6ZS9zYW1sIiBDb25zZW50PSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6Y29uc2VudDp1bnNwZWNpZmllZCIgSW5SZXNwb25zZVRvPSJfZWQ5MTVhNDAtNzRmYi0wMTMyLTViMTYtNDhlMGViMTRhMWM3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vbnNlPg== \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/response_wrapped.xml.base64 b/ruby-saml-custom/test/responses/response_wrapped.xml.base64 new file mode 100644 index 0000000..fb2f8f4 --- /dev/null +++ b/ruby-saml-custom/test/responses/response_wrapped.xml.base64 @@ -0,0 +1,150 @@ +77u/PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxzYW1s +cDpSZXNwb25zZSB4bWxuczpzYW1scD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6 +Mi4wOnByb3RvY29sIiB4bWxuczpzYW1sPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FN +TDoyLjA6YXNzZXJ0aW9uIiBJRD0iXzI2NTAyNGI0NjAyZmM2OGMwMTQ1YzZlOWM1 +NzFkOGY2MjE5ZTZjZmVlMCIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIw +MTEtMDYtMTNUMTY6MDI6MjVaIiBEZXN0aW5hdGlvbj0iaHR0cDovL2xvY2FsaG9z +dC9waHAtc2FtbC1maXhlZC9jb25zdW1lLnBocCIgSW5SZXNwb25zZVRvPSJfMzI0 +NDJhOGMzZDFiYThlYTEzNmMiPg0KICA8c2FtbDpJc3N1ZXI+aHR0cHM6Ly9pZHAv +c2ltcGxlc2FtbC9zYW1sMi9pZHAvbWV0YWRhdGEucGhwPC9zYW1sOklzc3Vlcj4N +CiAgPHNhbWxwOlN0YXR1cz4NCiAgICA8c2FtbHA6U3RhdHVzQ29kZSBWYWx1ZT0i +dXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnN0YXR1czpTdWNjZXNzIiAvPg0K +ICA8L3NhbWxwOlN0YXR1cz4NCiAgPHNhbWw6QXNzZXJ0aW9uIHhtbG5zOnhzaT0i +aHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5z +OnhzPSJodHRwOi8vd3d3LnczLm9yZy8yM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6Q29udGFjdFBlcnNvbiBjb250YWN0VHlwZT0idGVjaG5pY2FsIj4N +CiAgICAgIDxtZDpHaXZlbk5hbWU+QW5kcmVhczwvbWQ6R2l2ZW5OYW1lPg0KICAg +ICAgPG1kOlN1ck5hbWU+TWF5ZXI8L21kOlN1ck5hbWU+DQogICAgICA8bWQ6RW1h +aWxBZGRyZXNzPmFuZHJlYXMubWF5ZXJAd3VlcnRoLmNvbTwvbWQ6RW1haWxBZGRy +ZXNzPg0KICAgIDwvbWQ6Q29udGFjdFBlcnNvbj4NCiAgPC9tZDpFbnRpdHlEZXNj +cmlwdG9yPg0KPC9zYW1scDpSZXNwb25zZT4= diff --git a/ruby-saml-custom/test/responses/signed_message_encrypted_signed_assertion.xml.base64 b/ruby-saml-custom/test/responses/signed_message_encrypted_signed_assertion.xml.base64 new file mode 100644 index 0000000..1027099 --- /dev/null +++ b/ruby-saml-custom/test/responses/signed_message_encrypted_signed_assertion.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIElEPSJfYmZhYWE3NDEwMTQxZTUwZDNhNGMyMzY2MTBlY2U3YzdmYzYyZGE4YTU2IiBWZXJzaW9uPSIyLjAiIElzc3VlSW5zdGFudD0iMjAxNS0wMy0xOVQxNDowMjoxMloiIERlc3RpbmF0aW9uPSJodHRwOi8vcnVieXNhbWwuY29tOjMwMDAvc2FtbC9hY3MiIEluUmVzcG9uc2VUbz0iXzc3MDYyNDcwLWIwNmUtMDEzMi01YzNlLTAwOTBmNWRlZGQ3NyI+PHNhbWw6SXNzdWVyPmh0dHBzOi8vaWRwLmV4YW1wbGUuY29tL3NpbXBsZXNhbWwvc2FtbDIvaWRwL21ldGFkYXRhLnBocDwvc2FtbDpJc3N1Z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I2M1N5L1A0cjFoVG5UWmFrb0FqUTBlTVpRblROME9hOUorQWRxdEY5UzdJU2NUNTR0dk84NjNkdnJHWmc0VU1hUERodWQycC9IMTAwdkxpUmxuajNsOXlsQ0tqOWphTEE9PTwveGVuYzpDaXBoZXJWYWx1ZT4KICAgPC94ZW5jOkNpcGhlckRhdGE+CjwveGVuYzpFbmNyeXB0ZWREYXRhPjwvc2FtbDpFbmNyeXB0ZWRBc3NlcnRpb24+PC9zYW1scDpSZXNwb25zZT4= diff --git a/ruby-saml-custom/test/responses/signed_message_encrypted_unsigned_assertion.xml.base64 b/ruby-saml-custom/test/responses/signed_message_encrypted_unsigned_assertion.xml.base64 new file mode 100644 index 0000000..b1badfd --- /dev/null +++ b/ruby-saml-custom/test/responses/signed_message_encrypted_unsigned_assertion.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIElEPSJfOThjNjA3ZjdlZDBhOGRhMzVhMTEyNDUxYTE5ZWE2ZDFiZmM5OThhY2ViIiBWZXJzaW9uPSIyLjAiIElzc3VlSW5zdGFudD0iMjAxNS0wMy0xOVQxNDowMTozN1oiIERlc3RpbmF0aW9uPSJodHRwOi8vcnVieXNhbWwuY29tOjMwMDAvc2FtbC9hY3MiIEluUmVzcG9uc2VUbz0iXzYyNjAzNWIwLWIwNmUtMDEzMi01YzNkLTAwOTBmNWRlZGQ3NyI+PHNhbWw6SXNzdWVyPmh0dHBzOi8vaWRwLmV4YW1wbGUuY29tL3NpbXBsZXNhbWwvc2FtbDIvaWRwL21ldGFkYXRhLnBocDwvc2FtbDpJc3N1ZXI+PGRzOlNpZ25hdHVyZSB4bWxuczpkcz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2ln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UXUxNHpTa2hSS2c9PTwveGVuYzpDaXBoZXJWYWx1ZT4KICAgPC94ZW5jOkNpcGhlckRhdGE+CjwveGVuYzpFbmNyeXB0ZWREYXRhPjwvc2FtbDpFbmNyeXB0ZWRBc3NlcnRpb24+PC9zYW1scDpSZXNwb25zZT4= \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/signed_nameid_in_atts.xml b/ruby-saml-custom/test/responses/signed_nameid_in_atts.xml new file mode 100644 index 0000000..5e7ec59 --- /dev/null +++ b/ruby-saml-custom/test/responses/signed_nameid_in_atts.xml @@ -0,0 +1,47 @@ + + + http://idp.example.com/metadata.php + + + 7IMOicPUD8hBuAv8HeVDrUErclY=jPBUr/iVsSXvMeT6PhQxSTbi3j6M34OQiyAKLPyPQWypX0uJ04UbC2J4v1DqFqC3OJYyepQ6OBocSMH4r+uqv4hdoWeaj1Ieeo4HRB5UFTxhR4TV8tTPpEZjGA2vXz74BjtCi6PMWVe/28/TejkAosHfe62WktcznTvfWKePlFA= +MIICGzCCAYQCCQCNNcQXom32VDANBgkqhkiG9w0BAQUFADBSMQswCQYDVQQGEwJVUzELMAkGA1UECBMCSU4xFTATBgNVBAcTDEluZGlhbmFwb2xpczERMA8GA1UEChMIT25lTG9naW4xDDAKBgNVBAsTA0VuZzAeFw0xNDA0MjMxODQxMDFaFw0xNTA0MjMxODQxMDFaMFIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJJTjEVMBMGA1UEBxMMSW5kaWFuYXBvbGlzMREwDwYDVQQKEwhPbmVMb2dpbjEMMAoGA1UECxMDRW5nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDo6m+QZvYQ/xL0ElLgupK1QDcYL4f5PckwsNgS9pUvV7fzTqCHk8ThLxTk42MQ2McJsOeUJVP728KhymjFCqxgP4VuwRk9rpAl0+mhy6MPdyjyA6G14jrDWS65ysLchK4t/vwpEDz0SQlEoG1kMzllSm7zZS3XregA7DjNaUYQqwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBALM2vGCiQ/vm+a6v40+VX2zdqHA2Q/1vF1ibQzJ54MJCOVWvs+vQXfZFhdm0OPM2IrDU7oqvKPqP6xOAeJK6H0yP7M4YL3fatSvIYmmfyXC9kt3Svz/NyrHzPhUnJ0ye/sUSXxnzQxwcm/9PwAqrQaA3QpQkH57ybF/OoryPe+2h + + + + + http://idp.example.com/metadata.php + + _ce3d2948b4cf20146dee0a0b3dd6f69b6cf86f62d7 + + + + + + + http://sp.example.com/demo1/metadata.php + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:Password + + + + + test + + + test@example.com + + + users + examplerole1 + + + + ZdrjpwEdw22vKoxWAbZB78/gQ7s= + + + + + diff --git a/ruby-saml-custom/test/responses/signed_unqual_nameid_in_atts.xml b/ruby-saml-custom/test/responses/signed_unqual_nameid_in_atts.xml new file mode 100644 index 0000000..66a0beb --- /dev/null +++ b/ruby-saml-custom/test/responses/signed_unqual_nameid_in_atts.xml @@ -0,0 +1,47 @@ + + + http://idp.example.com/metadata.php + + + LQa/IrEdbLE1BHEP3B7KfvOABpg=fWg7OauBy7cExPo+GbNVb1e1OopaYc0ke+BYF1N4bpoej86o7U75xOttDN7oz58LhpDZYWcgEvsqX/Jth7Adc3v0bsUEw1h3rFVhGCOnJLS21o1r9cEdkUSbGcJ7jk6EnlxE9s3/puAxkanqzC50hWsIm19Xzu9Li1MN3eDgB9M= +MIICGzCCAYQCCQCNNcQXom32VDANBgkqhkiG9w0BAQUFADBSMQswCQYDVQQGEwJVUzELMAkGA1UECBMCSU4xFTATBgNVBAcTDEluZGlhbmFwb2xpczERMA8GA1UEChMIT25lTG9naW4xDDAKBgNVBAsTA0VuZzAeFw0xNDA0MjMxODQxMDFaFw0xNTA0MjMxODQxMDFaMFIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJJTjEVMBMGA1UEBxMMSW5kaWFuYXBvbGlzMREwDwYDVQQKEwhPbmVMb2dpbjEMMAoGA1UECxMDRW5nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDo6m+QZvYQ/xL0ElLgupK1QDcYL4f5PckwsNgS9pUvV7fzTqCHk8ThLxTk42MQ2McJsOeUJVP728KhymjFCqxgP4VuwRk9rpAl0+mhy6MPdyjyA6G14jrDWS65ysLchK4t/vwpEDz0SQlEoG1kMzllSm7zZS3XregA7DjNaUYQqwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBALM2vGCiQ/vm+a6v40+VX2zdqHA2Q/1vF1ibQzJ54MJCOVWvs+vQXfZFhdm0OPM2IrDU7oqvKPqP6xOAeJK6H0yP7M4YL3fatSvIYmmfyXC9kt3Svz/NyrHzPhUnJ0ye/sUSXxnzQxwcm/9PwAqrQaA3QpQkH57ybF/OoryPe+2h + + + + + http://idp.example.com/metadata.php + + _ce3d2948b4cf20146dee0a0b3dd6f69b6cf86f62d7 + + + + + + + http://sp.example.com/demo1/metadata.php + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:Password + + + + + test + + + test@example.com + + + users + examplerole1 + + + + ZdrjpwEdw22vKoxWAbZB78/gQ7s= + + + + + diff --git a/ruby-saml-custom/test/responses/simple_saml_php.xml b/ruby-saml-custom/test/responses/simple_saml_php.xml new file mode 100644 index 0000000..3dddefd --- /dev/null +++ b/ruby-saml-custom/test/responses/simple_saml_php.xml @@ -0,0 +1,71 @@ + + + https://federate.example.net/saml/saml2/idp/metadata.php + + + + + + + + + + + dVJ592k5xPjCHBCMiJ8eZkPUiT8= + + + LHNK1FJfcOIUuWVKJmGABQ+W98+pQ== + + + MIIQmS6WmmIht3k= + + + + + + + + https://federate.example.net/saml/saml2/idp/metadata.php + + + + + + + + + + + mi0IAultZkpsZa1XxGx9X4iAPQg= + + + LqkW39SOYbttYxlGhIBw== + + + MIIGmmIht3k= + + + + + someone@example.com + + + + + + + hello.com + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:Password + + + + + someone@example.com + + + + diff --git a/ruby-saml-custom/test/responses/starfield_response.xml.base64 b/ruby-saml-custom/test/responses/starfield_response.xml.base64 new file mode 100644 index 0000000..b5fba3d --- /dev/null +++ b/ruby-saml-custom/test/responses/starfield_response.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIElEPSJCZWViMzkyYjc1Ny02ZGM3LTRlYjktYmI1Yy03NmU1MTFmZDZiZWIiIElzc3VlSW5zdGFudD0iMjAxMi0xMS0yOFQxODoxMzo0NVoiIFZlcnNpb249IjIuMCIgeG1sbnM9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnhlbmM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvMDQveG1sZW5jIyI+PFNpZ25hdHVyZSB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnIyI+PFNpZ25lZEluZm8+PENhbm9uaWNhbGl6YXRpb25NZXRob2QgQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy14bWwtYzE0bi0yMDAxMDMxNSIgLz48U2lnbmF0dXJlTWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnI3JzYS1zaGExIiAvPjxSZWZlcmVuY2UgVVJJPSIjQmVlYjM5MmI3NTctNmRjNy00ZWI5LWJiNWMtNzZlNTExZmQ2YmViIj48VHJhbnNmb3Jtcz48VHJhbnNmb3JtIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnI2VudmVsb3BlZC1zaWduYXR1cmUiIC8+PC9UcmFuc2Zvcm1zPjxEaWdlc3RNZXRob2QgQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjc2hhMSIgLz48RGlnZXN0VmFsdWU+S0RqNHlxK0RDa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XI+QmVlbGluZS5jb20NCiAgICAgICAgICAgICAgICA8L0lzc3Vlcj48U3ViamVjdD48TmFtZUlEIEZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOm5hbWVpZC1mb3JtYXQ6ZW1haWxBZGRyZXNzIj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJldm9yLmxpdHRsZUBzdGFyZmllbGR0bXMuY29tDQogICAgICAgICAgICAgICAgICAgICAgICA8L05hbWVJRD48U3ViamVjdENvbmZpcm1hdGlvbiBNZXRob2Q9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpjbTpiZWFyZXIiIC8+PC9TdWJqZWN0PjxDb25kaXRpb25zIE5vdEJlZm9yZT0iMjAxMi0xMS0yOFQxNzo1Mzo0NVoiIE5vdE9uT3JBZnRlcj0iMjAxMi0xMS0yOFQxODozMzo0NVoiPjwvQ29uZGl0aW9ucz48QXV0aG5TdGF0ZW1lbnQgQXV0aG5JbnN0YW50PSIyMDEyLTExLTI4VDE4OjEzOjQ1WiI+PEF1dGhuQ29udGV4dD48QXV0aG5Db250ZXh0Q2xhc3NSZWY+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFjOmNsYXNzZXM6UGFzc3dvcmQNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9BdXRobkNvbnRleHRDbGFzc1JlZj48L0F1dGhuQ29udGV4dD48L0F1dGhuU3RhdGVtZW50PjwvQXNzZXJ0aW9uPjwvc2FtbHA6UmVzcG9uc2U+ diff --git a/ruby-saml-custom/test/responses/test_sign.xml b/ruby-saml-custom/test/responses/test_sign.xml new file mode 100644 index 0000000..688102b --- /dev/null +++ b/ruby-saml-custom/test/responses/test_sign.xml @@ -0,0 +1,43 @@ + + + https://app.onelogin.com/saml/metadata/433789 + + + + + https://app.onelogin.com/saml/metadata/433789 + + jane.doe@example.com + + + + + + + http://audience + + + + + urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport + + + + + jane.doe@example.com + + + Jane + + + Doe + + + + + + + + + + diff --git a/ruby-saml-custom/test/responses/unsigned_encrypted_adfs.xml b/ruby-saml-custom/test/responses/unsigned_encrypted_adfs.xml new file mode 100644 index 0000000..2711bc9 --- /dev/null +++ b/ruby-saml-custom/test/responses/unsigned_encrypted_adfs.xml @@ -0,0 +1,23 @@ + + + https://idp.example.com/simplesaml/saml2/idp/metadata.php + + + + + + + + + + + xkJn7LQHrTZzLdrNec33hMSC5dc8B0uM4fw8HKhwpkWINwC9deaj0QVz4fZ82Zv2QdP3v6r0wJ/8VrUIF8puJTHSU0u2EUU+XqBJxvivGp2UhUPCyWmirSi6efBnWqMKhOz5YJoaLEu17yw+kOnavLZPv2bB8b5bo2mZPiaPG6s= + + + + + ERiTkdJzJN841qIRwT79+laTQZWz83osoKohRBIaBHNLasGuBApR6iJqsSrQb2/6wWddDaNOqbnBEY+6Ze1mSzDjYomrWtVDD2psrzk1T29G56LuTQiOtTtOUlOPOVUkS9Tp1RgCXmi7No49lJJHxM8b53Y6hNjJQiSwrEdxhrv83MSuqYahuT5n2yB9jGg/ZnF6IP2YXLT7cd4kYRj/0g0mEBGAIHV3ZGRLVSKg0CMVPnQUCPLXqVCKoRbF2nt5R8Q6gGmKm/2zsyEfDw/vW076fVg6EoK+XVZ/M/gHKccA+iyeHKMN2k/yWeHn7FB32jY9oR8Ct6mW9JlgBbliM1SCDMnshuJXlKnyXuvOfJQd12NUrt9lWACwnKQzSZ3y/b5UthalAYTgHPVtL871hXnC9MTeTfAk+HqV7nfdPJTk/jVDIi0Wsbqlf+ppC1nvRab8ovWmfpUKFYhHhiQ6K6XQGo7xT/dKqV7+2wvhHtvYPt8iW76RkWtHVEjZaHjgCF/XGpMrj5CuX8KMQ3b67CIxb28V5MxnUXrJV1q5TnEF56bvlG4NNqQTYWMcu+bhcA5w1E/rJZxSKfpg7VdT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cMae8U6Kvp1/e7p4wtwjwHAvy7PwewtYzndhT5CwqEq1uN/SrkDlXaCAMZGt9jHTzONviXjox7l0fr/l8HJ7y/GLno7wdE00a0LxzlxNGNdcKuqrDjndE3QmLUXrzTICSH7+2P5bqhoeSjj44HAu/QkDHpBqQl0k92DiKy4USbULnrAlRn8ix0u9uAZL+aMwrERyFtIoetNJMrWpkEHELg2V744qR3QY8QnjvL9jmG5J1rAXNCk2qbFI4SLYO+bLIAZaxIcXrP5GMf/ojYUZEnBiny2E+JWR9TFRjh+8yxXk9/PwJWI3RDJFdV6rY8rsKm1M2+01qNwjAYKkWTdyBeg3Jlvb84BoqOwPPoJHXKB0fJsY82R/FoVQK26aL6bA5xcAvfVszwSYs+4yTJA2roA== + + + + diff --git a/ruby-saml-custom/test/responses/unsigned_message_aes128_encrypted_signed_assertion.xml.base64 b/ruby-saml-custom/test/responses/unsigned_message_aes128_encrypted_signed_assertion.xml.base64 new file mode 100644 index 0000000..026e256 --- /dev/null +++ b/ruby-saml-custom/test/responses/unsigned_message_aes128_encrypted_signed_assertion.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9Il84ZThkYzVmNjlhOThjYzRjMWZmMzQyN2U1Y2UzNDYwNmZkNjcyZjkxZTYiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDE0LTA3LTE3VDAxOjAxOjQ4WiIgRGVzdGluYXRpb249Imh0dHA6Ly9zcC5leGFtcGxlLmNvbS9kZW1vMS9pbmRleC5waHA/YWNzIiBJblJlc3BvbnNlVG89Ik9ORUxPR0lOXzRmZWUzYjA0NjM5NWM0ZTc1MTAxMWU5N2Y4OTA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SG11eDQwVTlFOWg1dERRUVZwbStucTFrdE9Yc3gvcmRZcXpsUHNhZkpYbUdrTEJ5L3prMU8NCk9DSmYrNGdQYUthN0ZCRXdSaUJtY2UxN0JvQkkwaEpRUGJjVlpOZC9uUzZSazE5OXNPcytTc0E4TUZEbG11OGQNCk1odmlqUVBERE5uaVVBWDhvKzE5WXlESFN0N29kM3pqQkJ4UHdwa1ZaZWZGSXhvY0l1NFp2ejBwTExsL1FGZGcNCi9MbjdSdjhuYzNMQStsZGdidjV6YTNpTTZ3YVlzOUhud0JJRGQ1ZUk2VDVvYU8rN3o3b0cxaHZZd1ArMzFDc1MNCkcwRWZIWWNQU3lyNlVBNkdFZURuWWc9PTwveGVuYzpDaXBoZXJWYWx1ZT4NCiA8L3hlbmM6Q2lwaGVyRGF0YT4NCjwveGVuYzpFbmNyeXB0ZWREYXRhPg0KPC9zYW1sOkVuY3J5cHRlZEFzc2VydGlvbj4NCjwvc2FtbHA6UmVzcG9uc2U+ \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/unsigned_message_aes128gcm_encrypted_signed_assertion.xml.base64 b/ruby-saml-custom/test/responses/unsigned_message_aes128gcm_encrypted_signed_assertion.xml.base64 new file mode 100644 index 0000000..d42f624 --- /dev/null +++ b/ruby-saml-custom/test/responses/unsigned_message_aes128gcm_encrypted_signed_assertion.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+CjxzYW1scDpSZXNwb25zZSB4bWxuczpzYW1scD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3RvY29sIgogIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIElEPSJfOGU4ZGM1ZjY5YTk4Y2M0YzFmZjM0MjdlNWNlMzQ2MDZmZDY3MmY5MWU2IiBWZXJzaW9uPSIyLjAiIElzc3VlSW5zdGFudD0iMjAxNC0wNy0xN1QwMTowMTo0OFoiIERlc3Rpb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cEdPTzZlWUsyeWVzaVdZS20yRERvcUd2S2haaFhBM0o1NjdCTFg3eXprb25KVWRqKzJkd2VkMGY0ZDVvaE1RVU8ra3BBT04yTXRtMHV3NnM0U044NzZzWGtyNzdwLzQyVWc3SGh2UzdjTUVIVnpOTGtWdDg4V2RyVmpVTkxuRG5wREVSTTdWVEZJTUNkUVNjaVJUSm5ZK1RUbHJROVdVb2NNVG1Pck5NLzdqMWlzUFB1RFlaSmxXRjdFTld3Y3pwMWVFVXZTTXNFVytOMDQ5STJmUWI2bk1wdFRyRHh2T2o1cmFNSXdaMXYzYlIxWXd6MHJXcjZwTkZMd0E9PC94ZW5jOkNpcGhlclZhbHVlPgogICAgICA8L3hlbmM6Q2lwaGVyRGF0YT4KICAgIDwveGVuYzpFbmNyeXB0ZWREYXRhPgogIDwvc2FtbDpFbmNyeXB0ZWRBc3NlcnRpb24+Cjwvc2FtbHA6UmVzcG9uc2U+ diff --git a/ruby-saml-custom/test/responses/unsigned_message_aes192_encrypted_signed_assertion.xml.base64 b/ruby-saml-custom/test/responses/unsigned_message_aes192_encrypted_signed_assertion.xml.base64 new file mode 100644 index 0000000..eafb5bd --- /dev/null +++ b/ruby-saml-custom/test/responses/unsigned_message_aes192_encrypted_signed_assertion.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9Il84ZThkYzVmNjlhOThjYzRjMWZmMzQyN2U1Y2UzNDYwNmZkNjcyZjkxZTYiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDE0LTA3LTE3VDAxOjAxOjQ4WiIgRGVzdGluYXRpb249Imh0dHA6Ly9zcC5leGFtcGxlLmNvbS9kZW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VNvMkI1MDZiZUxHQzNSYUxIVG5Pc0liZVV1ZE9WNjA4DQpwNDY2SjdBUGZxNmhUV08wZGMxVlBucGtFeERteEcxNzlYT2VacVJUcm0wSDVKSklJL3RmY0RSdEQwMkJLMGljDQpnNGM2Nk42bzgvQXA1bFFVQXNhMXlYT2FSNXhqbldsbEszUXZuZWRWK2lWWTRKK09vQldCUlJhSHFZWGpWM2tFDQoxdlpGVC8waVhXcFpBN3lNaVRuYTZHVVA2Nmtmb3FVVlI4bzhJem9acFBpUm9JY1pDR0xZMG9rYlhENnhjYTFqDQpTZm1GWjF0NWZxZC91T2NXVUJFSFBHK0FQaHNWbXdRWS9MT1RlK2J4TS9uZFJLbkd6VnRjcHpPVTd1cmdpSE1JDQppNHdKWmNtRDE0c00yeFBNTk9IZlBGU3ZaeHltYjNvVWEwL3NhdGNKdkVQN3lUcExadGNhSkhKTURnU2dTbWgzDQowc1NVZkthci9OZXdHTVVFNG13TmFCVmtLN1RiKzRqaWFWT0Nua216T3NEUjVuTHVaUXhlaDNxWDJBcXRBR2R5DQpEMy9vUEE2VEp3THlUS0RINkd5bXZUNXViTzlkWDJnKzRoNUprWnZROEFpT3Z6UjZta0dIeUJ1YmdJNThGOWF0DQo5RmIwaExNYzh6TVlzY0NCbmJNSE9sOVorc3JLRXpGNXRST1Y0L21SaThRc3l3dGlLMTNnUWl1bktxYVVHTWxODQpUZWoybDZ6VFNCZ3NJUWdRbWJRb3JRPT08L3hlbmM6Q2lwaGVyVmFsdWU+DQogPC94ZW5jOkNpcGhlckRhdGE+DQo8L3hlbmM6RW5jcnlwdGVkRGF0YT4NCjwvc2FtbDpFbmNyeXB0ZWRBc3NlcnRpb24+DQo8L3NhbWxwOlJlc3BvbnNlPg== \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/unsigned_message_aes192gcm_encrypted_signed_assertion.xml.base64 b/ruby-saml-custom/test/responses/unsigned_message_aes192gcm_encrypted_signed_assertion.xml.base64 new file mode 100644 index 0000000..5fb9a70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PSU5sTDVhVEZ5WjhKYU1GS0FFQTdoWUF1V3I0cDYySUhUNTFQZlZyRDN4cTc0VHpCWWZsdzJoOStyOXZNUlFKbHdYaWNqK2dUbW1BeHpid1RUdkkrMTMvMTFITFowNzNjNTI3dW5iYXBpcW1NSlBjbHlsandSQzhaZS9ST2hZbDA0S01MT3dLNjY5SHdYNUdCQld0SXVPVTlYcXBPNUtxQlV5WXJqZ1NsTnJKMXlER1RDN3kzNEtiVHgybzRlbGhSYkR2S3c1L0VQK3d1d3QxSERsbkpLUzdpTEppU0hONmJDS0EwVU1GU2tIRXB5c3lpcDNwUWJuL3hqdjNZR2VwV0J3WTNNZUZ3MHROQUdkeUtlcHhKbDFNMkRZQ0R4QkRGazJwWG4xODVDWEN0SjRxY3NXREhmLzY4RngxZVhTZk9GUlk1MTYzVXJHanZvQ1Z3R2pGU1hNbENCMU5ySUlaaTRHRW5SVVoybDFVV3Jtb3FrM0p5KzdoSWFHRFJzZ1poa3BLcG5yL1d6Y1lsSnpKcHF5b0RQeWhzTUhoSFlCcXhKLzNjdGY2cUJ0SjgxTUkyZDBRZktVbHNNanVWMGJxNUpBcTBKYWdKTVdxbldwK1h1YjdPTUR0bkVhdjNEblZxNUNKSzNDRHVUTnNKRnBsSzFRSHVubjVlTXJ2STF0dEdkaVd5SlkrRGxCT2puRnQ3RnRtY0lGcDhSQkc1RG9VYktkNjU3Z3VPTFYvT3cwMGN5a0ZPSDdWQnNWV3ZuZzUzOGtaVmVHTkExL3k4WlhRUHIyZXhYRDZUTT08L3hlbmM6Q2lwaGVyVmFsdWU+CiAgICAgIDwveGVuYzpDaXBoZXJEYXRhPgogICAgPC94ZW5jOkVuY3J5cHRlZERhdGE+CiAgPC9zYW1sOkVuY3J5cHRlZEFzc2VydGlvbj4KPC9zYW1scDpSZXNwb25zZT4= diff --git a/ruby-saml-custom/test/responses/unsigned_message_aes256_encrypted_signed_assertion.xml.base64 b/ruby-saml-custom/test/responses/unsigned_message_aes256_encrypted_signed_assertion.xml.base64 new file mode 100644 index 0000000..6308fd1 --- /dev/null +++ b/ruby-saml-custom/test/responses/unsigned_message_aes256_encrypted_signed_assertion.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiIgSUQ9Il84ZThkYzVmNjlhOThjYzRjMWZmMzQyN2U1Y2UzNDYwNmZkNjcyZjkxZTYiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDE0LTA3LTE3VDAxOjAxOjQ4WiIgRGVzdGluYXRpb249Imh0dHA6Ly9zcC5leGFtcGxlLmNvbS9kZW1vMS9pbmRleC5waHA/YWNzIiBJblJlc3BvbnNlVG89Ik9ORUxPR0lOXzRmZWUzYjA0NjM5NWM0ZTc1MTAxMWU5N2Y4OTAwYjUyNzNkNTY2ODUiPg0KICA8c2FtbDpJc3N1ZXI+aHR0cDovL2lkcC5leGFtcGxlLmNvbS9tZXRhZGF0YS5waHA8L3NhbWw6SXNzdWVyPg0KICA8c2FtbHA6U3RhdHVzPg0KICAgIDxzYW1scDpTdGF0dXNDb2RlIFZhbHVlPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6c3RhdHVzOlN1Y2Nlc3MiLz4NCiAgPC9zYW1scDpTdGF0dXM+DQogIDxzYW1sOkVuY3J5cHRlZEFzc2VydGlvbj4NCiAgPHhlbmM6RW5jcnlwdGVkRGF0YSB4bWxuczp4ZW5jPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGVuYyMiIHhtbG5zOmRzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwLzA5L3htbGRzaWcjIiBUeXBlPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL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-saml-custom/test/responses/unsigned_message_aes256gcm_encrypted_signed_assertion.xml.base64 b/ruby-saml-custom/test/responses/unsigned_message_aes256gcm_encrypted_signed_assertion.xml.base64 new file mode 100644 index 0000000..cfcb85d --- /dev/null +++ b/ruby-saml-custom/test/responses/unsigned_message_aes256gcm_encrypted_signed_assertion.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+CjxzYW1scDpSZXNwb25zZSB4bWxuczpzYW1scD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3RvY29sIgogIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIElEPSJfOGU4ZGM1ZjY5YTk4Y2M0YzFmZjM0MjdlNWNlMzQ2MDZmZDY3MmY5MWU2IiBWZXJzaW9uPSIyLjAiIElzc3VlSW5zdGFudD0iMjAxNC0wNy0xN1QwMTowMTo0OFoiIERlc3RpbmF0aW9uPSJodHRwOi8vc3AuZXhhbXBsZS5jb20vZGVtbzEvaW5kZXgucGhwP2FjcyIgSW5SZXNwb25zZVRvPSJPTkVMT0dJTl80ZmVlM2IwNDYzOTVjNGU3NTEwMTFlOTdmODkwMGI1MjczZDU2Njg1Ij4KICA8c2FtbDpJc3N1ZXI+aHR0cDovL2lkcC5leGFtcGxlLmNvbS9tZXRhZGF0YS5waHA8L3NhbWw6SXNzdWVyPgogIDxzYW1scDpTdGF0dXM+CiAgICA8c2FtbHA6U3RhdHVzQ29kZSBWYWx1ZT0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnN0YXR1czpTdWNjZXNzIi8+CiAgPC9zYW1scDpTdGF0dXM+CiAgPHNhbWw6RW5jcnlwdGVkQXNzZXJ0aW9uPgogICAgPHhlbmM6RW5jcnlwdGVkRGF0YSB4bWxuczp4ZW5jPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGVuYyMiCiAgICAgIHhtbG5zOmRzP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_des192_encrypted_signed_assertion.xml.base64 b/ruby-saml-custom/test/responses/unsigned_message_des192_encrypted_signed_assertion.xml.base64 new file mode 100644 index 0000000..903e823 --- /dev/null +++ b/ruby-saml-custom/test/responses/unsigned_message_des192_encrypted_signed_assertion.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIElEPSJfOGU4ZGM1ZjY5YTk4Y2M0YzFmZjM0MjdlNWNlMzQ2MDZmZDY3MmY5MWU2IiBWZXJzaW9uPSIyLjAiIElzc3VlSW5zdGFudD0iMjAxNC0wNy0xN1QwMTowMTo0OFoiIERlc3RpbmF0aW9uPSJodHRwOi8vc3AuZXhhbXBsZS5jb20vZGVtbzEvaW5kZXgucGhwP2FjcyIgSW5SZXNwb25zZVRvPSJPTkVMT0dJTl80ZmVlM2IwNDYzOTVjNGU3NTEwMTFlOTdmODkwMGI1MjczZDU2Njg1Ij4NCiAgPHNhbWw6SXNzdWVyPmh0dHA6Ly9pZHAuZXhhbXBsZS5jb20vbWV0YWRhdGEucGhwPC9zYW1sOklzc3Vlcj4NCiAgPHNhbWxwOlN0YXR1cz4NCiAgICA8c2FtbHA6U3RhdHVzQ29kZSBWYWx1ZT0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnN0YXR1czpTdWNjZXNzIi8+DQogIDwvc2FtbHA6U3RhdHVzPg0KICANCjxzYW1sOkVuY3J5cHRlZEFzc2VydGlvbj48eGVuYzpFbmNyeXB0ZWREYXRhIHhtbG5zOnhlbmM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvMDQveG1sZW5jIyIgeG1sbnM6ZHNpZz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnIyIgVHlwZT0iaH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WtLd3QrNUdNbmlRaUtsU2RET2hnQVowdHJ6dEhwTVJ2Znh1RkZBSVVDNDVnN2swWHFYbUE4UjhabEhtcTVxTmFyRVZpZkw5UWF5eWxqaFNxYXpqenR1MVZiS0JvWnd1MXVOeHVxenhlTGEvOG5GUkkzTXZ6dXA0OFc0aWROeWtoOUlYeXdMOGk2V3VPNWE3KzIza2xiNEpHZjNjdFcxR1YyM2FBbEhSWlkzZzdseFlER2MwKzhzSjZGREpUdm5tcTlDd3dhRkdYWWFTNFJhc3Y3UjRoaWE5bWRoRzAyVmVYOG5aM2UzcnZvNUlVOHd2UjVHSllkdGxPZlhFUGlZYkZsUi9QU0NwZTViR1hzbDkyQUJqOTkyaUJoZUZmZkZvSEJya3RIeEMxL2V5TVRqZEVseFVIcSt0TWtHTEVKQVZKUlJva2ZxQ0xIaTJBcmNQWU9EaklSNStnNmd0aFd5OWNGdmtidDFTdDBCTXVSZGJiVTVsNFo0ams0aWdJbGRpUVloRTdFMlNhNXRaTDJMOVhUY1QvcUYzaW92dHlIcHJZbU5vUzwveGVuYzpDaXBoZXJWYWx1ZT4NCiAgIDwveGVuYzpDaXBoZXJEYXRhPg0KPC94ZW5jOkVuY3J5cHRlZERhdGE+PC9zYW1sOkVuY3J5cHRlZEFzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg== \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/unsigned_message_encrypted_assertion_without_saml_namespace.xml.base64 b/ruby-saml-custom/test/responses/unsigned_message_encrypted_assertion_without_saml_namespace.xml.base64 new file mode 100644 index 0000000..75b65d0 --- /dev/null +++ b/ruby-saml-custom/test/responses/unsigned_message_encrypted_assertion_without_saml_namespace.xml.base64 @@ -0,0 +1 @@ +PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8c2FtbHA6UmVzcG9uc2UgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCIgeG1sbnM6c2FtbD0idXJuOm9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np6TFlVRlhyWDc4MW45TXZua0xkc0hHVXZYUGN6QXNjUG1qUTZOR1hUbFdHMEdHdmZMckxWOWg4UmxtS2JONDENCmFBMG1JZ0FsZWwrSXQyVlRqY0tmTm5CQjBiNThpZG9TR2pSMStYTE5EUzRZVlFvSnFTRWppOWZTRGxmWWdhSi8NCndhSmEvZ2pHTEVzalo3a253QjZFc0thY1p0Wks5bXRzakhYUjBCbndNT3JsV2tvYzdNSkVyQVU3S3JwQzhkdnENCkxpUmxZbDlvUzJzMEQ3WUpxVkFxTmhtam9SdkhSWnJGTlBPZzQzZmljcEV4Y0lrY0cya1NZWVRZY3hRYnNqYUENCllsYmkwR3hBT0lQMzdKdnlhelJNcU9XajBxcXZ5b0U3ZVdiVDRoeXY2S05jcWNqTUZOdGVmZ0ZsckZ3YXRrOEUNCk9KRTEvdFdJSUlmLzNpTGtLMVhoK2trUkllSUhZZThGWEVwWkhueHgrVDRzUDEzSE5McFBtZlhNUzRjVEFwS0gNCnFkZUs5dnIyeHJZYk9Tcmpwd3NNbXc9PTwveGVuYzpDaXBoZXJWYWx1ZT4NCiA8L3hlbmM6Q2lwaGVyRGF0YT4NCjwveGVuYzpFbmNyeXB0ZWREYXRhPg0KPC9zYW1sOkVuY3J5cHRlZEFzc2VydGlvbj4NCjwvc2FtbHA6UmVzcG9uc2U+ \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/unsigned_message_encrypted_signed_assertion.xml.base64 b/ruby-saml-custom/test/responses/unsigned_message_encrypted_signed_assertion.xml.base64 new file mode 100644 index 0000000..bf127f4 --- /dev/null +++ b/ruby-saml-custom/test/responses/unsigned_message_encrypted_signed_assertion.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIElE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yMjZDNVVDazBJaXRzT1gwN0doaU5zOU1ZejFBc0ZWUVRLSjBtWDRFR2I3eURXU2czZC9UM3EzK3p1RjNqSVkzNHBqbjl1eWFBSkV6UnRnWmVCOXNZOS9qd2o5ZHhwVDBlb1pqazFFSHBhdkw3cVJkOUx2Y0U2ZllMTysxRWdsZkxFT3lzRm5ONkZjMHQ3UGkxVXdHU01NbXhuTEl2V2pBV0VLcFd1RGUrRUJZWW1CUjJhclhRZ2ZPRU9xbDNEeTR3N2NXbjA1Zz09PC94ZW5jOkNpcGhlclZhbHVlPgogICA8L3hlbmM6Q2lwaGVyRGF0YT4KPC94ZW5jOkVuY3J5cHRlZERhdGE+PC9zYW1sOkVuY3J5cHRlZEFzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg== \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/unsigned_message_encrypted_unsigned_assertion.xml.base64 b/ruby-saml-custom/test/responses/unsigned_message_encrypted_unsigned_assertion.xml.base64 new file mode 100644 index 0000000..96b55d7 --- /dev/null +++ b/ruby-saml-custom/test/responses/unsigned_message_encrypted_unsigned_assertion.xml.base64 @@ -0,0 +1 @@ +PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIElEPSJfOTM2NWZhYTNhNmY2YTIzYjVjZDc1YTc0Y2IwNzg2ZGMxOWU4NDUyMDBlIiBWZXJzaW9uPSIyLjAiIElzc3VlSW5zdGFudD0iMjAxNS0wMy0xOVQxNDowMDozMVoiIERlc3RpbmF0aW9uPSJodHRwOi8vcnVieXNhbWwuY29tOjMwMDAvc2FtbC9hY3MiIEluUmVzcG9uc2VUbz0iXzNhYjdhZGIwLWIwNmUtMDEzMi01YzNiLTAwOTBmNWRlZGQ3NyI+PHNhbWw6SXNzdWVyPmh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/test/responses/valid_response.xml.base64 b/ruby-saml-custom/test/responses/valid_response.xml.base64 new file mode 100644 index 0000000..290db99 --- /dev/null +++ b/ruby-saml-custom/test/responses/valid_response.xml.base64 @@ -0,0 +1 @@ +pVdbk6LIEn4/EfsfDOfRsCkughrdvacEtVFRadBWX05AUQjKTQoF/fVb4mW6e3pmZ/c8aWZlfvllZl2Sxz+LMKgccEr8OHqqsg+g+ufzH/95JFYYJO1XTJI4IrhCjSLSPiufqvs0ascW8Uk7skJM2hlqG1AbtbkH0LYIwWlGoarvXJJf+yRpnMUoDqoVVXmqJm5hoyYnWq5Txy0X1x3etetOUxLqSJAAQDx2AWpWK/MbZ4pBXQnZYzUimRVlVAVYoQ7EOhBMwLU5rg24VbWiYJL5kZWVXl6WJW2GsZLkIdw71kMUM4TEDKLp7kNMAaNb8mb8VP2fiwSLF2xQlzClA1gO15Fl4brU5Gxks7xt883qc1m2dsklfT5HINcQcYSDeO1HDygOmbMR98i8t310SNvw15TcPr1V2yF3lnmeP+T8Q5yuGQ4AwIAWQ20c4q+/VWm3KpWbP3bUyI1LONmK4shHVuCfypQ1nHmxU4HBOk79zAt/As4yLDiD13GB6ogVom9VpgzxPUhJ8jfhPnBNiVUnnsVeEc94r9jFKY4Qrsxe1afqt99tf5mimVoRceM0JB/Ff8YKRwfanAQ7dXJLjhL8Z4BfVu2R+ZGj4q/pLvw3xbsW7jvI3Ar2+Fk9CSs9IDwcrBSbJ80Dmi0Y/hXVevpTSeC9cam4l/wifto29wZfPHRvOAjj6Eim7C6MLMmo4S47Qlw6hJuNzE36qT5ZG5tpYsZoH+qit3zZnkxjlUoZozJDc2IcXmR9p7CpJwQG2ChTprt/GUM527aWUhBws+N6L3Gjmt3LdiuupUStdLQ1nH7q11TpxStGvCg5LjQMT6yRo/SGD11nq7k5VnQOLughEjud/vokmd2nezrv+NOrjCqH+HhPcNEALcXKrLsgn28sl56UDD9rqir3T7IMl7os6/J4jPRFHPLcXIHjznq787Z+v5WDDtRnPah0DE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jS9M1cjBBZ1/WdFtSMC1EeDZBgCSBfhGw3GxJdo8EkRUfU+KUs1wkX2hkgP6hUAHkOdffkSgNjrbUfWU/uRx6kzpNwLtLHbKcSqJ0+xesC/Av1j7oLsX7a69XT33m+k2/D//BQ== diff --git a/ruby-saml-custom/test/responses/valid_response_with_formatted_x509certificate.xml.base64 b/ruby-saml-custom/test/responses/valid_response_with_formatted_x509certificate.xml.base64 new file mode 100644 index 0000000..f5fd530 --- /dev/null +++ b/ruby-saml-custom/test/responses/valid_response_with_formatted_x509certificate.xml.base64 @@ -0,0 +1 @@ +pVdZk6LKEn43wv9gOI+GzSqo0d3nluAuKg3a6ssNKApB2aRQ0F9/SlzG7umeM+feJ80k88svM2vJev4r873SAcXYDYOXMvNEl/96LRaeseF7UfMN4SgMMCoRowA3z8qX8j4OmqGBXdwMDB/hZgKbGlBGTfaJbhoYozghUOUHl+j3PlEcJiEMvXKpL7+UIzszYZ0VDNuqooaNqhZnm1WrLvJVyIs0DTlk07BeLs1vnAkGccV4j/oBTowgISqa4au0UKV5nWabLNuk2VW5JCOcuIGR5F5OkkRNijKi6MnfW8ZTEFIYhxQk6e59RACDW/J6+FL+rw15g+NNuioiQodmWFSFhoGqYp01oclwpsnVy6952Zo5l/j1HAFfQ4QB8sK1GzzB0KfORuwz9Wj7bOGm5q4JuX18q7aF7yzTNH1KuacwXlMsTdMU3aCIjYXd9Y8y6VapdPNHVj+wwxxOMoIwcKHhuac8ZQUlTmiVgLcOYzdx/G/AGYqhz+BVlMEqZPjgR5nKQ/wMkpP8Q7gPXGNsVLFjMFfEM94bslGMAohKs7f+S/nHn7Y/T1GPjQDbYezjj+K/Y4WCA2lOhKwqviVHCP47wC+r9kz9ylF212QV/i/FuxbuJ8jc8PbotX/iV6qHOTBYySaH6wc4W1DcG6x01JecwKNxrriX/CJ+Wjb3Bl88VGc48MPgiKfMzg8MUaugNjOCbDwEm43ETrqxOllrm2mkh3Dvq4Kz7G1PuraKxYTqU0N9oh16krqTmdj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PPE5BrXqtq5aZOk7HrAsuJz0V8Tcjf85zH+NfIF/mNkKQxs94xx7sblCvt9h6HfNJERo7j8PdB5pZXGYTIJJjGwExSfq8fRD9UTL9PbG4Ju5KJzeePb3/ui+Qr506crBWJhuefP+By1hUhVUN4w5mdI5hryD2jdVunecs9XKpkZk9iFl/AfvtwbjkMfkYI/oczwIw/lPTeuRlfGd59P8gd06lM693iJE5x3EPJJgUq5+A9zsUZWAkH4JtvaF6b9wEIZmYoZwa6JtG1CmmNqNC0aNFerWTYyBJODvADLj6QI1QRlyRcqySPvBjKWvP72aQGb8GxH1FPyk4axNSUvB9JZZOVDVhTGyb1gX4B/8e2D7l60u/Z29NxPptuT4PVv \ No newline at end of file diff --git a/ruby-saml-custom/test/responses/valid_response_without_x509certificate.xml.base64 b/ruby-saml-custom/test/responses/valid_response_without_x509certificate.xml.base64 new file mode 100644 index 0000000..55f5139 --- /dev/null +++ b/ruby-saml-custom/test/responses/valid_response_without_x509certificate.xml.base64 @@ -0,0 +1 @@ +pVZdd9o4EH3fc/Y/+LiPOcayDTb4BLoU0oSWfBDTbpuXPbI0Bie25Egi0Pz6lQ04kJI03X2CGY/u3LkjjXT8fpVnxgMImXLWNZ0GMt/3/vzjWOI8K8JrkAVnEgwdxGRYOrvmQrCQY5nKkOEcZKhIGPXPx6HbQCGWEoTSUObOkuL1NYXgihOemcZo2DWLZBWTtuvjhFrQScCiXhJbtB00LdIMECIeJIi0TePrlrPG0EulXMCISYWZ0i7kNC3kW6g5RW7ouiFyb0xjCFKlDKtq1VypIrRtXBSNfEFxg3FbSm4TXe4iBw3ItsVPedf8JyFN7DVjZAWg6SDHBYtgDFbQdmMSO14ce22zV8kWVlxEr8wgNyk4g4zPUtYgPLfLIPfY3o09pjKM0pkmtxBbtamsWS6Xy8bSa3Axs12EkI06to6hMp29M3W3DGO7HuiIJbyCG2DGWUpwlj5WJZ+DmnNq9LMZF6ma5y+AO7aDSnALVsQiTpO9M+0qxVOSiuQb4fa4CoktOcfOBrHEu4YEBDACxpfrUdd899b2VyVOBWYy4SKX++bvsQL2oJtTALXktjhN8PcAD6p2bP/McZjO9C78L+JthHsC+YqzBfRGj82bSSa9/qebYezJ9gP58s32rsnRx0m3IrAbXDlqydfms21TN3i9YjL//Cnn7Ie8cu5zhoPoCE6cMXHF5/7t7cC9PBWTy1l0e1VMOVnkE3/+/ezucRrdiEDZI/vz9DJ6OBtM7oeOmDezCN0Or+yTxdlFf6DuOt+DLHO//JgtAnd8FH9U9zduZ8g6YnwX0VORHo2Cs/lq7PkBTfpRNPeP5I/gb3g4oXfnyRKGE7f/TR8i/8OH09ljMD3p1uXs8NejbM/b20y2SGlT7lsDTsGolr0+sGQVHUYLQkDKqtE/g4b97SjcHOfVS8fZsb+djyMyhxybdWz662ArrcYdgZ9m4XqMdlqOH6PEs5otz7cclPgW8RNsdShtuR44zU6bvGlw/o+xVhnRIr4FojbWhdZzNDQ+6iOB1ctCOw2n8qTUSqrQUJecZn1KRSl6T+lN/ddu/k3mNfx+5gFnSVpilN1Yn73XO0zyMAYsQJgvAw2xwsYFV5fsUvQTBaJUz0M76gXra+caSFqkUMortn/rTXMI+dmnDQUdQdPysyyzfgCtClQNc55SOpuUb6C13aULmpazQF92SqRknX7vS91wyXPQgjdghfMig6rneBO0YVyveWbvodvPyqnzqTkrTxDkWiCjMn9xoUd6J2iEF6ptHQgdMQorfZ07ftIKUBIT5DkthAKMvFaLJoD92CNNn5i7pDRVBSt1wDXI9INHz9Peq28iEpIyTruv9M+SC3qlnzy6s0Cr26HgQtWCHQA/8G3PV4tWe7ejp55M27dM718= \ No newline at end of file diff --git a/ruby-saml-custom/test/saml_message_test.rb b/ruby-saml-custom/test/saml_message_test.rb new file mode 100644 index 0000000..1a39c6f --- /dev/null +++ b/ruby-saml-custom/test/saml_message_test.rb @@ -0,0 +1,86 @@ +require File.expand_path(File.join(File.dirname(__FILE__), "test_helper")) + +class RubySamlTest < Minitest::Test + + describe "SamlMessage" do + + let(:settings) { OneLogin::RubySaml::Settings.new } + let(:saml_message) { OneLogin::RubySaml::SamlMessage.new } + let(:response_document) { read_response("response_unsigned_xml_base64") } + let(:response_document_xml) { read_response("adfs_response_xmlns.xml") } + + it "return decoded raw saml" do + decoded_raw = saml_message.send(:decode_raw_saml, logout_request_deflated_base64) + assert logout_request_document, decoded_raw + end + + it "return encoded raw saml" do + settings.compress_request = true + encoded_raw = saml_message.send(:encode_raw_saml, logout_request_document, settings) + assert logout_request_deflated_base64, encoded_raw + + settings.compress_request = false + deflated = saml_message.send(:deflate, logout_request_deflated_base64) + encoded_raw = saml_message.send(:encode_raw_saml, deflated, settings) + assert logout_request_deflated_base64, encoded_raw + end + + it "return decoded string" do + decoded = saml_message.send(:decode, response_document) + assert response_document_xml, decoded + + decoded = saml_message.send(:decode, logout_request_base64) + assert logout_request_document, decoded + end + + it "return encoded string" do + encoded = saml_message.send(:encode, response_document_xml) + assert response_document, encoded + + encoded = saml_message.send(:encode, logout_request_document) + assert logout_request_base64, encoded + end + + it "return deflated string" do + deflated = saml_message.send(:deflate, logout_request_document) + encoded_deflated = saml_message.send(:encode, deflated) + assert logout_request_deflated_base64, encoded_deflated + end + + it "return inflated string" do + decoded = saml_message.send(:decode, logout_request_deflated_base64) + decoded_inflated = saml_message.send(:inflate, decoded) + assert response_document_xml, decoded_inflated + end + + describe "Prevent Zlib bomb attack" do + let(:bomb) { Base64.encode64(Zlib::Deflate.deflate(bomb_data, 9)[2..-5]) } + let(:bomb_data) { bomb_prefix + "A" * (200000 * 1024) + bomb_suffix } + let(:bomb_prefix) { """ + + """ } + let(:bomb_suffix) { """ + ONELOGIN_f92cc1834efc0f73e9c09f482fce80037a6251e7 + """ } + + it "raises error when SAML Message exceed the allowed bytes" do + assert_raises(OneLogin::RubySaml::ValidationError, "Encoded SAML Message exceeds #{OneLogin::RubySaml::Settings::DEFAULTS[:message_max_bytesize]} bytes, so was rejected") do + saml_message = OneLogin::RubySaml::SamlMessage.new + saml_message.send(:decode_raw_saml, bomb) + end + end + + describe 'with a custom setting for message_max_bytesize' do + let(:message_max_bytesize) { 100_00 } + let(:settings) { OneLogin::RubySaml::Settings.new({:message_max_bytesize => message_max_bytesize}) } + + it 'uses the custom setting' do + assert_raises(OneLogin::RubySaml::ValidationError, "Encoded SAML Message exceeds #{message_max_bytesize} bytes, so was rejected") do + saml_message = OneLogin::RubySaml::SamlMessage.new + saml_message.send(:decode_raw_saml, bomb, settings) + end + end + end + end + end +end diff --git a/ruby-saml-custom/test/settings_test.rb b/ruby-saml-custom/test/settings_test.rb new file mode 100644 index 0000000..1882645 --- /dev/null +++ b/ruby-saml-custom/test/settings_test.rb @@ -0,0 +1,401 @@ +require File.expand_path(File.join(File.dirname(__FILE__), "test_helper")) + +require 'onelogin/ruby-saml/settings' +require 'onelogin/ruby-saml/validation_error' + +class SettingsTest < Minitest::Test + + describe "Settings" do + before do + @settings = OneLogin::RubySaml::Settings.new + end + + it "should provide getters and settings" do + accessors = [ + :idp_entity_id, :idp_sso_target_url, :idp_sso_service_url, :idp_slo_target_url, :idp_slo_service_url, :valid_until, + :idp_cert, :idp_cert_fingerprint, :idp_cert_fingerprint_algorithm, :idp_cert_multi, + :idp_attribute_names, :issuer, :assertion_consumer_service_url, :single_logout_service_url, + :sp_name_qualifier, :name_identifier_format, :name_identifier_value, :name_identifier_value_requested, + :sessionindex, :attributes_index, :passive, :force_authn, + :compress_request, :double_quote_xml_attribute_values, :message_max_bytesize, + :security, :certificate, :private_key, + :authn_context, :authn_context_comparison, :authn_context_decl_ref, + :assertion_consumer_logout_service_url + ] + + accessors.each do |accessor| + value = Kernel.rand + @settings.send("#{accessor}=".to_sym, value) + assert_equal value, @settings.send(accessor) + + @settings.send("#{accessor}=".to_sym, nil) + assert_nil @settings.send(accessor) + end + end + + it "should provide getters and settings for binding parameters" do + accessors = [ + :protocol_binding, :assertion_consumer_service_binding, + :single_logout_service_binding, :assertion_consumer_logout_service_binding + ] + + accessors.each do |accessor| + value = Kernel.rand.to_s + @settings.send("#{accessor}=".to_sym, value) + assert_equal value, @settings.send(accessor) + + @settings.send("#{accessor}=".to_sym, :redirect) + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", @settings.send(accessor) + + @settings.send("#{accessor}=".to_sym, :post) + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST", @settings.send(accessor) + + @settings.send("#{accessor}=".to_sym, nil) + assert_nil @settings.send(accessor) + end + end + + it "idp_sso/slo_service_binding should fallback to :embed_sign inferred value" do + accessors = [:idp_sso_service_binding, :idp_slo_service_binding] + + accessors.each do |accessor| + @settings.security[:embed_sign] = true + + value = Kernel.rand.to_s + @settings.send("#{accessor}=".to_sym, value) + assert_equal value, @settings.send(accessor) + + @settings.send("#{accessor}=".to_sym, :redirect) + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", @settings.send(accessor) + + @settings.send("#{accessor}=".to_sym, :post) + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST", @settings.send(accessor) + + @settings.send("#{accessor}=".to_sym, nil) + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST", @settings.send(accessor) + + @settings.security[:embed_sign] = false + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", @settings.send(accessor) + end + end + + it "create settings from hash" do + config = { + :assertion_consumer_service_url => "http://app.muda.no/sso", + :issuer => "http://muda.no", + :sp_name_qualifier => "http://sso.muda.no", + :idp_sso_service_url => "http://sso.muda.no/sso", + :idp_sso_service_binding => "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST", + :idp_slo_service_url => "http://sso.muda.no/slo", + :idp_slo_service_binding => "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST", + :idp_cert_fingerprint => "00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00", + :message_max_bytesize => 750000, + :valid_until => '2029-04-16T03:35:08.277Z', + :name_identifier_format => "urn:oasis:names:tc:SAML:2.0:nameid-format:transient", + :attributes_index => 30, + :passive => true, + :protocol_binding => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST' + } + @settings = OneLogin::RubySaml::Settings.new(config) + + config.each do |k,v| + assert_equal v, @settings.send(k) + end + end + + it "configure attribute service attributes correctly" do + @settings.attribute_consuming_service.configure do + service_name "Test Service" + add_attribute :name => "Name", :name_format => "Name Format", :friendly_name => "Friendly Name" + end + + assert_equal @settings.attribute_consuming_service.configured?, true + assert_equal @settings.attribute_consuming_service.name, "Test Service" + assert_equal @settings.attribute_consuming_service.attributes, [{:name => "Name", :name_format => "Name Format", :friendly_name => "Friendly Name" }] + end + + it "does not modify default security settings" do + settings = OneLogin::RubySaml::Settings.new + settings.security[:authn_requests_signed] = true + settings.security[:embed_sign] = true + settings.security[:digest_method] = XMLSecurity::Document::SHA256 + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA256 + + new_settings = OneLogin::RubySaml::Settings.new + assert_equal new_settings.security[:authn_requests_signed], false + assert_equal new_settings.security[:embed_sign], false + assert_equal new_settings.security[:digest_method], XMLSecurity::Document::SHA1 + assert_equal new_settings.security[:signature_method], XMLSecurity::Document::RSA_SHA1 + end + + it "overrides only provided security attributes passing a second parameter" do + config = { + :security => { + :metadata_signed => true + } + } + + @default_attributes = OneLogin::RubySaml::Settings::DEFAULTS + + @settings = OneLogin::RubySaml::Settings.new(config, true) + assert_equal @settings.security[:metadata_signed], true + assert_equal @settings.security[:digest_method], @default_attributes[:security][:digest_method] + end + + it "doesn't override only provided security attributes without passing a second parameter" do + config = { + :security => { + :metadata_signed => true + } + } + + @default_attributes = OneLogin::RubySaml::Settings::DEFAULTS + + @settings = OneLogin::RubySaml::Settings.new(config) + assert_equal @settings.security[:metadata_signed], true + assert_nil @settings.security[:digest_method] + end + + describe "#single_logout_service_url" do + it "when single_logout_service_url is nil but assertion_consumer_logout_service_url returns its value" do + @settings.single_logout_service_url = nil + @settings.assertion_consumer_logout_service_url = "http://app.muda.no/sls" + + assert_equal "http://app.muda.no/sls", @settings.single_logout_service_url + end + end + + describe "#single_logout_service_binding" do + it "when single_logout_service_binding is nil but assertion_consumer_logout_service_binding returns its value" do + @settings.single_logout_service_binding = nil + @settings.assertion_consumer_logout_service_binding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" + + assert_equal "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", @settings.single_logout_service_binding + end + end + + describe "#idp_sso_service_url" do + it "when idp_sso_service_url is nil but idp_sso_target_url returns its value" do + @settings.idp_sso_service_url = nil + @settings.idp_sso_target_url = "https://idp.example.com/sso" + + assert_equal "https://idp.example.com/sso", @settings.idp_sso_service_url + end + end + + describe "#idp_slo_service_url" do + it "when idp_slo_service_url is nil but idp_slo_target_url returns its value" do + @settings.idp_slo_service_url = nil + @settings.idp_slo_target_url = "https://idp.example.com/slo" + + assert_equal "https://idp.example.com/slo", @settings.idp_slo_service_url + end + end + + describe "#get_idp_cert" do + it "returns nil when the cert is an empty string" do + @settings.idp_cert = "" + assert_nil @settings.get_idp_cert + end + + it "returns nil when the cert is nil" do + @settings.idp_cert = nil + assert_nil @settings.get_idp_cert + end + + it "returns the certificate when it is valid" do + @settings.idp_cert = ruby_saml_cert_text + assert @settings.get_idp_cert.kind_of? OpenSSL::X509::Certificate + end + + it "raises when the certificate is not valid" do + # formatted but invalid cert + @settings.idp_cert = read_certificate("formatted_certificate") + assert_raises(OpenSSL::X509::CertificateError) { + @settings.get_idp_cert + } + end + end + + describe "#get_idp_cert_multi" do + it "returns nil when the value is empty" do + @settings.idp_cert = {} + assert_nil @settings.get_idp_cert_multi + end + + it "returns nil when the idp_cert_multi is nil or empty" do + @settings.idp_cert_multi = nil + assert_nil @settings.get_idp_cert_multi + end + + it "returns partial hash when contains some values" do + empty_multi = { + :signing => [], + :encryption => [] + } + + @settings.idp_cert_multi = { + :signing => [] + } + assert_equal empty_multi, @settings.get_idp_cert_multi + + @settings.idp_cert_multi = { + :encryption => [] + } + assert_equal empty_multi, @settings.get_idp_cert_multi + + @settings.idp_cert_multi = { + :signing => [], + :encryption => [] + } + assert_equal empty_multi, @settings.get_idp_cert_multi + + @settings.idp_cert_multi = { + :yyy => [], + :zzz => [] + } + assert_equal empty_multi, @settings.get_idp_cert_multi + end + + it "returns the hash with certificates when values were valid" do + certificates = ruby_saml_cert_text + @settings.idp_cert_multi = { + :signing => [ruby_saml_cert_text], + :encryption => [ruby_saml_cert_text], + } + + assert @settings.get_idp_cert_multi.kind_of? Hash + assert @settings.get_idp_cert_multi[:signing].kind_of? Array + assert @settings.get_idp_cert_multi[:encryption].kind_of? Array + assert @settings.get_idp_cert_multi[:signing][0].kind_of? OpenSSL::X509::Certificate + assert @settings.get_idp_cert_multi[:encryption][0].kind_of? OpenSSL::X509::Certificate + end + + it "raises when there is a cert in idp_cert_multi not valid" do + certificate = read_certificate("formatted_certificate") + + @settings.idp_cert_multi = { + :signing => [], + :encryption => [] + } + @settings.idp_cert_multi[:signing].push(certificate) + @settings.idp_cert_multi[:encryption].push(certificate) + + assert_raises(OpenSSL::X509::CertificateError) { + @settings.get_idp_cert_multi + } + end + end + + describe "#get_sp_cert" do + it "returns nil when the cert is an empty string" do + @settings.certificate = "" + assert_nil @settings.get_sp_cert + end + + it "returns nil when the cert is nil" do + @settings.certificate = nil + assert_nil @settings.get_sp_cert + end + + it "returns the certificate when it is valid" do + @settings.certificate = ruby_saml_cert_text + assert @settings.get_sp_cert.kind_of? OpenSSL::X509::Certificate + end + + it "raises when the certificate is not valid" do + # formatted but invalid cert + @settings.certificate = read_certificate("formatted_certificate") + assert_raises(OpenSSL::X509::CertificateError) { @settings.get_sp_cert } + end + + it "raises an error if SP certificate expired and check_sp_cert_expiration enabled" do + @settings.certificate = ruby_saml_cert_text + @settings.security[:check_sp_cert_expiration] = true + assert_raises(OneLogin::RubySaml::ValidationError) { @settings.get_sp_cert } + end + end + + describe "#get_sp_cert_new" do + it "returns nil when the cert is an empty string" do + @settings.certificate_new = "" + assert_nil @settings.get_sp_cert_new + end + + it "returns nil when the cert is nil" do + @settings.certificate_new = nil + assert_nil @settings.get_sp_cert_new + end + + it "returns the certificate when it is valid" do + @settings.certificate_new = ruby_saml_cert_text + assert @settings.get_sp_cert_new.kind_of? OpenSSL::X509::Certificate + end + + it "raises when the certificate is not valid" do + # formatted but invalid cert + @settings.certificate_new = read_certificate("formatted_certificate") + assert_raises(OpenSSL::X509::CertificateError) { + @settings.get_sp_cert_new + } + end + + end + + describe "#get_sp_key" do + it "returns nil when the private key is an empty string" do + @settings.private_key = "" + assert_nil @settings.get_sp_key + end + + it "returns nil when the private key is nil" do + @settings.private_key = nil + assert_nil @settings.get_sp_key + end + + it "returns the private key when it is valid" do + @settings.private_key = ruby_saml_key_text + assert @settings.get_sp_key.kind_of? OpenSSL::PKey::RSA + end + + it "raises when the private key is not valid" do + # formatted but invalid rsa private key + @settings.private_key = read_certificate("formatted_rsa_private_key") + assert_raises(OpenSSL::PKey::RSAError) { + @settings.get_sp_key + } + end + + end + + describe "#get_fingerprint" do + it "get the fingerprint value when cert and fingerprint in settings are nil" do + @settings.idp_cert_fingerprint = nil + @settings.idp_cert = nil + fingerprint = @settings.get_fingerprint + assert_nil fingerprint + end + + it "get the fingerprint value when there is a cert at the settings" do + @settings.idp_cert_fingerprint = nil + @settings.idp_cert = ruby_saml_cert_text + fingerprint = @settings.get_fingerprint + assert fingerprint.downcase == ruby_saml_cert_fingerprint.downcase + end + + it "get the fingerprint value when there is a fingerprint at the settings" do + @settings.idp_cert_fingerprint = ruby_saml_cert_fingerprint + @settings.idp_cert = nil + fingerprint = @settings.get_fingerprint + assert fingerprint.downcase == ruby_saml_cert_fingerprint.downcase + end + + it "get the fingerprint value when there are cert and fingerprint at the settings" do + @settings.idp_cert_fingerprint = ruby_saml_cert_fingerprint + @settings.idp_cert = ruby_saml_cert_text + fingerprint = @settings.get_fingerprint + assert fingerprint.downcase == ruby_saml_cert_fingerprint.downcase + end + end + end +end diff --git a/ruby-saml-custom/test/slo_logoutrequest_test.rb b/ruby-saml-custom/test/slo_logoutrequest_test.rb new file mode 100644 index 0000000..617ec22 --- /dev/null +++ b/ruby-saml-custom/test/slo_logoutrequest_test.rb @@ -0,0 +1,534 @@ +require File.expand_path(File.join(File.dirname(__FILE__), "test_helper")) +require 'logout_responses/logoutresponse_fixtures' + +require 'onelogin/ruby-saml/slo_logoutrequest' +require 'timecop' + +class RubySamlTest < Minitest::Test + + describe "SloLogoutrequest" do + + let(:settings) { OneLogin::RubySaml::Settings.new } + let(:logout_request) { OneLogin::RubySaml::SloLogoutrequest.new(logout_request_document) } + let(:invalid_logout_request) { OneLogin::RubySaml::SloLogoutrequest.new(invalid_logout_request_document) } + + before do + settings.idp_entity_id = 'https://app.onelogin.com/saml/metadata/SOMEACCOUNT' + settings.soft = true + logout_request.settings = settings + invalid_logout_request.settings = settings + end + + describe "initiator" do + it "raise an exception when logout request is initialized with nil" do + assert_raises(ArgumentError) { OneLogin::RubySaml::SloLogoutrequest.new(nil) } + end + end + + describe "#is_valid?" do + it "return false when logout request is initialized with blank data" do + logout_request_blank = OneLogin::RubySaml::SloLogoutrequest.new('') + assert !logout_request_blank.is_valid? + assert_includes logout_request_blank.errors, 'Blank logout request' + end + + it "return true when the logout request is initialized with valid data" do + assert logout_request.is_valid? + assert_empty logout_request.errors + assert_equal 'someone@example.org', logout_request.nameid + end + + it "should be idempotent when the logout request is initialized with invalid data" do + assert !invalid_logout_request.is_valid? + assert_equal ['Invalid SAML Logout Request. Not match the saml-schema-protocol-2.0.xsd'], invalid_logout_request.errors + assert !invalid_logout_request.is_valid? + assert_equal ['Invalid SAML Logout Request. Not match the saml-schema-protocol-2.0.xsd'], invalid_logout_request.errors + end + + it "should be idempotent when the logout request is initialized with valid data" do + assert logout_request.is_valid? + assert_empty logout_request.errors + assert logout_request.is_valid? + assert_empty logout_request.errors + end + + it "collect errors when collect_errors=true" do + settings.idp_entity_id = 'http://idp.example.com/invalid' + settings.security[:logout_requests_signed] = true + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + settings.idp_cert = ruby_saml_cert_text + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + params = {} + params['SAMLRequest'] = logout_request_deflated_base64 + params['RelayState'] = 'http://invalid.example.com' + params['Signature'] = 'invalid_signature' + params['SigAlg'] = XMLSecurity::Document::RSA_SHA1 + options = {} + options[:get_params] = params + + logout_request_sign_test = OneLogin::RubySaml::SloLogoutrequest.new(params['SAMLRequest'], options) + logout_request_sign_test.settings = settings + + collect_errors = true + assert !logout_request_sign_test.is_valid?(collect_errors) + assert_includes logout_request_sign_test.errors, "Invalid Signature on Logout Request" + assert_includes logout_request_sign_test.errors, "Doesn't match the issuer, expected: , but was: " + end + + it "raise error for invalid xml" do + invalid_logout_request.soft = false + assert_raises(OneLogin::RubySaml::ValidationError) { invalid_logout_request.is_valid? } + end + + end + + describe "#nameid" do + it "extract the value of the name id element" do + assert_equal "someone@example.org", logout_request.nameid + end + end + + describe "#nameid_format" do + let(:logout_request) { OneLogin::RubySaml::SloLogoutrequest.new(logout_request_document_with_name_id_format) } + + it "extract the format attribute of the name id element" do + assert_equal "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", logout_request.nameid_format + end + end + + describe "#issuer" do + it "return the issuer inside the logout request" do + assert_equal "https://app.onelogin.com/saml/metadata/SOMEACCOUNT", logout_request.issuer + end + end + + describe "#id" do + it "extract the value of the ID attribute" do + assert_equal "_c0348950-935b-0131-1060-782bcb56fcaa", logout_request.id + end + end + + describe "#not_on_or_after" do + it "extract the value of the NotOnOrAfter attribute" do + time_value = '2014-07-17T01:01:48Z' + assert_nil logout_request.not_on_or_after + logout_request.document.root.attributes['NotOnOrAfter'] = time_value + assert_equal Time.parse(time_value), logout_request.not_on_or_after + end + end + + describe '#session_indexes' do + it "return empty array when no SessionIndex" do + assert_equal [], logout_request.session_indexes + end + + it "return an Array with one SessionIndex" do + logout_request_with_session_index = OneLogin::RubySaml::SloLogoutrequest.new(logout_request_xml_with_session_index) + assert_equal ['_ea853497-c58a-408a-bc23-c849752d9741'], logout_request_with_session_index.session_indexes + end + end + + describe "#validate_id" do + it "return true when there is a valid ID in the logout request" do + assert logout_request.send(:validate_id) + assert_empty logout_request.errors + end + + it "return false when there is an invalid ID in the logout request" do + logout_request_blank = OneLogin::RubySaml::SloLogoutrequest.new('') + assert !logout_request_blank.send(:validate_id) + assert_includes logout_request_blank.errors, "Missing ID attribute on Logout Request" + end + end + + describe "#validate_version" do + it "return true when the logout request is SAML 2.0 Version" do + assert logout_request.send(:validate_version) + end + + it "return false when the logout request is not SAML 2.0 Version" do + logout_request_blank = OneLogin::RubySaml::SloLogoutrequest.new('') + assert !logout_request_blank.send(:validate_version) + assert_includes logout_request_blank.errors, "Unsupported SAML version" + end + end + + describe "#validate_not_on_or_after" do + it "return true when the logout request has a valid NotOnOrAfter or does not contain any" do + assert logout_request.send(:validate_not_on_or_after) + assert_empty logout_request.errors + + Timecop.freeze Time.parse('2014-07-17T01:01:47Z') do + logout_request.document.root.attributes['NotOnOrAfter'] = '2014-07-17T01:01:48Z' + assert logout_request.send(:validate_not_on_or_after) + assert_empty logout_request.errors + end + end + + it "return false when the logout request has an invalid NotOnOrAfter" do + Timecop.freeze Time.parse('2014-07-17T01:01:49Z') do + logout_request.document.root.attributes['NotOnOrAfter'] = '2014-07-17T01:01:48Z' + assert !logout_request.send(:validate_not_on_or_after) + assert /Current time is on or after NotOnOrAfter/.match(logout_request.errors[0]) + end + end + + it "raise when the logout request has an invalid NotOnOrAfter" do + Timecop.freeze Time.parse('2014-07-17T01:01:49Z') do + logout_request.document.root.attributes['NotOnOrAfter'] = '2014-07-17T01:01:48Z' + logout_request.soft = false + assert_raises(OneLogin::RubySaml::ValidationError, "Current time is on or after NotOnOrAfter") do + logout_request.send(:validate_not_on_or_after) + end + end + end + + it "optionally allows for clock drift" do + # Java Floats behave differently than MRI + java = defined?(RUBY_ENGINE) && %w[jruby truffleruby].include?(RUBY_ENGINE) + + logout_request.soft = true + logout_request.document.root.attributes['NotOnOrAfter'] = '2011-06-14T18:31:01.516Z' + + # The NotBefore condition in the document is 2011-06-1418:31:01.516Z + Timecop.freeze(Time.parse("2011-06-14T18:31:02Z")) do + logout_request.options[:allowed_clock_drift] = 0.483 + assert !logout_request.send(:validate_not_on_or_after) + + logout_request.options[:allowed_clock_drift] = java ? 0.485 : 0.484 + assert logout_request.send(:validate_not_on_or_after) + + logout_request.options[:allowed_clock_drift] = '0.483' + assert !logout_request.send(:validate_not_on_or_after) + + logout_request.options[:allowed_clock_drift] = java ? '0.485' : '0.484' + assert logout_request.send(:validate_not_on_or_after) + end + end + end + + describe "#validate_request_state" do + it "return true when valid logout request xml" do + assert logout_request.send(:validate_request_state) + assert_empty logout_request.errors + assert logout_request.send(:validate_request_state) + assert_empty logout_request.errors + end + + it "return false when invalid logout request xml" do + logout_request_blank = OneLogin::RubySaml::SloLogoutrequest.new('') + logout_request_blank.soft = true + assert !logout_request_blank.send(:validate_request_state) + assert_includes logout_request_blank.errors, "Blank logout request" + end + + it "raise error for invalid xml" do + logout_request_blank = OneLogin::RubySaml::SloLogoutrequest.new('') + logout_request_blank.soft = false + assert_raises(OneLogin::RubySaml::ValidationError, "Blank logout request") do + logout_request_blank.send(:validate_request_state) + end + end + end + + describe "#validate_structure" do + it "return true when encountering a valid Logout Request xml" do + assert logout_request.send(:validate_structure) + assert_empty logout_request.errors + end + + it "return false when encountering a Logout Request bad formatted" do + assert !invalid_logout_request.send(:validate_structure) + assert_includes invalid_logout_request.errors, "Invalid SAML Logout Request. Not match the saml-schema-protocol-2.0.xsd" + end + + it "raise when encountering a Logout Request bad formatted" do + invalid_logout_request.soft = false + assert_raises(OneLogin::RubySaml::ValidationError, "Element '{urn:oasis:names:tc:SAML:2.0:assertion}Issuer': This element is not expected") do + invalid_logout_request.send(:validate_structure) + end + end + end + + describe "#validate_issuer" do + it "return true when the issuer of the Logout Request matchs the IdP entityId" do + logout_request.settings.idp_entity_id = 'https://app.onelogin.com/saml/metadata/SOMEACCOUNT' + assert logout_request.send(:validate_issuer) + end + it "return false when the issuer of the Logout Request does not match the IdP entityId" do + logout_request.settings.idp_entity_id = 'http://idp.example.com/invalid' + assert !logout_request.send(:validate_issuer) + assert_includes logout_request.errors, "Doesn't match the issuer, expected: <#{logout_request.settings.idp_entity_id}>, but was: " + end + it "raise when the issuer of the Logout Request does not match the IdP entityId" do + logout_request.settings.idp_entity_id = 'http://idp.example.com/invalid' + logout_request.soft = false + assert_raises(OneLogin::RubySaml::ValidationError, "Doesn't match the issuer, expected: <#{logout_request.settings.idp_entity_id}>, but was: ") do + logout_request.send(:validate_issuer) + end + end + end + + describe "#validate_signature" do + before do + settings.security[:logout_requests_signed] = true + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + settings.idp_cert = ruby_saml_cert_text + end + + it "return true when no idp_cert is provided and option :relax_signature_validation is present" do + settings.idp_cert = nil + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + params = OneLogin::RubySaml::Logoutrequest.new.create_params(settings, :RelayState => 'http://example.com') + params['RelayState'] = params[:RelayState] + options = {} + options[:get_params] = params + options[:relax_signature_validation] = true + logout_request_sign_test = OneLogin::RubySaml::SloLogoutrequest.new(params['SAMLRequest'], options) + logout_request_sign_test.settings = settings + assert logout_request_sign_test.send(:validate_signature) + end + + it "return false when no idp_cert is provided and no option :relax_signature_validation is present" do + settings.idp_cert = nil + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + params = OneLogin::RubySaml::Logoutrequest.new.create_params(settings, :RelayState => 'http://example.com') + params['RelayState'] = params[:RelayState] + options = {} + options[:get_params] = params + logout_request_sign_test = OneLogin::RubySaml::SloLogoutrequest.new(params['SAMLRequest'], options) + logout_request_sign_test.settings = settings + assert !logout_request_sign_test.send(:validate_signature) + end + + it "return true when valid RSA_SHA1 Signature" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + params = OneLogin::RubySaml::Logoutrequest.new.create_params(settings, :RelayState => 'http://example.com') + params['RelayState'] = params[:RelayState] + options = {} + options[:get_params] = params + logout_request_sign_test = OneLogin::RubySaml::SloLogoutrequest.new(params['SAMLRequest'], options) + logout_request_sign_test.settings = settings + assert logout_request_sign_test.send(:validate_signature) + end + + it "return true when valid RSA_SHA256 Signature" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA256 + params = OneLogin::RubySaml::Logoutrequest.new.create_params(settings, :RelayState => 'http://example.com') + options = {} + options[:get_params] = params + logout_request_sign_test = OneLogin::RubySaml::SloLogoutrequest.new(params['SAMLRequest'], options) + params['RelayState'] = params[:RelayState] + logout_request_sign_test.settings = settings + assert logout_request_sign_test.send(:validate_signature) + end + + it "return false when invalid RSA_SHA1 Signature" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + params = OneLogin::RubySaml::Logoutrequest.new.create_params(settings, :RelayState => 'http://example.com') + params['RelayState'] = 'http://invalid.example.com' + params[:RelayState] = params['RelayState'] + options = {} + options[:get_params] = params + + logout_request_sign_test = OneLogin::RubySaml::SloLogoutrequest.new(params['SAMLRequest'], options) + logout_request_sign_test.settings = settings + assert !logout_request_sign_test.send(:validate_signature) + end + + it "raise when invalid RSA_SHA1 Signature" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + settings.soft = false + params = OneLogin::RubySaml::Logoutrequest.new.create_params(settings, :RelayState => 'http://example.com') + params['RelayState'] = 'http://invalid.example.com' + params[:RelayState] = params['RelayState'] + options = {} + options[:get_params] = params + options[:settings] = settings + + logout_request_sign_test = OneLogin::RubySaml::SloLogoutrequest.new(params['SAMLRequest'], options) + assert_raises(OneLogin::RubySaml::ValidationError, "Invalid Signature on Logout Request") do + logout_request_sign_test.send(:validate_signature) + end + end + + it "raise when get_params encoding differs from what this library generates" do + # Use Logoutrequest only to build the SAMLRequest parameter. + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + settings.soft = false + params = OneLogin::RubySaml::Logoutrequest.new.create_params(settings, "RelayState" => "http://example.com") + # Assemble query string. + query = OneLogin::RubySaml::Utils.build_query( + :type => 'SAMLRequest', + :data => params['SAMLRequest'], + :relay_state => params['RelayState'], + :sig_alg => params['SigAlg'] + ) + # Modify the query string so that it encodes the same values, + # but with different percent-encoding. Sanity-check that they + # really are equialent before moving on. + original_query = query.dup + query.gsub!("example", "ex%61mple") + refute_equal(query, original_query) + assert_equal(CGI.unescape(query), CGI.unescape(original_query)) + # Make normalised signature based on our modified params. + sign_algorithm = XMLSecurity::BaseDocument.new.algorithm(settings.security[:signature_method]) + signature = settings.get_sp_key.sign(sign_algorithm.new, query) + params['Signature'] = Base64.encode64(signature).gsub(/\n/, "") + # Construct SloLogoutrequest and ask it to validate the signature. + # It will do it incorrectly, because it will compute it based on re-encoded + # query parameters, rather than their original encodings. + options = {} + options[:get_params] = params + options[:settings] = settings + logout_request_sign_test = OneLogin::RubySaml::SloLogoutrequest.new(params['SAMLRequest'], options) + assert_raises(OneLogin::RubySaml::ValidationError, "Invalid Signature on Logout Request") do + logout_request_sign_test.send(:validate_signature) + end + end + + it "return true even if raw_get_params encoding differs from what this library generates" do + # Use Logoutrequest only to build the SAMLRequest parameter. + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + settings.soft = false + params = OneLogin::RubySaml::Logoutrequest.new.create_params(settings, "RelayState" => "http://example.com") + # Assemble query string. + query = OneLogin::RubySaml::Utils.build_query( + :type => 'SAMLRequest', + :data => params['SAMLRequest'], + :relay_state => params['RelayState'], + :sig_alg => params['SigAlg'] + ) + # Modify the query string so that it encodes the same values, + # but with different percent-encoding. Sanity-check that they + # really are equialent before moving on. + original_query = query.dup + query.gsub!("example", "ex%61mple") + refute_equal(query, original_query) + assert_equal(CGI.unescape(query), CGI.unescape(original_query)) + # Make normalised signature based on our modified params. + sign_algorithm = XMLSecurity::BaseDocument.new.algorithm(settings.security[:signature_method]) + signature = settings.get_sp_key.sign(sign_algorithm.new, query) + params['Signature'] = Base64.encode64(signature).gsub(/\n/, "") + # Construct SloLogoutrequest and ask it to validate the signature. + # Provide the altered parameter in its raw URI-encoded form, + # so that we don't have to guess the value that contributed to the signature. + options = {} + options[:get_params] = params + options[:get_params].delete("RelayState") + options[:raw_get_params] = { + "RelayState" => "http%3A%2F%2Fex%61mple.com", + } + options[:settings] = settings + logout_request_sign_test = OneLogin::RubySaml::SloLogoutrequest.new(params['SAMLRequest'], options) + assert logout_request_sign_test.send(:validate_signature) + end + + it "handles Azure AD downcased request encoding" do + # Use Logoutrequest only to build the SAMLRequest parameter. + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA256 + settings.soft = false + + # Creating the query manually to tweak it later instead of using + # OneLogin::RubySaml::Utils.build_query + request_doc = OneLogin::RubySaml::Logoutrequest.new.create_logout_request_xml_doc(settings) + request = Zlib::Deflate.deflate(request_doc.to_s, 9)[2..-5] + base64_request = Base64.encode64(request).gsub(/\n/, "") + # The original request received from Azure AD comes with downcased + # encoded characters, like %2f instead of %2F, and the signature they + # send is based on this base64 request. + params = { + 'SAMLRequest' => downcased_escape(base64_request), + 'SigAlg' => downcased_escape(settings.security[:signature_method]), + } + # Assemble query string. + query = "SAMLRequest=#{params['SAMLRequest']}&SigAlg=#{params['SigAlg']}" + # Make normalised signature based on our modified params. + sign_algorithm = XMLSecurity::BaseDocument.new.algorithm( + settings.security[:signature_method] + ) + signature = settings.get_sp_key.sign(sign_algorithm.new, query) + params['Signature'] = downcased_escape(Base64.encode64(signature).gsub(/\n/, "")) + + # Then parameters are usually unescaped, like we manage them in rails + params = params.map { |k, v| [k, CGI.unescape(v)] }.to_h + # Construct SloLogoutrequest and ask it to validate the signature. + # It will fail because the signature is based on the downcased request + logout_request_downcased_test = OneLogin::RubySaml::SloLogoutrequest.new( + params['SAMLRequest'], get_params: params, settings: settings, + ) + assert_raises(OneLogin::RubySaml::ValidationError, "Invalid Signature on Logout Request") do + logout_request_downcased_test.send(:validate_signature) + end + + # For this case, the parameters will be forced to be downcased after + # being escaped with :lowercase_url_encoding security option + settings.security[:lowercase_url_encoding] = true + logout_request_force_downcasing_test = OneLogin::RubySaml::SloLogoutrequest.new( + params['SAMLRequest'], get_params: params, settings: settings + ) + assert logout_request_force_downcasing_test.send(:validate_signature) + end + end + + describe "#validate_signature with multiple idp certs" do + before do + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + settings.idp_cert = nil + settings.security[:logout_requests_signed] = true + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + end + + it "return true when at least a idp_cert is valid" do + params = OneLogin::RubySaml::Logoutrequest.new.create_params(settings, :RelayState => 'http://example.com') + params['RelayState'] = params[:RelayState] + options = {} + options[:get_params] = params + logout_request_sign_test = OneLogin::RubySaml::SloLogoutrequest.new(params['SAMLRequest'], options) + settings.idp_cert_multi = { + :signing => [ruby_saml_cert_text2, ruby_saml_cert_text], + :encryption => [] + } + logout_request_sign_test.settings = settings + assert logout_request_sign_test.send(:validate_signature) + end + + it "return false when cert expired and check_idp_cert_expiration expired" do + params = OneLogin::RubySaml::Logoutrequest.new.create_params(settings, :RelayState => 'http://example.com') + params['RelayState'] = params[:RelayState] + options = {} + options[:get_params] = params + settings.security[:check_idp_cert_expiration] = true + logout_request_sign_test = OneLogin::RubySaml::SloLogoutrequest.new(params['SAMLRequest'], options) + settings.idp_cert = nil + settings.idp_cert_multi = { + :signing => [ruby_saml_cert_text], + :encryption => [] + } + logout_request_sign_test.settings = settings + assert !logout_request_sign_test.send(:validate_signature) + assert_includes logout_request_sign_test.errors, "IdP x509 certificate expired" + end + + it "return false when none cert on idp_cert_multi is valid" do + params = OneLogin::RubySaml::Logoutrequest.new.create_params(settings, :RelayState => 'http://example.com') + params['RelayState'] = params[:RelayState] + options = {} + options[:get_params] = params + logout_request_sign_test = OneLogin::RubySaml::SloLogoutrequest.new(params['SAMLRequest'], options) + settings.idp_cert_fingerprint = ruby_saml_cert_fingerprint + settings.idp_cert_multi = { + :signing => [ruby_saml_cert_text2, ruby_saml_cert_text2], + :encryption => [] + } + logout_request_sign_test.settings = settings + assert !logout_request_sign_test.send(:validate_signature) + assert_includes logout_request_sign_test.errors, "Invalid Signature on Logout Request" + + end + end + end +end diff --git a/ruby-saml-custom/test/slo_logoutresponse_test.rb b/ruby-saml-custom/test/slo_logoutresponse_test.rb new file mode 100644 index 0000000..c80d11b --- /dev/null +++ b/ruby-saml-custom/test/slo_logoutresponse_test.rb @@ -0,0 +1,339 @@ +require File.expand_path(File.join(File.dirname(__FILE__), "test_helper")) + +require 'onelogin/ruby-saml/slo_logoutresponse' + +class SloLogoutresponseTest < Minitest::Test + + describe "SloLogoutresponse" do + let(:settings) { OneLogin::RubySaml::Settings.new } + let(:logout_request) { OneLogin::RubySaml::SloLogoutrequest.new(logout_request_document) } + + before do + settings.idp_entity_id = 'https://app.onelogin.com/saml/metadata/SOMEACCOUNT' + settings.idp_slo_service_url = "http://unauth.com/logout" + settings.name_identifier_value = "f00f00" + settings.compress_request = true + settings.certificate = ruby_saml_cert_text + settings.private_key = ruby_saml_key_text + logout_request.settings = settings + end + + it "create the deflated SAMLResponse URL parameter" do + unauth_url = OneLogin::RubySaml::SloLogoutresponse.new.create(settings, logout_request.id) + assert_match /^http:\/\/unauth\.com\/logout\?SAMLResponse=/, unauth_url + + inflated = decode_saml_response_payload(unauth_url) + assert_match /^ nil }) + assert_match /&hello=$/, unauth_url + + unauth_url = OneLogin::RubySaml::SloLogoutresponse.new.create(settings, logout_request.id, nil, { :foo => "bar" }) + assert_match /&foo=bar$/, unauth_url + + unauth_url = OneLogin::RubySaml::SloLogoutresponse.new.create(settings, logout_request.id, nil, { :RelayState => "http://idp.example.com" }) + assert_match /&RelayState=http%3A%2F%2Fidp.example.com$/, unauth_url + end + + it "RelayState cases" do + unauth_url = OneLogin::RubySaml::SloLogoutresponse.new.create(settings, logout_request.id, nil, { :RelayState => nil }) + assert !unauth_url.include?('RelayState') + + unauth_url = OneLogin::RubySaml::SloLogoutresponse.new.create(settings, logout_request.id, nil, { :RelayState => "http://example.com" }) + assert unauth_url.include?('&RelayState=http%3A%2F%2Fexample.com') + + unauth_url = OneLogin::RubySaml::SloLogoutresponse.new.create(settings, logout_request.id, nil, { 'RelayState' => nil }) + assert !unauth_url.include?('RelayState') + + unauth_url = OneLogin::RubySaml::SloLogoutresponse.new.create(settings, logout_request.id, nil, { 'RelayState' => "http://example.com" }) + assert unauth_url.include?('&RelayState=http%3A%2F%2Fexample.com') + end + + it "set InResponseTo to the ID from the logout request" do + unauth_url = OneLogin::RubySaml::SloLogoutresponse.new.create(settings, logout_request.id) + + inflated = decode_saml_response_payload(unauth_url) + assert_match /InResponseTo='_c0348950-935b-0131-1060-782bcb56fcaa'/, inflated + end + + it "set a custom successful logout message on the response" do + unauth_url = OneLogin::RubySaml::SloLogoutresponse.new.create(settings, logout_request.id, "Custom Logout Message") + + inflated = decode_saml_response_payload(unauth_url) + assert_match /Custom Logout Message<\/samlp:StatusMessage>/, inflated + end + + it "set a custom logout message and an status on the response" do + unauth_url = OneLogin::RubySaml::SloLogoutresponse.new.create(settings, nil, "Custom Logout Message", {}, "urn:oasis:names:tc:SAML:2.0:status:PartialLogout") + + inflated = decode_saml_response_payload(unauth_url) + assert_match /Custom Logout Message<\/samlp:StatusMessage>/, inflated + assert_match /([a-zA-Z0-9/+=]+)], inflated + refute_match %r[], inflated + refute_match %r[], inflated + end + + it "sign unsigned request" do + unauth_res = OneLogin::RubySaml::SloLogoutresponse.new + unauth_res_doc = unauth_res.create_xml_document(settings) + inflated = unauth_res_doc.to_s + + refute_match %r[([a-zA-Z0-9/+=]+)], inflated + refute_match %r[], inflated + refute_match %r[], inflated + + inflated = unauth_res.sign_document(unauth_res_doc, settings).to_s + + assert_match %r[([a-zA-Z0-9/+=]+)], inflated + assert_match %r[], inflated + assert_match %r[], inflated + end + + it "signs through create_logout_response_xml_doc" do + unauth_res = OneLogin::RubySaml::SloLogoutresponse.new + inflated = unauth_res.create_logout_response_xml_doc(settings).to_s + + assert_match %r[([a-zA-Z0-9/+=]+)], inflated + assert_match %r[], inflated + assert_match %r[], inflated + end + + it "create a signed logout response" do + logout_request.settings = settings + params = OneLogin::RubySaml::SloLogoutresponse.new.create_params(settings, logout_request.id, "Custom Logout Message") + + response_xml = Base64.decode64(params["SAMLResponse"]) + assert_match %r[([a-zA-Z0-9/+=]+)], response_xml + assert_match //, response_xml + assert_match //, response_xml + end + + it "create a signed logout response with 256 digest and signature methods" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA256 + settings.security[:digest_method] = XMLSecurity::Document::SHA256 + + params = OneLogin::RubySaml::SloLogoutresponse.new.create_params(settings, logout_request.id, "Custom Logout Message") + + response_xml = Base64.decode64(params["SAMLResponse"]) + assert_match %r[([a-zA-Z0-9/+=]+)], response_xml + assert_match //, response_xml + assert_match //, response_xml + end + + it "create a signed logout response with 512 digest and signature method RSA_SHA384" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA384 + settings.security[:digest_method] = XMLSecurity::Document::SHA512 + logout_request.settings = settings + + params = OneLogin::RubySaml::SloLogoutresponse.new.create_params(settings, logout_request.id, "Custom Logout Message") + + response_xml = Base64.decode64(params["SAMLResponse"]) + assert_match %r[([a-zA-Z0-9/+=]+)], response_xml + assert_match //, response_xml + assert_match //, response_xml + end + end + + describe "signing with HTTP-Redirect binding" do + let(:cert) { OpenSSL::X509::Certificate.new(ruby_saml_cert_text) } + + before do + settings.idp_sso_service_binding = :post + settings.idp_slo_service_binding = :redirect + settings.compress_response = false + settings.security[:logout_responses_signed] = true + end + + it "create a signature parameter with RSA_SHA1 and validate it" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + + params = OneLogin::RubySaml::SloLogoutresponse.new.create_params(settings, logout_request.id, "Custom Logout Message", :RelayState => 'http://example.com') + assert params['SAMLResponse'] + assert params[:RelayState] + assert params['Signature'] + assert_equal params['SigAlg'], XMLSecurity::Document::RSA_SHA1 + + query_string = "SAMLResponse=#{CGI.escape(params['SAMLResponse'])}" + query_string << "&RelayState=#{CGI.escape(params[:RelayState])}" + query_string << "&SigAlg=#{CGI.escape(params['SigAlg'])}" + + signature_algorithm = XMLSecurity::BaseDocument.new.algorithm(params['SigAlg']) + assert_equal signature_algorithm, OpenSSL::Digest::SHA1 + assert cert.public_key.verify(signature_algorithm.new, Base64.decode64(params['Signature']), query_string) + end + + it "create a signature parameter with RSA_SHA256 /SHA256 and validate it" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA256 + + params = OneLogin::RubySaml::SloLogoutresponse.new.create_params(settings, logout_request.id, "Custom Logout Message", :RelayState => 'http://example.com') + assert params['SAMLResponse'] + assert params[:RelayState] + assert params['Signature'] + + assert_equal params['SigAlg'], XMLSecurity::Document::RSA_SHA256 + + query_string = "SAMLResponse=#{CGI.escape(params['SAMLResponse'])}" + query_string << "&RelayState=#{CGI.escape(params[:RelayState])}" + query_string << "&SigAlg=#{CGI.escape(params['SigAlg'])}" + + signature_algorithm = XMLSecurity::BaseDocument.new.algorithm(params['SigAlg']) + assert_equal signature_algorithm, OpenSSL::Digest::SHA256 + assert cert.public_key.verify(signature_algorithm.new, Base64.decode64(params['Signature']), query_string) + end + + it "create a signature parameter with RSA_SHA384 / SHA384 and validate it" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA384 + + params = OneLogin::RubySaml::SloLogoutresponse.new.create_params(settings, logout_request.id, "Custom Logout Message", :RelayState => 'http://example.com') + assert params['SAMLResponse'] + assert params[:RelayState] + assert params['Signature'] + + assert_equal params['SigAlg'], XMLSecurity::Document::RSA_SHA384 + + query_string = "SAMLResponse=#{CGI.escape(params['SAMLResponse'])}" + query_string << "&RelayState=#{CGI.escape(params[:RelayState])}" + query_string << "&SigAlg=#{CGI.escape(params['SigAlg'])}" + + signature_algorithm = XMLSecurity::BaseDocument.new.algorithm(params['SigAlg']) + assert_equal signature_algorithm, OpenSSL::Digest::SHA384 + assert cert.public_key.verify(signature_algorithm.new, Base64.decode64(params['Signature']), query_string) + end + + it "create a signature parameter with RSA_SHA512 / SHA512 and validate it" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA512 + + params = OneLogin::RubySaml::SloLogoutresponse.new.create_params(settings, logout_request.id, "Custom Logout Message", :RelayState => 'http://example.com') + assert params['SAMLResponse'] + assert params[:RelayState] + assert params['Signature'] + + assert_equal params['SigAlg'], XMLSecurity::Document::RSA_SHA512 + + query_string = "SAMLResponse=#{CGI.escape(params['SAMLResponse'])}" + query_string << "&RelayState=#{CGI.escape(params[:RelayState])}" + query_string << "&SigAlg=#{CGI.escape(params['SigAlg'])}" + + signature_algorithm = XMLSecurity::BaseDocument.new.algorithm(params['SigAlg']) + assert_equal signature_algorithm, OpenSSL::Digest::SHA512 + assert cert.public_key.verify(signature_algorithm.new, Base64.decode64(params['Signature']), query_string) + end + end + + describe "DEPRECATED: signing with HTTP-POST binding via :embed_sign" do + + before do + settings.compress_response = false + settings.security[:logout_responses_signed] = true + settings.security[:embed_sign] = true + end + + it "doesn't sign through create_xml_document" do + unauth_res = OneLogin::RubySaml::SloLogoutresponse.new + inflated = unauth_res.create_xml_document(settings).to_s + + refute_match %r[([a-zA-Z0-9/+=]+)], inflated + refute_match %r[], inflated + refute_match %r[], inflated + end + + it "sign unsigned request" do + unauth_res = OneLogin::RubySaml::SloLogoutresponse.new + unauth_res_doc = unauth_res.create_xml_document(settings) + inflated = unauth_res_doc.to_s + + refute_match %r[([a-zA-Z0-9/+=]+)], inflated + refute_match %r[], inflated + refute_match %r[], inflated + + inflated = unauth_res.sign_document(unauth_res_doc, settings).to_s + + assert_match %r[([a-zA-Z0-9/+=]+)], inflated + assert_match %r[], inflated + assert_match %r[], inflated + end + end + + describe "DEPRECATED: signing with HTTP-Redirect binding via :embed_sign" do + let(:cert) { OpenSSL::X509::Certificate.new(ruby_saml_cert_text) } + + before do + settings.compress_response = false + settings.security[:logout_responses_signed] = true + settings.security[:embed_sign] = false + end + + it "create a signature parameter with RSA_SHA1 and validate it" do + settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1 + + params = OneLogin::RubySaml::SloLogoutresponse.new.create_params(settings, logout_request.id, "Custom Logout Message", :RelayState => 'http://example.com') + assert params['SAMLResponse'] + assert params[:RelayState] + assert params['Signature'] + assert_equal params['SigAlg'], XMLSecurity::Document::RSA_SHA1 + + query_string = "SAMLResponse=#{CGI.escape(params['SAMLResponse'])}" + query_string << "&RelayState=#{CGI.escape(params[:RelayState])}" + query_string << "&SigAlg=#{CGI.escape(params['SigAlg'])}" + + signature_algorithm = XMLSecurity::BaseDocument.new.algorithm(params['SigAlg']) + assert_equal signature_algorithm, OpenSSL::Digest::SHA1 + assert cert.public_key.verify(signature_algorithm.new, Base64.decode64(params['Signature']), query_string) + end + end + + describe "#manipulate response_id" do + it "be able to modify the response id" do + logoutresponse = OneLogin::RubySaml::SloLogoutresponse.new + response_id = logoutresponse.response_id + assert_equal response_id, logoutresponse.uuid + logoutresponse.uuid = "new_uuid" + assert_equal logoutresponse.response_id, logoutresponse.uuid + assert_equal "new_uuid", logoutresponse.response_id + end + end + end +end diff --git a/ruby-saml-custom/test/test_helper.rb b/ruby-saml-custom/test/test_helper.rb new file mode 100644 index 0000000..e81f6ea --- /dev/null +++ b/ruby-saml-custom/test/test_helper.rb @@ -0,0 +1,354 @@ +require 'simplecov' +require 'coveralls' + +SimpleCov.formatter = Coveralls::SimpleCov::Formatter +SimpleCov.start do + add_filter "test/" + add_filter "vendor/" + add_filter "lib/onelogin/ruby-saml/logging.rb" +end + +require 'stringio' +require 'rubygems' +require 'bundler' +require 'minitest/autorun' +require 'mocha/setup' +require 'timecop' + +Bundler.require :default, :test + +$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) +$LOAD_PATH.unshift(File.dirname(__FILE__)) + +require 'onelogin/ruby-saml/logging' + +TEST_LOGGER = Logger.new(StringIO.new) +OneLogin::RubySaml::Logging.logger = TEST_LOGGER + +class Minitest::Test + def fixture(document, base64 = true) + response = Dir.glob(File.join(File.dirname(__FILE__), "responses", "#{document}*")).first + if base64 && response =~ /\.xml$/ + Base64.encode64(File.read(response)) + else + File.read(response) + end + end + + def read_response(response) + File.read(File.join(File.dirname(__FILE__), "responses", response)) + end + + def read_invalid_response(response) + File.read(File.join(File.dirname(__FILE__), "responses", "invalids", response)) + end + + def read_logout_request(request) + File.read(File.join(File.dirname(__FILE__), "logout_requests", request)) + end + + def read_certificate(certificate) + File.read(File.join(File.dirname(__FILE__), "certificates", certificate)) + end + + def response_document_valid_signed + @response_document_valid_signed ||= read_response("valid_response.xml.base64") + end + + def response_document_valid_signed_without_x509certificate + @response_document_valid_signed_without_x509certificate ||= read_response("valid_response_without_x509certificate.xml.base64") + end + + def response_document_without_recipient + @response_document_without_recipient ||= read_response("response_with_undefined_recipient.xml.base64") + end + + def response_document_without_recipient_with_time_updated + doc = Base64.decode64(response_document_without_recipient) + doc.gsub!(/NotBefore=\"(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z\"/, "NotBefore=\"#{(Time.now-300).getutc.strftime("%Y-%m-%dT%XZ")}\"") + doc.gsub!(/NotOnOrAfter=\"(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z\"/, "NotOnOrAfter=\"#{(Time.now+300).getutc.strftime("%Y-%m-%dT%XZ")}\"") + Base64.encode64(doc) + end + + def response_document_without_attributes + @response_document_without_attributes ||= read_response("response_without_attributes.xml.base64") + end + + def response_document_without_reference_uri + @response_document_without_reference_uri ||= read_response("response_without_reference_uri.xml.base64") + end + + def response_document_with_signed_assertion + @response_document_with_signed_assertion ||= read_response("response_with_signed_assertion.xml.base64") + end + + def response_document_with_signed_assertion_2 + @response_document_with_signed_assertion_2 ||= read_response("response_with_signed_assertion_2.xml.base64") + end + + def response_document_with_ds_namespace_at_the_root + @response_document_with_ds_namespace_at_the_root ||= read_response("response_with_ds_namespace_at_the_root.xml.base64") + end + + def response_document_unsigned + @response_document_unsigned ||= read_response("response_unsigned_xml_base64") + end + + def response_document_with_saml2_namespace + @response_document_with_saml2_namespace ||= read_response("response_with_saml2_namespace.xml.base64") + end + + def ampersands_document + @ampersands_response ||= read_response("response_with_ampersands.xml.base64") + end + + def response_document_no_cert_and_encrypted_attrs + @response_document_no_cert_and_encrypted_attrs ||= Base64.encode64(read_response("response_no_cert_and_encrypted_attrs.xml")) + end + + def response_document_wrapped + @response_document_wrapped ||= read_response("response_wrapped.xml.base64") + end + + def response_document_assertion_wrapped + @response_document_assertion_wrapped ||= read_response("response_assertion_wrapped.xml.base64") + end + + def response_document_encrypted_nameid + @response_document_encrypted_nameid ||= File.read(File.join(File.dirname(__FILE__), 'responses', 'response_encrypted_nameid.xml.base64')) + end + + def signed_message_encrypted_unsigned_assertion + @signed_message_encrypted_unsigned_assertion ||= File.read(File.join(File.dirname(__FILE__), 'responses', 'signed_message_encrypted_unsigned_assertion.xml.base64')) + end + + def signed_message_encrypted_signed_assertion + @signed_message_encrypted_signed_assertion ||= File.read(File.join(File.dirname(__FILE__), 'responses', 'signed_message_encrypted_signed_assertion.xml.base64')) + end + + def unsigned_message_encrypted_signed_assertion + @unsigned_message_encrypted_signed_assertion ||= File.read(File.join(File.dirname(__FILE__), 'responses', 'unsigned_message_encrypted_signed_assertion.xml.base64')) + end + + def unsigned_message_encrypted_unsigned_assertion + @unsigned_message_encrypted_unsigned_assertion ||= File.read(File.join(File.dirname(__FILE__), 'responses', 'unsigned_message_encrypted_unsigned_assertion.xml.base64')) + end + + def response_document_encrypted_attrs + @response_document_encrypted_attrs ||= File.read(File.join(File.dirname(__FILE__), 'responses', 'response_encrypted_attrs.xml.base64')) + end + + def response_document_double_status_code + @response_document_double_status_code ||= File.read(File.join(File.dirname(__FILE__), 'responses', 'response_double_status_code.xml.base64')) + end + + def signature_fingerprint_1 + @signature_fingerprint1 ||= "C5:19:85:D9:47:F1:BE:57:08:20:25:05:08:46:EB:27:F6:CA:B7:83" + end + + # certificate used on response_with_undefined_recipient + def signature_1 + @signature1 ||= read_certificate("certificate1") + end + + # certificate used on response_document_with_signed_assertion_2 + def certificate_without_head_foot + @certificate_without_head_foot ||= read_certificate("certificate_without_head_foot") + end + + def idp_metadata_descriptor + @idp_metadata_descriptor ||= File.read(File.join(File.dirname(__FILE__), 'metadata', 'idp_descriptor.xml')) + end + + def idp_metadata_descriptor2 + @idp_metadata_descriptor2 ||= File.read(File.join(File.dirname(__FILE__), 'metadata', 'idp_descriptor_2.xml')) + end + + def idp_metadata_descriptor3 + @idp_metadata_descriptor3 ||= File.read(File.join(File.dirname(__FILE__), 'metadata', 'idp_descriptor_3.xml')) + end + + def idp_metadata_descriptor4 + @idp_metadata_descriptor4 ||= File.read(File.join(File.dirname(__FILE__), 'metadata', 'idp_descriptor_4.xml')) + end + + def idp_metadata_descriptor5 + @idp_metadata_descriptor5 ||= File.read(File.join(File.dirname(__FILE__), 'metadata', 'idp_descriptor_5.xml')) + end + + def idp_metadata_descriptor6 + @idp_metadata_descriptor6 ||= File.read(File.join(File.dirname(__FILE__), 'metadata', 'idp_descriptor_6.xml')) + end + + def no_idp_metadata_descriptor + @no_idp_metadata_descriptor ||= File.read(File.join(File.dirname(__FILE__), 'metadata', 'no_idp_descriptor.xml')) + end + + def idp_metadata_multiple_descriptors + @idp_metadata_multiple_descriptors ||= File.read(File.join(File.dirname(__FILE__), 'metadata', 'idp_multiple_descriptors.xml')) + end + + def idp_metadata_multiple_descriptors2 + @idp_metadata_multiple_descriptors2 ||= File.read(File.join(File.dirname(__FILE__), 'metadata', 'idp_multiple_descriptors_2.xml')) + end + + def idp_metadata_multiple_certs + @idp_metadata_multiple_descriptors ||= File.read(File.join(File.dirname(__FILE__), 'metadata', 'idp_metadata_multi_certs.xml')) + end + + def idp_metadata_multiple_signing_certs + @idp_metadata_multiple_signing_certs ||= File.read(File.join(File.dirname(__FILE__), 'metadata', 'idp_metadata_multi_signing_certs.xml')) + end + + def idp_metadata_same_sign_and_encrypt_cert + @idp_metadata_same_sign_and_encrypt_cert ||= File.read(File.join(File.dirname(__FILE__), 'metadata', 'idp_metadata_same_sign_and_encrypt_cert.xml')) + end + + def idp_metadata_different_sign_and_encrypt_cert + @idp_metadata_different_sign_and_encrypt_cert ||= File.read(File.join(File.dirname(__FILE__), 'metadata', 'idp_metadata_different_sign_and_encrypt_cert.xml')) + end + + def idp_different_slo_response_location + @idp_different_slo_response_location ||= File.read(File.join(File.dirname(__FILE__), 'metadata', 'idp_different_slo_response_location.xml')) + end + + def idp_without_slo_response_location + @idp_without_slo_response_location ||= File.read(File.join(File.dirname(__FILE__), 'metadata', 'idp_without_slo_response_location.xml')) + end + + def logout_request_document + unless @logout_request_document + xml = read_logout_request("slo_request.xml") + deflated = Zlib::Deflate.deflate(xml, 9)[2..-5] + @logout_request_document = Base64.encode64(deflated) + end + @logout_request_document + end + + def logout_request_document_with_name_id_format + unless @logout_request_document_with_name_id_format + xml = read_logout_request("slo_request_with_name_id_format.xml") + deflated = Zlib::Deflate.deflate(xml, 9)[2..-5] + @logout_request_document_with_name_id_format = Base64.encode64(deflated) + end + @logout_request_document_with_name_id_format + end + + def logout_request_xml_with_session_index + @logout_request_xml_with_session_index ||= File.read(File.join(File.dirname(__FILE__), 'logout_requests', 'slo_request_with_session_index.xml')) + end + + def invalid_logout_request_document + unless @invalid_logout_request_document + xml = File.read(File.join(File.dirname(__FILE__), 'logout_requests', 'invalid_slo_request.xml')) + deflated = Zlib::Deflate.deflate(xml, 9)[2..-5] + @invalid_logout_request_document = Base64.encode64(deflated) + end + @invalid_logout_request_document + end + + def logout_request_base64 + @logout_request_base64 ||= File.read(File.join(File.dirname(__FILE__), 'logout_requests', 'slo_request.xml.base64')) + end + + def logout_request_deflated_base64 + @logout_request_deflated_base64 ||= File.read(File.join(File.dirname(__FILE__), 'logout_requests', 'slo_request_deflated.xml.base64')) + end + + def ruby_saml_cert + @ruby_saml_cert ||= OpenSSL::X509::Certificate.new(ruby_saml_cert_text) + end + + def ruby_saml_cert2 + @ruby_saml_cert2 ||= OpenSSL::X509::Certificate.new(ruby_saml_cert_text2) + end + + def ruby_saml_cert_fingerprint + @ruby_saml_cert_fingerprint ||= Digest::SHA1.hexdigest(ruby_saml_cert.to_der).scan(/../).join(":") + end + + def ruby_saml_cert_text + read_certificate("ruby-saml.crt") + end + + def ruby_saml_cert_text2 + read_certificate("ruby-saml-2.crt") + end + + def ruby_saml_key + @ruby_saml_key ||= OpenSSL::PKey::RSA.new(ruby_saml_key_text) + end + + def ruby_saml_key_text + read_certificate("ruby-saml.key") + end + + # + # logoutresponse fixtures + # + def random_id + "_#{OneLogin::RubySaml::Utils.uuid}" + end + + # + # decodes a base64 encoded SAML response for use in SloLogoutresponse tests + # + def decode_saml_response_payload(unauth_url) + payload = CGI.unescape(unauth_url.split("SAMLResponse=").last) + decoded = Base64.decode64(payload) + + zstream = Zlib::Inflate.new(-Zlib::MAX_WBITS) + inflated = zstream.inflate(decoded) + zstream.finish + zstream.close + inflated + end + + # + # decodes a base64 encoded SAML request for use in Logoutrequest tests + # + def decode_saml_request_payload(unauth_url) + payload = CGI.unescape(unauth_url.split("SAMLRequest=").last) + decoded = Base64.decode64(payload) + + zstream = Zlib::Inflate.new(-Zlib::MAX_WBITS) + inflated = zstream.inflate(decoded) + zstream.finish + zstream.close + inflated + end + + SCHEMA_DIR = File.expand_path(File.join(__FILE__, '../../lib/schemas')) + + # + # validate an xml document against the given schema + # + def validate_xml!(document, schema) + Dir.chdir(SCHEMA_DIR) do + xsd = if schema.is_a? Nokogiri::XML::Schema + schema + else + Nokogiri::XML::Schema(File.read(schema)) + end + + xml = if document.is_a? Nokogiri::XML::Document + document + else + Nokogiri::XML(document) { |c| c.strict } + end + + result = xsd.validate(xml) + + if result.length != 0 + raise "Schema validation failed! XSD validation errors: #{result.join(", ")}" + else + true + end + end + end + + # Allows to emulate Azure AD request behavior + def downcased_escape(str) + CGI.escape(str).gsub(/%[A-Fa-f0-9]{2}/) { |match| match.downcase } + end +end diff --git a/ruby-saml-custom/test/utils_test.rb b/ruby-saml-custom/test/utils_test.rb new file mode 100644 index 0000000..e603d80 --- /dev/null +++ b/ruby-saml-custom/test/utils_test.rb @@ -0,0 +1,300 @@ +require File.expand_path(File.join(File.dirname(__FILE__), "test_helper")) + +class UtilsTest < Minitest::Test + describe ".parse_duration" do + DURATIONS_FROM_EPOCH = { + # Basic formats + "P1Y1M1D" => "1971-02-02T00:00:00.000Z", + "PT1H1M1S" => "1970-01-01T01:01:01.000Z", + "P1W" => "1970-01-08T00:00:00.000Z", + "P1Y1M1DT1H1M1S" => "1971-02-02T01:01:01.000Z", + + # Negative duration + "-P1Y1M1DT1H1M1S" => "1968-11-29T22:58:59.000Z", + + # Nominal wraparounds + "P13M" => "1971-02-01T00:00:00.000Z", + "P31D" => "1970-02-01T00:00:00.000Z", + + # Decimal seconds + "PT0.5S" => "1970-01-01T00:00:00.500Z", + "PT0,5S" => "1970-01-01T00:00:00.500Z" + } + + def result(duration, reference = 0) + return nil if RUBY_VERSION < '1.9' + Time.at( + OneLogin::RubySaml::Utils.parse_duration(duration, reference) + ).utc.iso8601(3) + end + + DURATIONS_FROM_EPOCH.each do |duration, expected| + it "parses #{duration} to return #{expected} from the given timestamp" do + return if RUBY_VERSION < '1.9' + assert_equal expected, result(duration) + end + end + + it "returns the last calendar day of the next month when advancing from a longer month to a shorter one" do + initial_timestamp = Time.iso8601("1970-01-31T00:00:00.000Z").to_i + return if RUBY_VERSION < '1.9' + assert_equal "1970-02-28T00:00:00.000Z", result("P1M", initial_timestamp) + end + end + + describe ".format_cert" do + let(:formatted_certificate) {read_certificate("formatted_certificate")} + let(:formatted_chained_certificate) {read_certificate("formatted_chained_certificate")} + + it "returns empty string when the cert is an empty string" do + cert = "" + assert_equal "", OneLogin::RubySaml::Utils.format_cert(cert) + end + + it "returns nil when the cert is nil" do + cert = nil + assert_nil OneLogin::RubySaml::Utils.format_cert(cert) + end + + it "returns the certificate when it is valid" do + assert_equal formatted_certificate, OneLogin::RubySaml::Utils.format_cert(formatted_certificate) + end + + it "reformats the certificate when there are spaces and no line breaks" do + invalid_certificate1 = read_certificate("invalid_certificate1") + assert_equal formatted_certificate, OneLogin::RubySaml::Utils.format_cert(invalid_certificate1) + end + + it "reformats the certificate when there are spaces and no headers" do + invalid_certificate2 = read_certificate("invalid_certificate2") + assert_equal formatted_certificate, OneLogin::RubySaml::Utils.format_cert(invalid_certificate2) + end + + it "returns the cert when it's encoded" do + encoded_certificate = read_certificate("certificate.der") + assert_equal encoded_certificate, OneLogin::RubySaml::Utils.format_cert(encoded_certificate) + end + + it "reformats the certificate when there line breaks and no headers" do + invalid_certificate3 = read_certificate("invalid_certificate3") + assert_equal formatted_certificate, OneLogin::RubySaml::Utils.format_cert(invalid_certificate3) + end + + it "returns the chained certificate when it is a valid chained certificate" do + assert_equal formatted_chained_certificate, OneLogin::RubySaml::Utils.format_cert(formatted_chained_certificate) + end + + it "reformats the chained certificate when there are spaces and no line breaks" do + invalid_chained_certificate1 = read_certificate("invalid_chained_certificate1") + assert_equal formatted_chained_certificate, OneLogin::RubySaml::Utils.format_cert(invalid_chained_certificate1) + end + + end + + describe ".format_private_key" do + let(:formatted_private_key) do + read_certificate("formatted_private_key") + end + + it "returns empty string when the private key is an empty string" do + private_key = "" + assert_equal "", OneLogin::RubySaml::Utils.format_private_key(private_key) + end + + it "returns nil when the private key is nil" do + private_key = nil + assert_nil OneLogin::RubySaml::Utils.format_private_key(private_key) + end + + it "returns the private key when it is valid" do + assert_equal formatted_private_key, OneLogin::RubySaml::Utils.format_private_key(formatted_private_key) + end + + it "reformats the private key when there are spaces and no line breaks" do + invalid_private_key1 = read_certificate("invalid_private_key1") + assert_equal formatted_private_key, OneLogin::RubySaml::Utils.format_private_key(invalid_private_key1) + end + + it "reformats the private key when there are spaces and no headers" do + invalid_private_key2 = read_certificate("invalid_private_key2") + assert_equal formatted_private_key, OneLogin::RubySaml::Utils.format_private_key(invalid_private_key2) + end + + it "reformats the private key when there line breaks and no headers" do + invalid_private_key3 = read_certificate("invalid_private_key3") + assert_equal formatted_private_key, OneLogin::RubySaml::Utils.format_private_key(invalid_private_key3) + end + + describe "an RSA public key" do + let(:formatted_rsa_private_key) do + read_certificate("formatted_rsa_private_key") + end + + it "returns the private key when it is valid" do + assert_equal formatted_rsa_private_key, OneLogin::RubySaml::Utils.format_private_key(formatted_rsa_private_key) + end + + it "reformats the private key when there are spaces and no line breaks" do + invalid_rsa_private_key1 = read_certificate("invalid_rsa_private_key1") + assert_equal formatted_rsa_private_key, OneLogin::RubySaml::Utils.format_private_key(invalid_rsa_private_key1) + end + + it "reformats the private key when there are spaces and no headers" do + invalid_rsa_private_key2 = read_certificate("invalid_rsa_private_key2") + assert_equal formatted_private_key, OneLogin::RubySaml::Utils.format_private_key(invalid_rsa_private_key2) + end + + it "reformats the private key when there line breaks and no headers" do + invalid_rsa_private_key3 = read_certificate("invalid_rsa_private_key3") + assert_equal formatted_private_key, OneLogin::RubySaml::Utils.format_private_key(invalid_rsa_private_key3) + end + end + end + + describe "build_query" do + it "returns the query string" do + params = {} + params[:type] = "SAMLRequest" + params[:data] = "PHNhbWxwOkF1dGhuUmVxdWVzdCBEZXN0aW5hdGlvbj0naHR0cDovL2V4YW1wbGUuY29tP2ZpZWxkPXZhbHVlJyBJRD0nXzk4NmUxZDEwLWVhY2ItMDEzMi01MGRkLTAwOTBmNWRlZGQ3NycgSXNzdWVJbnN0YW50PScyMDE1LTA2LTAxVDIwOjM0OjU5WicgVmVyc2lvbj0nMi4wJyB4bWxuczpzYW1sPSd1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXNzZXJ0aW9uJyB4bWxuczpzYW1scD0ndXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3RvY29sJy8+" + params[:relay_state] = "http://example.com" + params[:sig_alg] = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" + query_string = OneLogin::RubySaml::Utils.build_query(params) + assert_equal "SAMLRequest=PHNhbWxwOkF1dGhuUmVxdWVzdCBEZXN0aW5hdGlvbj0naHR0cDovL2V4YW1wbGUuY29tP2ZpZWxkPXZhbHVlJyBJRD0nXzk4NmUxZDEwLWVhY2ItMDEzMi01MGRkLTAwOTBmNWRlZGQ3NycgSXNzdWVJbnN0YW50PScyMDE1LTA2LTAxVDIwOjM0OjU5WicgVmVyc2lvbj0nMi4wJyB4bWxuczpzYW1sPSd1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXNzZXJ0aW9uJyB4bWxuczpzYW1scD0ndXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3RvY29sJy8%2B&RelayState=http%3A%2F%2Fexample.com&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1", query_string + end + end + + describe "#verify_signature" do + before do + @params = {} + @params[:cert] = ruby_saml_cert + @params[:sig_alg] = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" + @params[:query_string] = "SAMLRequest=PHNhbWxwOkF1dGhuUmVxdWVzdCBEZXN0aW5hdGlvbj0naHR0cDovL2V4YW1wbGUuY29tP2ZpZWxkPXZhbHVlJyBJRD0nXzk4NmUxZDEwLWVhY2ItMDEzMi01MGRkLTAwOTBmNWRlZGQ3NycgSXNzdWVJbnN0YW50PScyMDE1LTA2LTAxVDIwOjM0OjU5WicgVmVyc2lvbj0nMi4wJyB4bWxuczpzYW1sPSd1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXNzZXJ0aW9uJyB4bWxuczpzYW1scD0ndXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3RvY29sJy8%2B&RelayState=http%3A%2F%2Fexample.com&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1" + end + + it "returns true when the signature is valid" do + @params[:signature] = "uWJm/T4gKLYEsVu1j/ZmjDeHp9zYPXPXWTXHFJZf2KKnWg57fUw3x2l6KTyRQ+Xjigb+sfYdGnnwmIz6KngXYRnh7nO6inspRLWOwkqQFy9iR9LDlMcfpXV/0g3oAxBxO6tX8MUHqR2R62SYZRGd1rxC9apg4vQiP97+atOI8t4=" + assert OneLogin::RubySaml::Utils.verify_signature(@params) + end + + it "returns false when the signature is invalid" do + @params[:signature] = "uWJm/InVaLiDsVu1j/ZmjDeHp9zYPXPXWTXHFJZf2KKnWg57fUw3x2l6KTyRQ+Xjigb+sfYdGnnwmIz6KngXYRnh7nO6inspRLWOwkqQFy9iR9LDlMcfpXV/0g3oAxBxO6tX8MUHqR2R62SYZRGd1rxC9apg4vQiP97+atOI8t4=" + assert !OneLogin::RubySaml::Utils.verify_signature(@params) + end + end + + describe "#status_error_msg" do + it "returns a error msg with a status message" do + error_msg = "The status code of the Logout Response was not Success" + status_code = "urn:oasis:names:tc:SAML:2.0:status:Requester" + status_message = "The request could not be performed due to an error on the part of the requester." + status_error_msg = OneLogin::RubySaml::Utils.status_error_msg(error_msg, status_code, status_message) + assert_equal = "The status code of the Logout Response was not Success, was Requester -> The request could not be performed due to an error on the part of the requester.", status_error_msg + + status_error_msg2 = OneLogin::RubySaml::Utils.status_error_msg(error_msg, status_code) + assert_equal = "The status code of the Logout Response was not Success, was Requester", status_error_msg2 + + status_error_msg3 = OneLogin::RubySaml::Utils.status_error_msg(error_msg) + assert_equal = "The status code of the Logout Response was not Success", status_error_msg3 + end + end + + describe "Utils" do + + describe ".uuid" do + it "returns a uuid starting with an underscore" do + assert_match /^_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/, OneLogin::RubySaml::Utils.uuid + end + + it "doesn't return the same value twice" do + refute_equal OneLogin::RubySaml::Utils.uuid, OneLogin::RubySaml::Utils.uuid + end + end + + describe 'uri_match' do + it 'matches two urls' do + destination = 'http://www.example.com/test?var=stuff' + settings = 'http://www.example.com/test?var=stuff' + assert OneLogin::RubySaml::Utils.uri_match?(destination, settings) + end + + it 'fails to match two urls' do + destination = 'http://www.example.com/test?var=stuff' + settings = 'http://www.example.com/othertest?var=stuff' + assert !OneLogin::RubySaml::Utils.uri_match?(destination, settings) + end + + it "matches two URLs if the scheme case doesn't match" do + destination = 'http://www.example.com/test?var=stuff' + settings = 'HTTP://www.example.com/test?var=stuff' + assert OneLogin::RubySaml::Utils.uri_match?(destination, settings) + end + + it "matches two URLs if the host case doesn't match" do + destination = 'http://www.EXAMPLE.com/test?var=stuff' + settings = 'http://www.example.com/test?var=stuff' + assert OneLogin::RubySaml::Utils.uri_match?(destination, settings) + end + + it "fails to match two URLs if the path case doesn't match" do + destination = 'http://www.example.com/TEST?var=stuff' + settings = 'http://www.example.com/test?var=stuff' + assert !OneLogin::RubySaml::Utils.uri_match?(destination, settings) + end + + it "fails to match two URLs if the query case doesn't match" do + destination = 'http://www.example.com/test?var=stuff' + settings = 'http://www.example.com/test?var=STUFF' + assert !OneLogin::RubySaml::Utils.uri_match?(destination, settings) + end + + it 'matches two non urls' do + destination = 'stuff' + settings = 'stuff' + assert OneLogin::RubySaml::Utils.uri_match?(destination, settings) + end + + it "fails to match two non urls" do + destination = 'stuff' + settings = 'not stuff' + assert !OneLogin::RubySaml::Utils.uri_match?(destination, settings) + end + end + + describe 'element_text' do + it 'returns the element text' do + element = REXML::Document.new('element text').elements.first + assert_equal 'element text', OneLogin::RubySaml::Utils.element_text(element) + end + + it 'returns all segments of the element text' do + element = REXML::Document.new('element text').elements.first + assert_equal 'element text', OneLogin::RubySaml::Utils.element_text(element) + end + + it 'returns normalized element text' do + element = REXML::Document.new('element & text').elements.first + assert_equal 'element & text', OneLogin::RubySaml::Utils.element_text(element) + end + + it 'returns the CDATA element text' do + element = REXML::Document.new('').elements.first + assert_equal 'element & text', OneLogin::RubySaml::Utils.element_text(element) + end + + it 'returns the element text with newlines and additional whitespace' do + element = REXML::Document.new(" element \n text ").elements.first + assert_equal " element \n text ", OneLogin::RubySaml::Utils.element_text(element) + end + + it 'returns nil when element is nil' do + assert_nil OneLogin::RubySaml::Utils.element_text(nil) + end + + it 'returns empty string when element has no text' do + element = REXML::Document.new('').elements.first + assert_equal '', OneLogin::RubySaml::Utils.element_text(element) + end + + end + end +end diff --git a/ruby-saml-custom/test/xml_security_test.rb b/ruby-saml-custom/test/xml_security_test.rb new file mode 100644 index 0000000..b8ec783 --- /dev/null +++ b/ruby-saml-custom/test/xml_security_test.rb @@ -0,0 +1,470 @@ +require File.expand_path(File.join(File.dirname(__FILE__), "test_helper")) +require 'xml_security' + +class XmlSecurityTest < Minitest::Test + include XMLSecurity + + describe "XmlSecurity" do + + let(:decoded_response) { Base64.decode64(response_document_without_recipient) } + let(:document) { XMLSecurity::SignedDocument.new(decoded_response) } + let(:settings) { OneLogin::RubySaml::Settings.new() } + + before do + @base64cert = document.elements["//ds:X509Certificate"].text + end + + it "should run validate without throwing NS related exceptions" do + assert !document.validate_signature(@base64cert, true) + end + + it "should run validate with throwing NS related exceptions" do + assert_raises(OneLogin::RubySaml::ValidationError) do + document.validate_signature(@base64cert, false) + end + end + + it "not raise an error when softly validating the document multiple times" do + 2.times { assert_equal document.validate_signature(@base64cert, true), false } + end + + it "not raise an error when softly validating the document and the X509Certificate is missing" do + decoded_response.sub!(/.*<\/ds:X509Certificate>/, "") + mod_document = XMLSecurity::SignedDocument.new(decoded_response) + assert !mod_document.validate_document("a fingerprint", true) # The fingerprint isn't relevant to this test + end + + it "should raise Fingerprint mismatch" do + exception = assert_raises(OneLogin::RubySaml::ValidationError) do + document.validate_document("no:fi:ng:er:pr:in:t", false) + end + assert_equal("Fingerprint mismatch", exception.message) + assert_includes document.errors, "Fingerprint mismatch" + end + + it "should raise Digest mismatch" do + exception = assert_raises(OneLogin::RubySaml::ValidationError) do + document.validate_signature(@base64cert, false) + end + assert_equal("Digest mismatch", exception.message) + assert_includes document.errors, "Digest mismatch" + end + + it "should raise Key validation error" do + decoded_response.sub!("pJQ7MS/ek4KRRWGmv/H43ReHYMs=", + "b9xsAXLsynugg3Wc1CI3kpWku+0=") + mod_document = XMLSecurity::SignedDocument.new(decoded_response) + base64cert = mod_document.elements["//ds:X509Certificate"].text + exception = assert_raises(OneLogin::RubySaml::ValidationError) do + mod_document.validate_signature(base64cert, false) + end + assert_equal("Key validation error", exception.message) + assert_includes mod_document.errors, "Key validation error" + end + + it "correctly obtain the digest method with alternate namespace declaration" do + adfs_document = XMLSecurity::SignedDocument.new(fixture(:adfs_response_xmlns, false)) + base64cert = adfs_document.elements["//X509Certificate"].text + assert adfs_document.validate_signature(base64cert, false) + end + + it "raise validation error when the X509Certificate is missing and no cert provided" do + decoded_response.sub!(/.*<\/ds:X509Certificate>/, "") + mod_document = XMLSecurity::SignedDocument.new(decoded_response) + exception = assert_raises(OneLogin::RubySaml::ValidationError) do + mod_document.validate_document("a fingerprint", false) # The fingerprint isn't relevant to this test + end + assert_equal("Certificate element missing in response (ds:X509Certificate) and not cert provided at settings", exception.message) + end + + it "invalidaties when the X509Certificate is missing and the cert is provided but mismatches" do + decoded_response.sub!(/.*<\/ds:X509Certificate>/, "") + mod_document = XMLSecurity::SignedDocument.new(decoded_response) + cert = OpenSSL::X509::Certificate.new(ruby_saml_cert) + assert !mod_document.validate_document("a fingerprint", true, :cert => cert) # The fingerprint isn't relevant to this test + end + end + + describe "#canon_algorithm" do + it "C14N_EXCLUSIVE_1_0" do + canon_algorithm = Nokogiri::XML::XML_C14N_EXCLUSIVE_1_0 + assert_equal canon_algorithm, XMLSecurity::BaseDocument.new.canon_algorithm("http://www.w3.org/2001/10/xml-exc-c14n#") + assert_equal canon_algorithm, XMLSecurity::BaseDocument.new.canon_algorithm("http://www.w3.org/2001/10/xml-exc-c14n#WithComments") + assert_equal canon_algorithm, XMLSecurity::BaseDocument.new.canon_algorithm("other") + end + + it "C14N_1_0" do + canon_algorithm = Nokogiri::XML::XML_C14N_1_0 + assert_equal canon_algorithm, XMLSecurity::BaseDocument.new.canon_algorithm("http://www.w3.org/TR/2001/REC-xml-c14n-20010315") + assert_equal canon_algorithm, XMLSecurity::BaseDocument.new.canon_algorithm("http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments") + end + + it "XML_C14N_1_1" do + canon_algorithm = Nokogiri::XML::XML_C14N_1_1 + assert_equal canon_algorithm, XMLSecurity::BaseDocument.new.canon_algorithm("http://www.w3.org/2006/12/xml-c14n11") + assert_equal canon_algorithm, XMLSecurity::BaseDocument.new.canon_algorithm("http://www.w3.org/2006/12/xml-c14n11#WithComments") + end + end + + describe "#algorithm" do + it "SHA1" do + alg = OpenSSL::Digest::SHA1 + assert_equal alg, XMLSecurity::BaseDocument.new.algorithm("http://www.w3.org/2000/09/xmldsig#rsa-sha1") + assert_equal alg, XMLSecurity::BaseDocument.new.algorithm("http://www.w3.org/2000/09/xmldsig#sha1") + assert_equal alg, XMLSecurity::BaseDocument.new.algorithm("other") + end + + it "SHA256" do + alg = OpenSSL::Digest::SHA256 + assert_equal alg, XMLSecurity::BaseDocument.new.algorithm("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256") + assert_equal alg, XMLSecurity::BaseDocument.new.algorithm("http://www.w3.org/2001/04/xmldsig-more#sha256") + end + + it "SHA384" do + alg = OpenSSL::Digest::SHA384 + assert_equal alg, XMLSecurity::BaseDocument.new.algorithm("http://www.w3.org/2001/04/xmldsig-more#rsa-sha384") + assert_equal alg, XMLSecurity::BaseDocument.new.algorithm("http://www.w3.org/2001/04/xmldsig-more#sha384") + end + + it "SHA512" do + alg = OpenSSL::Digest::SHA512 + assert_equal alg, XMLSecurity::BaseDocument.new.algorithm("http://www.w3.org/2001/04/xmldsig-more#rsa-sha512") + assert_equal alg, XMLSecurity::BaseDocument.new.algorithm("http://www.w3.org/2001/04/xmldsig-more#sha512") + end + end + + describe "Fingerprint Algorithms" do + let(:response_fingerprint_test) { OneLogin::RubySaml::Response.new(fixture(:adfs_response_sha1, false)) } + + it "validate using SHA1" do + sha1_fingerprint = "F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72" + sha1_fingerprint_downcase = "f13c6b80905a030e6c913e5d15faddb016454872" + + assert response_fingerprint_test.document.validate_document(sha1_fingerprint) + assert response_fingerprint_test.document.validate_document(sha1_fingerprint, true, :fingerprint_alg => XMLSecurity::Document::SHA1) + + assert response_fingerprint_test.document.validate_document(sha1_fingerprint_downcase) + assert response_fingerprint_test.document.validate_document(sha1_fingerprint_downcase, true, :fingerprint_alg => XMLSecurity::Document::SHA1) + end + + it "validate using SHA256" do + sha256_fingerprint = "C4:C6:BD:41:EC:AD:57:97:CE:7B:7D:80:06:C3:E4:30:53:29:02:0B:DD:2D:47:02:9E:BD:85:AD:93:02:45:21" + + assert !response_fingerprint_test.document.validate_document(sha256_fingerprint) + assert response_fingerprint_test.document.validate_document(sha256_fingerprint, true, :fingerprint_alg => XMLSecurity::Document::SHA256) + end + + it "validate using SHA384" do + sha384_fingerprint = "98:FE:17:90:31:E7:68:18:8A:65:4D:DA:F5:76:E2:09:97:BE:8B:E3:7E:AA:8D:63:64:7C:0C:38:23:9A:AC:A2:EC:CE:48:A6:74:4D:E0:4C:50:80:40:B4:8D:55:14:14" + + assert !response_fingerprint_test.document.validate_document(sha384_fingerprint) + assert response_fingerprint_test.document.validate_document(sha384_fingerprint, true, :fingerprint_alg => XMLSecurity::Document::SHA384) + end + + it "validate using SHA512" do + sha512_fingerprint = "5A:AE:BA:D0:BA:9D:1E:25:05:01:1E:1A:C9:E9:FF:DB:ED:FA:6E:F7:52:EB:45:49:BD:DB:06:D8:A3:7E:CC:63:3A:04:A2:DD:DF:EE:61:05:D9:58:95:2A:77:17:30:4B:EB:4A:9F:48:4A:44:1C:D0:9E:0B:1E:04:77:FD:A3:D2" + + assert !response_fingerprint_test.document.validate_document(sha512_fingerprint) + assert response_fingerprint_test.document.validate_document(sha512_fingerprint, true, :fingerprint_alg => XMLSecurity::Document::SHA512) + end + + end + + describe "Signature Algorithms" do + it "validate using SHA1" do + document = XMLSecurity::SignedDocument.new(fixture(:adfs_response_sha1, false)) + assert document.validate_document("F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72") + end + + it "validate using SHA256" do + document = XMLSecurity::SignedDocument.new(fixture(:adfs_response_sha256, false)) + assert document.validate_document("28:74:9B:E8:1F:E8:10:9C:A8:7C:A9:C3:E3:C5:01:6C:92:1C:B4:BA") + end + + it "validate using SHA384" do + document = XMLSecurity::SignedDocument.new(fixture(:adfs_response_sha384, false)) + assert document.validate_document("F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72") + end + + it "validate using SHA512" do + document = XMLSecurity::SignedDocument.new(fixture(:adfs_response_sha512, false)) + assert document.validate_document("F1:3C:6B:80:90:5A:03:0E:6C:91:3E:5D:15:FA:DD:B0:16:45:48:72") + end + end + + describe "XmlSecurity::SignedDocument" do + + describe "#extract_inclusive_namespaces" do + it "support explicit namespace resolution for exclusive canonicalization" do + response = fixture(:open_saml_response, false) + document = XMLSecurity::SignedDocument.new(response) + inclusive_namespaces = document.send(:extract_inclusive_namespaces) + + assert_equal %w[ xs ], inclusive_namespaces + end + + it "support implicit namespace resolution for exclusive canonicalization" do + response = fixture(:no_signature_ns, false) + document = XMLSecurity::SignedDocument.new(response) + inclusive_namespaces = document.send(:extract_inclusive_namespaces) + + assert_equal %w[ #default saml ds xs xsi ], inclusive_namespaces + end + + it 'support inclusive canonicalization' do + skip('test not yet implemented') + response = OneLogin::RubySaml::Response.new(fixture("tdnf_response.xml")) + response.stubs(:conditions).returns(nil) + assert !response.is_valid? + assert !response.is_valid? + response.settings = settings + assert !response.is_valid? + settings.idp_cert_fingerprint = "e6 38 9a 20 b7 4f 13 db 6a bc b1 42 6a e7 52 1d d6 56 d4 1b".upcase.gsub(" ", ":") + assert response.is_valid? + end + + it "return nil when inclusive namespace element is missing" do + response = fixture(:no_signature_ns, false) + response.slice! %r{} + + document = XMLSecurity::SignedDocument.new(response) + inclusive_namespaces = document.send(:extract_inclusive_namespaces) + + assert inclusive_namespaces.nil? + end + end + + describe "XMLSecurity::DSIG" do + before do + settings.idp_sso_service_url = "https://idp.example.com/sso" + settings.protocol_binding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" + settings.idp_slo_service_url = "https://idp.example.com/slo", + settings.sp_entity_id = "https://sp.example.com/saml2" + settings.assertion_consumer_service_url = "https://sp.example.com/acs" + settings.single_logout_service_url = "https://sp.example.com/sls" + end + + it "sign an AuthNRequest" do + request = OneLogin::RubySaml::Authrequest.new.create_authentication_xml_doc(settings) + request.sign_document(ruby_saml_key, ruby_saml_cert) + # verify our signature + signed_doc = XMLSecurity::SignedDocument.new(request.to_s) + assert signed_doc.validate_document(ruby_saml_cert_fingerprint, false) + + request2 = OneLogin::RubySaml::Authrequest.new.create_authentication_xml_doc(settings) + request2.sign_document(ruby_saml_key, ruby_saml_cert_text) + # verify our signature + signed_doc2 = XMLSecurity::SignedDocument.new(request2.to_s) + assert signed_doc2.validate_document(ruby_saml_cert_fingerprint, false) + end + + it "sign an AuthNRequest with certificate as text" do + request = OneLogin::RubySaml::Authrequest.new.create_authentication_xml_doc(settings) + request.sign_document(ruby_saml_key, ruby_saml_cert_text) + + # verify our signature + signed_doc = XMLSecurity::SignedDocument.new(request.to_s) + assert signed_doc.validate_document(ruby_saml_cert_fingerprint, false) + end + + it "sign a LogoutRequest" do + logout_request = OneLogin::RubySaml::Logoutrequest.new.create_logout_request_xml_doc(settings) + logout_request.sign_document(ruby_saml_key, ruby_saml_cert) + # verify our signature + signed_doc = XMLSecurity::SignedDocument.new(logout_request.to_s) + assert signed_doc.validate_document(ruby_saml_cert_fingerprint, false) + + logout_request2 = OneLogin::RubySaml::Logoutrequest.new.create_logout_request_xml_doc(settings) + logout_request2.sign_document(ruby_saml_key, ruby_saml_cert_text) + # verify our signature + signed_doc2 = XMLSecurity::SignedDocument.new(logout_request2.to_s) + signed_doc2.validate_document(ruby_saml_cert_fingerprint, false) + assert signed_doc2.validate_document(ruby_saml_cert_fingerprint, false) + end + + it "sign a LogoutResponse" do + logout_response = OneLogin::RubySaml::SloLogoutresponse.new.create_logout_response_xml_doc(settings, 'request_id_example', "Custom Logout Message") + logout_response.sign_document(ruby_saml_key, ruby_saml_cert) + # verify our signature + signed_doc = XMLSecurity::SignedDocument.new(logout_response.to_s) + assert signed_doc.validate_document(ruby_saml_cert_fingerprint, false) + + logout_response2 = OneLogin::RubySaml::SloLogoutresponse.new.create_logout_response_xml_doc(settings, 'request_id_example', "Custom Logout Message") + logout_response2.sign_document(ruby_saml_key, ruby_saml_cert_text) + # verify our signature + signed_doc2 = XMLSecurity::SignedDocument.new(logout_response2.to_s) + signed_doc2.validate_document(ruby_saml_cert_fingerprint, false) + assert signed_doc2.validate_document(ruby_saml_cert_fingerprint, false) + end + end + + describe "StarfieldTMS" do + let (:response) { OneLogin::RubySaml::Response.new(fixture(:starfield_response)) } + + before do + response.settings = OneLogin::RubySaml::Settings.new(:idp_cert_fingerprint => "8D:BA:53:8E:A3:B6:F9:F1:69:6C:BB:D9:D8:BD:41:B3:AC:4F:9D:4D") + end + + it "be able to validate a good response" do + Timecop.freeze Time.parse('2012-11-28 17:55:00 UTC') do + response.stubs(:validate_subject_confirmation).returns(true) + assert response.is_valid? + end + end + + it "fail before response is valid" do + Timecop.freeze Time.parse('2012-11-20 17:55:00 UTC') do + assert !response.is_valid? + + time_1 = '2012-11-20 17:55:00 UTC < 2012-11-28 17:53:45 UTC' + time_2 = 'Tue Nov 20 17:55:00 UTC 2012 < Wed Nov 28 17:53:45 UTC 2012' + + errors = [time_1, time_2].map do |time| + "Current time is earlier than NotBefore condition (#{time} - 1s)" + end + + assert_predicate(response.errors & errors, :any?) + end + end + + it "fail after response expires" do + Timecop.freeze Time.parse('2012-11-30 17:55:00 UTC') do + assert !response.is_valid? + + contains_expected_error = response.errors.include?("Current time is on or after NotOnOrAfter condition (2012-11-30 17:55:00 UTC >= 2012-11-28 18:33:45 UTC + 1s)") + contains_expected_error ||= response.errors.include?("Current time is on or after NotOnOrAfter condition (Fri Nov 30 17:55:00 UTC 2012 >= Wed Nov 28 18:33:45 UTC 2012 + 1s)") + assert contains_expected_error + end + end + end + + describe '#validate_document' do + describe 'with valid document' do + describe 'when response has signed message and assertion' do + let(:document_data) { read_response('response_with_signed_message_and_assertion.xml') } + let(:document) { OneLogin::RubySaml::Response.new(document_data).document } + let(:fingerprint) { '4b68c453c7d994aad9025c99d5efcf566287fe8d' } + + it 'is valid' do + assert document.validate_document(fingerprint, true), 'Document should be valid' + end + end + + describe 'when response has signed assertion' do + let(:document_data) { read_response('response_with_signed_assertion_3.xml') } + let(:document) { OneLogin::RubySaml::Response.new(document_data).document } + let(:fingerprint) { '4b68c453c7d994aad9025c99d5efcf566287fe8d' } + + it 'is valid' do + assert document.validate_document(fingerprint, true), 'Document should be valid' + end + end + end + + describe 'signature_wrapping_attack' do + let(:document_data) { read_invalid_response("signature_wrapping_attack.xml.base64") } + let(:document) { OneLogin::RubySaml::Response.new(document_data).document } + let(:fingerprint) { 'afe71c28ef740bc87425be13a2263d37971da1f9' } + + it 'is invalid' do + assert !document.validate_document(fingerprint, true), 'Document should be invalid' + end + end + + describe 'signature wrapping attack - doubled SAML response body' do + let(:document_data) { read_invalid_response("response_with_doubled_signed_assertion.xml") } + let(:document) { OneLogin::RubySaml::Response.new(document_data) } + let(:fingerprint) { '4b68c453c7d994aad9025c99d5efcf566287fe8d' } + + it 'is valid, but the unsigned information is ignored in favour of the signed information' do + assert document.document.validate_document(fingerprint, true), 'Document should be valid' + assert_equal 'someone@example.org', document.name_id, 'Document should expose only signed, valid details' + end + end + + describe 'signature wrapping attack - concealed SAML response body' do + let(:document_data) { read_invalid_response("response_with_concealed_signed_assertion.xml") } + let(:document) { OneLogin::RubySaml::Response.new(document_data) } + let(:fingerprint) { '4b68c453c7d994aad9025c99d5efcf566287fe8d' } + + it 'is valid, but fails to retrieve information' do + assert document.document.validate_document(fingerprint, true), 'Document should be valid' + assert document.name_id.nil?, 'Document should expose only signed, valid details' + end + end + end + + describe '#validate_document_with_cert' do + let(:document_data) { read_response('response_with_signed_message_and_assertion.xml') } + let(:document) { OneLogin::RubySaml::Response.new(document_data).document } + let(:idp_cert) { OpenSSL::X509::Certificate.new(ruby_saml_cert_text) } + let(:fingerprint) { '4b68c453c7d994aad9025c99d5efcf566287fe8d' } + + describe 'with invalid document ' do + describe 'when certificate is invalid' do + let(:document) { OneLogin::RubySaml::Response.new(document_data).document } + + it 'is invalid' do + wrong_document_data = document_data.sub(/.*<\/ds:X509Certificate>/, "invalid<\/ds:X509Certificate>") + wrong_document = OneLogin::RubySaml::Response.new(wrong_document_data).document + refute wrong_document.validate_document_with_cert(idp_cert), 'Document should be invalid' + end + end + end + + describe 'with valid document' do + describe 'when response has cert' do + it 'is valid' do + assert document.validate_document_with_cert(idp_cert), 'Document should be valid' + end + end + + describe 'when response has no cert but you have local cert' do + let(:document) { OneLogin::RubySaml::Response.new(response_document_valid_signed_without_x509certificate).document } + let(:idp_cert) { OpenSSL::X509::Certificate.new(ruby_saml_cert_text) } + + it 'is valid' do + assert document.validate_document_with_cert(idp_cert), 'Document should be valid' + end + end + end + + describe 'when response has no cert but you have local cert' do + let(:document_data) { response_document_valid_signed_without_x509certificate } + + it 'is valid' do + assert document.validate_document_with_cert(idp_cert), 'Document should be valid' + end + end + + describe 'when response cert is invalid' do + let(:document_data) do + contents = read_response('response_with_signed_message_and_assertion.xml') + contents.sub(/.*<\/ds:X509Certificate>/, + "an-invalid-certificate") + end + + it 'is not valid' do + assert !document.validate_document_with_cert(idp_cert), 'Document should be valid' + assert_equal(["Document Certificate Error"], document.errors) + end + end + + describe 'when response cert is different from idp cert' do + let(:idp_cert) { OpenSSL::X509::Certificate.new(ruby_saml_cert_text2) } + + it 'is not valid' do + exception = assert_raises(OneLogin::RubySaml::ValidationError) do + document.validate_document_with_cert(idp_cert, false) + end + assert_equal("Certificate of the Signature element does not match provided certificate", exception.message) + end + + it 'is not valid (soft = true)' do + document.validate_document_with_cert(idp_cert) + assert_equal(["Certificate of the Signature element does not match provided certificate"], document.errors) + end + end + end + end +end diff --git a/sso_login_box.gemspec b/sso_login_box.gemspec new file mode 100644 index 0000000..f541260 --- /dev/null +++ b/sso_login_box.gemspec @@ -0,0 +1,19 @@ +$:.push File.expand_path("../lib", __FILE__) + +# Maintain your gem's version: +require "sso_login_box/version" + +# Describe your gem and declare its dependencies: +Gem::Specification.new do |s| + s.name = "sso_login_box" + s.version = SsoLoginBox::VERSION + s.authors = ["BOHUNG CHIU"] + s.email = ["bohung@rulingcom.com"] + s.homepage = "http://www.rulingcom.com" + s.summary = "Summary of SsoLoginBox." + s.description = "Description of SsoLoginBox." + s.license = "MIT" + s.add_dependency 'ruby-saml', '~> 1.12.2' + s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"] + s.test_files = Dir["test/**/*"] +end diff --git a/test/dummy/README.rdoc b/test/dummy/README.rdoc new file mode 100644 index 0000000..dd4e97e --- /dev/null +++ b/test/dummy/README.rdoc @@ -0,0 +1,28 @@ +== README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... + + +Please feel free to use a different markup language if you do not plan to run +rake doc:app. diff --git a/test/dummy/Rakefile b/test/dummy/Rakefile new file mode 100644 index 0000000..ba6b733 --- /dev/null +++ b/test/dummy/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require File.expand_path('../config/application', __FILE__) + +Rails.application.load_tasks diff --git a/test/dummy/app/assets/images/.keep b/test/dummy/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/assets/javascripts/application.js b/test/dummy/app/assets/javascripts/application.js new file mode 100644 index 0000000..a1873dd --- /dev/null +++ b/test/dummy/app/assets/javascripts/application.js @@ -0,0 +1,13 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// compiled file. +// +// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details +// about supported directives. +// +//= require_tree . diff --git a/test/dummy/app/assets/stylesheets/application.css b/test/dummy/app/assets/stylesheets/application.css new file mode 100644 index 0000000..a443db3 --- /dev/null +++ b/test/dummy/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any styles + * defined in the other CSS/SCSS files in this directory. It is generally better to create a new + * file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/test/dummy/app/controllers/application_controller.rb b/test/dummy/app/controllers/application_controller.rb new file mode 100644 index 0000000..d83690e --- /dev/null +++ b/test/dummy/app/controllers/application_controller.rb @@ -0,0 +1,5 @@ +class ApplicationController < ActionController::Base + # Prevent CSRF attacks by raising an exception. + # For APIs, you may want to use :null_session instead. + protect_from_forgery with: :exception +end diff --git a/test/dummy/app/controllers/concerns/.keep b/test/dummy/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/helpers/application_helper.rb b/test/dummy/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/test/dummy/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/test/dummy/app/mailers/.keep b/test/dummy/app/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/models/.keep b/test/dummy/app/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/models/concerns/.keep b/test/dummy/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/app/views/layouts/application.html.erb b/test/dummy/app/views/layouts/application.html.erb new file mode 100644 index 0000000..593a778 --- /dev/null +++ b/test/dummy/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + Dummy + <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> + <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> + <%= csrf_meta_tags %> + + + +<%= yield %> + + + diff --git a/test/dummy/bin/bundle b/test/dummy/bin/bundle new file mode 100644 index 0000000..66e9889 --- /dev/null +++ b/test/dummy/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/test/dummy/bin/rails b/test/dummy/bin/rails new file mode 100644 index 0000000..728cd85 --- /dev/null +++ b/test/dummy/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/test/dummy/bin/rake b/test/dummy/bin/rake new file mode 100644 index 0000000..1724048 --- /dev/null +++ b/test/dummy/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/test/dummy/config.ru b/test/dummy/config.ru new file mode 100644 index 0000000..5bc2a61 --- /dev/null +++ b/test/dummy/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Rails.application diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb new file mode 100644 index 0000000..c5ce1cd --- /dev/null +++ b/test/dummy/config/application.rb @@ -0,0 +1,23 @@ +require File.expand_path('../boot', __FILE__) + +require 'rails/all' + +Bundler.require(*Rails.groups) +require "sso_login_box" + +module Dummy + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + end +end + diff --git a/test/dummy/config/boot.rb b/test/dummy/config/boot.rb new file mode 100644 index 0000000..6266cfc --- /dev/null +++ b/test/dummy/config/boot.rb @@ -0,0 +1,5 @@ +# Set up gems listed in the Gemfile. +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) + +require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) +$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__) diff --git a/test/dummy/config/database.yml b/test/dummy/config/database.yml new file mode 100644 index 0000000..1c1a37c --- /dev/null +++ b/test/dummy/config/database.yml @@ -0,0 +1,25 @@ +# SQLite version 3.x +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem 'sqlite3' +# +default: &default + adapter: sqlite3 + pool: 5 + timeout: 5000 + +development: + <<: *default + database: db/development.sqlite3 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: db/test.sqlite3 + +production: + <<: *default + database: db/production.sqlite3 diff --git a/test/dummy/config/environment.rb b/test/dummy/config/environment.rb new file mode 100644 index 0000000..ee8d90d --- /dev/null +++ b/test/dummy/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require File.expand_path('../application', __FILE__) + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/test/dummy/config/environments/development.rb b/test/dummy/config/environments/development.rb new file mode 100644 index 0000000..ddf0e90 --- /dev/null +++ b/test/dummy/config/environments/development.rb @@ -0,0 +1,37 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true + + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/test/dummy/config/environments/production.rb b/test/dummy/config/environments/production.rb new file mode 100644 index 0000000..b93a877 --- /dev/null +++ b/test/dummy/config/environments/production.rb @@ -0,0 +1,78 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Enable Rack::Cache to put a simple HTTP cache in front of your application + # Add `rack-cache` to your Gemfile before enabling this. + # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. + # config.action_dispatch.rack_cache = true + + # Disable Rails's static asset server (Apache or nginx will already do this). + config.serve_static_assets = false + + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # Generate digests for assets URLs. + config.assets.digest = true + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Set to :debug to see everything in the log. + config.log_level = :info + + # Prepend all log lines with the following tags. + # config.log_tags = [ :subdomain, :uuid ] + + # Use a different logger for distributed setups. + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = "http://assets.example.com" + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Disable automatic flushing of the log to improve performance. + # config.autoflush_log = false + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb new file mode 100644 index 0000000..053f5b6 --- /dev/null +++ b/test/dummy/config/environments/test.rb @@ -0,0 +1,39 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure static asset server for tests with Cache-Control for performance. + config.serve_static_assets = true + config.static_cache_control = 'public, max-age=3600' + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/test/dummy/config/initializers/assets.rb b/test/dummy/config/initializers/assets.rb new file mode 100644 index 0000000..d2f4ec3 --- /dev/null +++ b/test/dummy/config/initializers/assets.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. +# Rails.application.config.assets.precompile += %w( search.js ) diff --git a/test/dummy/config/initializers/backtrace_silencers.rb b/test/dummy/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..59385cd --- /dev/null +++ b/test/dummy/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/test/dummy/config/initializers/cookies_serializer.rb b/test/dummy/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..7a06a89 --- /dev/null +++ b/test/dummy/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :json \ No newline at end of file diff --git a/test/dummy/config/initializers/filter_parameter_logging.rb b/test/dummy/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..4a994e1 --- /dev/null +++ b/test/dummy/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/test/dummy/config/initializers/inflections.rb b/test/dummy/config/initializers/inflections.rb new file mode 100644 index 0000000..ac033bf --- /dev/null +++ b/test/dummy/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/test/dummy/config/initializers/mime_types.rb b/test/dummy/config/initializers/mime_types.rb new file mode 100644 index 0000000..dc18996 --- /dev/null +++ b/test/dummy/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf diff --git a/test/dummy/config/initializers/session_store.rb b/test/dummy/config/initializers/session_store.rb new file mode 100644 index 0000000..e766b67 --- /dev/null +++ b/test/dummy/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.session_store :cookie_store, key: '_dummy_session' diff --git a/test/dummy/config/initializers/wrap_parameters.rb b/test/dummy/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..33725e9 --- /dev/null +++ b/test/dummy/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] if respond_to?(:wrap_parameters) +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/test/dummy/config/locales/en.yml b/test/dummy/config/locales/en.yml new file mode 100644 index 0000000..0653957 --- /dev/null +++ b/test/dummy/config/locales/en.yml @@ -0,0 +1,23 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/test/dummy/config/routes.rb b/test/dummy/config/routes.rb new file mode 100644 index 0000000..ad4e705 --- /dev/null +++ b/test/dummy/config/routes.rb @@ -0,0 +1,4 @@ +Rails.application.routes.draw do + + mount SsoLoginBox::Engine => "/sso_login_box" +end diff --git a/test/dummy/config/secrets.yml b/test/dummy/config/secrets.yml new file mode 100644 index 0000000..563b6ae --- /dev/null +++ b/test/dummy/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: 1c70c6a75cd33547c6701c3777914171aa4b75ae8b70a2b4e6aed83ee9f3ac1f857af9b87df5da3f7cda91b14b0c9d313ac649020e56bc22b8c01f3607e006dc + +test: + secret_key_base: 61ef21af5ee40a676dca321676e47f191d85d98939f286c8a0508cecf17d22f41256b7400861d00ab86492c058a5a0cbba75f26a07afd041f46567276d4f63b3 + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/test/dummy/lib/assets/.keep b/test/dummy/lib/assets/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/log/.keep b/test/dummy/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/dummy/public/404.html b/test/dummy/public/404.html new file mode 100644 index 0000000..b612547 --- /dev/null +++ b/test/dummy/public/404.html @@ -0,0 +1,67 @@ + + + + The page you were looking for doesn't exist (404) + + + + + + +
+
+

The page you were looking for doesn't exist.

+

You may have mistyped the address or the page may have moved.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/test/dummy/public/422.html b/test/dummy/public/422.html new file mode 100644 index 0000000..a21f82b --- /dev/null +++ b/test/dummy/public/422.html @@ -0,0 +1,67 @@ + + + + The change you wanted was rejected (422) + + + + + + +
+
+

The change you wanted was rejected.

+

Maybe you tried to change something you didn't have access to.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/test/dummy/public/500.html b/test/dummy/public/500.html new file mode 100644 index 0000000..061abc5 --- /dev/null +++ b/test/dummy/public/500.html @@ -0,0 +1,66 @@ + + + + We're sorry, but something went wrong (500) + + + + + + +
+
+

We're sorry, but something went wrong.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/test/dummy/public/favicon.ico b/test/dummy/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/test/integration/navigation_test.rb b/test/integration/navigation_test.rb new file mode 100644 index 0000000..97a94c9 --- /dev/null +++ b/test/integration/navigation_test.rb @@ -0,0 +1,10 @@ +require 'test_helper' + +class NavigationTest < ActionDispatch::IntegrationTest + fixtures :all + + # test "the truth" do + # assert true + # end +end + diff --git a/test/sso_login_box_test.rb b/test/sso_login_box_test.rb new file mode 100644 index 0000000..8512c04 --- /dev/null +++ b/test/sso_login_box_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SsoLoginBoxTest < ActiveSupport::TestCase + test "truth" do + assert_kind_of Module, SsoLoginBox + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..a553d9a --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,19 @@ +# Configure Rails Environment +ENV["RAILS_ENV"] = "test" + +require File.expand_path("../../test/dummy/config/environment.rb", __FILE__) +ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)] +ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__) +require "rails/test_help" + +# Filter out Minitest backtrace while allowing backtrace from other libraries +# to be shown. +Minitest.backtrace_filter = Minitest::BacktraceFilter.new + +# Load support files +Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } + +# Load fixtures from the engine +if ActiveSupport::TestCase.method_defined?(:fixture_path=) + ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__) +end