Class: Fripa::Authenticator
- Inherits:
-
Object
- Object
- Fripa::Authenticator
- 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
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(client) ⇒ Authenticator
constructor
A new instance of Authenticator.
- #login! ⇒ Object
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
#client ⇒ Object (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 = perform_login raise AuthenticationError, "Login failed: #{response.status}" unless response.success? response.headers["set-cookie"] end |