Permalink
Browse files

make request ids always start with a letter to be xml compliant

also fix rand() so that 9's are allowed in the request id
  • Loading branch information...
ccutrer committed Apr 9, 2012
1 parent 3cf8389 commit 4bf3707f711238a5103bffd9051e33e13e77bbfb
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/onelogin/saml/auth_request.rb
@@ -41,8 +41,8 @@ def generate_request
def self.generate_unique_id(length)
chars = ("a".."f").to_a + ("0".."9").to_a
chars_len = chars.size
- unique_id = ""
- 1.upto(length) { |i| unique_id << chars[rand(chars_len-1)] }
+ unique_id = ("a".."f").to_a[rand(6)]
+ 2.upto(length) { |i| unique_id << chars[rand(chars_len)] }
unique_id
end

0 comments on commit 4bf3707

Please sign in to comment.