File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ def request_phase
3434
3535 def auth_hash
3636 signed_value = access_token . params [ 'id' ] + access_token . params [ 'issued_at' ]
37- raw_expected_signature = OpenSSL ::HMAC . digest ( 'sha256' , options . client_secret , signed_value )
37+ raw_expected_signature = OpenSSL ::HMAC . digest ( 'sha256' , options . client_secret . to_s , signed_value )
3838 expected_signature = Base64 . strict_encode64 raw_expected_signature
3939 signature = access_token . params [ 'signature' ]
4040 fail! "Salesforce user id did not match signature!" unless signature == expected_signature
@@ -79,7 +79,7 @@ def raw_info
7979 'issued_at' => access_token . params [ 'issued_at' ]
8080 } )
8181 end
82-
82+
8383 end
8484
8585 class SalesforceSandbox < OmniAuth ::Strategies ::Salesforce
Original file line number Diff line number Diff line change 1717 'REQUEST_METHOD' => 'GET' ,
1818 'rack.input' => '' ,
1919 'rack.url_scheme' => 'http' ,
20- 'SERVER_NAME' => 'server.example' ,
21- 'QUERY_STRING' => 'code=xxxx' ,
22- 'SCRIPT_NAME' => '' ,
20+ 'SERVER_NAME' => 'server.example' ,
21+ 'QUERY_STRING' => 'code=xxxx' ,
22+ 'SCRIPT_NAME' => '' ,
2323 'SERVER_PORT' => 80
2424 }
2525 end
107107 it "returns an info hash" do
108108 subject . should_not be_nil
109109 end
110- it "sets name" do
110+ it "sets name" do
111111 subject [ 'name' ] . should == raw_info [ 'display_name' ]
112112 end
113113 it "sets email" do
140140 end
141141 describe "credentials" do
142142 subject { strategy . credentials }
143- it "sets token" do
143+ it "sets token" do
144144 subject [ 'token' ] . should == strategy . access_token . token
145145 end
146146 it "sets instance_url" do
180180 before do
181181 client_id = "https://login.salesforce.com/id/00Dd0000000d45TEBQ/005d0000000fyGPCCY"
182182 issued_at = "1331142541514"
183- signature = Base64 . strict_encode64 ( OpenSSL ::HMAC . digest ( 'sha256' , strategy . options . client_secret , client_id + issued_at ) )
183+ signature = Base64 . strict_encode64 ( OpenSSL ::HMAC . digest ( 'sha256' , strategy . options . client_secret . to_s , client_id + issued_at ) )
184184 end
185185 context "when the signature does not match" do
186186 before do
You can’t perform that action at this time.
0 commit comments