facebook-signed-request 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,7 @@ module Facebook
|
|
12
12
|
digestor = OpenSSL::Digest::Digest.new('sha256')
|
13
13
|
signature = OpenSSL::HMAC.digest( digestor, @secret, encoded_data )
|
14
14
|
encoded_signature = Base64.strict_encode64( signature )
|
15
|
-
encoded_signature = encoded_signature.
|
15
|
+
encoded_signature = encoded_signature.tr('+/', '-_')
|
16
16
|
|
17
17
|
"#{encoded_signature}.#{encoded_data}"
|
18
18
|
end
|
@@ -59,7 +59,7 @@ module Facebook
|
|
59
59
|
def base64_url_decode( encoded_string_orig )
|
60
60
|
encoded_string = encoded_string_orig.dup
|
61
61
|
encoded_string << '=' until ( encoded_string.length % 4 == 0 )
|
62
|
-
Base64.strict_decode64(encoded_string.
|
62
|
+
Base64.strict_decode64(encoded_string.tr('-_','+/'))
|
63
63
|
end
|
64
64
|
|
65
65
|
def extract_request_signature
|