Method: CTM::Auth.authenticate
- Defined in:
- lib/ctm/auth.rb
.authenticate(token, secret) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/ctm/auth.rb', line 14 def self.authenticate(token, secret) res = self.post("/api/v1/authentication", :body => {:token => token, :secret => secret}) if res.parsed_response && res.parsed_response['success'] CTM::Token.new(res.parsed_response) else raise CTM::Error::Auth.new("Failed to authenticate") end end |