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
34
34
35
35
def auth_hash
36
36
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 )
38
38
expected_signature = Base64 . strict_encode64 raw_expected_signature
39
39
signature = access_token . params [ 'signature' ]
40
40
fail! "Salesforce user id did not match signature!" unless signature == expected_signature
@@ -79,7 +79,7 @@ def raw_info
79
79
'issued_at' => access_token . params [ 'issued_at' ]
80
80
} )
81
81
end
82
-
82
+
83
83
end
84
84
85
85
class SalesforceSandbox < OmniAuth ::Strategies ::Salesforce
Original file line number Diff line number Diff line change 17
17
'REQUEST_METHOD' => 'GET' ,
18
18
'rack.input' => '' ,
19
19
'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' => '' ,
23
23
'SERVER_PORT' => 80
24
24
}
25
25
end
107
107
it "returns an info hash" do
108
108
subject . should_not be_nil
109
109
end
110
- it "sets name" do
110
+ it "sets name" do
111
111
subject [ 'name' ] . should == raw_info [ 'display_name' ]
112
112
end
113
113
it "sets email" do
140
140
end
141
141
describe "credentials" do
142
142
subject { strategy . credentials }
143
- it "sets token" do
143
+ it "sets token" do
144
144
subject [ 'token' ] . should == strategy . access_token . token
145
145
end
146
146
it "sets instance_url" do
180
180
before do
181
181
client_id = "https://login.salesforce.com/id/00Dd0000000d45TEBQ/005d0000000fyGPCCY"
182
182
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 ) )
184
184
end
185
185
context "when the signature does not match" do
186
186
before do
You can’t perform that action at this time.
0 commit comments