Class: Fripa::Authenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/fripa/authenticator.rb

Constant Summary collapse

LOGIN_PATH =
"/ipa/session/login_password"
CONTENT_TYPE =
"application/x-www-form-urlencoded"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Authenticator

Returns a new instance of Authenticator.



13
14
15
# File 'lib/fripa/authenticator.rb', line 13

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



11
12
13
# File 'lib/fripa/authenticator.rb', line 11

def client
  @client
end

Instance Method Details

#login!Object



17
18
19
20
21
22
23
24
# File 'lib/fripa/authenticator.rb', line 17

def login!
  validate_credentials!
  response = 

  raise AuthenticationError, "Login failed: #{response.status}" unless response.success?

  response.headers["set-cookie"]
end