无法使用 ruby 登录 connectycube
can't signin on connectycube with ruby
我无法使用 ruby 简单代码使其工作:
require "uri"
require "net/http"
timestamp = Time.now.to_i
nonce = 1
params = "application_id=xxx&auth_key=eztzrezrzerezrez&nonce=#{nonce}×tamp=#{timestamp}"
key = "xxxxxxxxxxxxxxxxxxxxxxx"
signature = OpenSSL::HMAC.hexdigest("SHA1", params, key)
params = "#{params}&signature=#{signature}"
url = URI("https://api.connectycube.com/session?#{params}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
response = https.request(request)
puts response.read_body
它一直失败并显示“意外签名”
你能帮忙吗?提前致谢
此致,
我无法使用 ruby 简单代码使其工作:
require "uri"
require "net/http"
timestamp = Time.now.to_i
nonce = 1
params = "application_id=xxx&auth_key=eztzrezrzerezrez&nonce=#{nonce}×tamp=#{timestamp}"
key = "xxxxxxxxxxxxxxxxxxxxxxx"
signature = OpenSSL::HMAC.hexdigest("SHA1", params, key)
params = "#{params}&signature=#{signature}"
url = URI("https://api.connectycube.com/session?#{params}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
response = https.request(request)
puts response.read_body
它一直失败并显示“意外签名”
你能帮忙吗?提前致谢
此致,