와 비 레일 REST API를 소비 ... 심지어 "나머지"부분이 의심 스럽다 사실이지만 시도 :는 ActiveResource
Although RESTful applications are ideally stateless, the ALM platform requires sessions to manage locking, client life time, and perform other basic tasks. Session management is performed using a cookie named QCSession.
을 어쨌든, 내가 필요 하나의 GET을 "authentication-point/authenticate"로 발행하여 사용자를 인증하고 쿠키를 다시 가져옵니다. 어떻게하는지 잘 모르겠습니다. 여기에 내가 가진 것은 있지만 404 오류가 발생합니다 :
class AlmActiveResource < ActiveResource::Base
attr_accessor :lwsso_cookie, :qcsession_cookie
self.site = "http://alm_url/qcbin/"
self.user = "name"
self.password = "pw"
def self.authentication
@auth_point = "authentication-point/authenticate"
self.prefix(@auth_point)
meow = self.get(:authenticate)
Rails.logger.debug("Meow: #{meow.inspect}")
end
end
미친 소품! 고맙습니다. – ScottJShea