You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lines 83-98 of the same file (https://github.com/zaidakram/expedia/blob/master/lib/expedia/http_service.rb ) is where sig is put together and since Ruby sets variables when the service is started the timestamp is static which makes the sig static which causes authentication failures after about 5 minutes of the service being started.
This is because EAN's service will only authenticate a sig value for 5 minutes based on the EAN server time. To get the EAN server time, use EAN's ping request. Always generate a new sig value for each request to ensure your requests are authenticated.
The text was updated successfully, but these errors were encountered:
Since it's a method and not a variable, how could this be an issue?
# Creates a Signature for Expedia using MD5 Checksum Auth.
# Shared and Api keys are required for Signature along with the current utc time.
def signature
if Expedia.cid && Expedia.api_key && Expedia.shared_secret
Digest::MD5.hexdigest(Expedia.api_key + Expedia.shared_secret + Time.now.utc.to_i.to_s)
else
raise Expedia::AuthCredentialsError, "cid, api_key and shared_secret are required for Expedia Authentication."
end
end
Lines 83-98 of the same file (https://github.com/zaidakram/expedia/blob/master/lib/expedia/http_service.rb ) is where sig is put together and since Ruby sets variables when the service is started the timestamp is static which makes the sig static which causes authentication failures after about 5 minutes of the service being started.
This is because EAN's service will only authenticate a sig value for 5 minutes based on the EAN server time. To get the EAN server time, use EAN's ping request. Always generate a new sig value for each request to ensure your requests are authenticated.
The text was updated successfully, but these errors were encountered: