From c17f89b3e7135c95548453c75b7d3983675c469b Mon Sep 17 00:00:00 2001 From: Christian Pedersen Date: Thu, 29 Jul 2010 14:14:35 +0200 Subject: [PATCH] updated with UUID-type ID's --- example/app/models/account.rb | 6 +++--- lib/onelogin/saml/authrequest.rb | 7 ++----- ruby-saml.gemspec | 5 ++--- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/example/app/models/account.rb b/example/app/models/account.rb index c0319e9bd..dd045f6c2 100644 --- a/example/app/models/account.rb +++ b/example/app/models/account.rb @@ -7,10 +7,10 @@ def Account.get_saml_settings # should retrieve SAML-settings based on subdomain, IP-address, NameID or similar settings = Onelogin::Saml::Settings.new - settings.assertion_consumer_service_url = "http://localhost:3008/sessions/complete" + settings.assertion_consumer_service_url = "http://localhost:3000/sessions/complete" settings.issuer = "mysaasapp.com" # the name of your application - settings.idp_sso_target_url = "http://app.localhost:3000/saml/signon/3763" - settings.idp_cert_fingerprint = "90:CC:16:F0:8D:A6:D1:C6:BB:27:2D:BA:93:80:1A:1F:16:8E:4E:08" + settings.idp_sso_target_url = "https://app.onelogin.com/saml/signon/8216" + settings.idp_cert_fingerprint = "90:CC:16:F1:...." settings.name_identifier_format = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" settings diff --git a/lib/onelogin/saml/authrequest.rb b/lib/onelogin/saml/authrequest.rb index d3b906dae..b51487249 100644 --- a/lib/onelogin/saml/authrequest.rb +++ b/lib/onelogin/saml/authrequest.rb @@ -1,4 +1,5 @@ require "base64" +require "uuid" module Onelogin::Saml class Authrequest @@ -24,11 +25,7 @@ def create(settings) private def self.generateUniqueID(length) - chars = ("a".."f").to_a + ("0".."9").to_a - chars_len = chars.size - uniqueID = "" - 1.upto(length) { |i| uniqueID << chars[rand(chars_len-1)] } - uniqueID + UUID.new.generate end def self.getTimestamp diff --git a/ruby-saml.gemspec b/ruby-saml.gemspec index 520c1a2f4..8015a506a 100644 --- a/ruby-saml.gemspec +++ b/ruby-saml.gemspec @@ -5,11 +5,11 @@ Gem::Specification.new do |s| s.name = %q{ruby-saml} - s.version = "0.0.3" + s.version = "0.0.4" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["OneLogin LLC"] - s.date = %q{2010-07-22} + s.date = %q{2010-07-29} s.description = %q{SAML toolkit for Ruby on Rails} s.email = %q{support@onelogin.com} s.extra_rdoc_files = [ @@ -82,7 +82,6 @@ Gem::Specification.new do |s| "lib/onelogin/saml/settings.rb", "lib/ruby-saml.rb", "lib/xml_sec.rb", - "license.txt", "ruby-saml.gemspec", "test/ruby-saml_test.rb", "test/test_helper.rb"