Module: Appilf::Authentication
- Included in:
- Client
- Defined in:
- lib/appilf/authentication.rb
Constant Summary collapse
- PATH =
"#{APIActions::BASE_API_URL}/oauth2/token"
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#password ⇒ Object
Returns the value of attribute password.
-
#token_type ⇒ Object
Returns the value of attribute token_type.
-
#user ⇒ Object
Returns the value of attribute user.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
6 7 8 |
# File 'lib/appilf/authentication.rb', line 6 def access_token @access_token end |
#password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/appilf/authentication.rb', line 6 def password @password end |
#token_type ⇒ Object
Returns the value of attribute token_type.
6 7 8 |
# File 'lib/appilf/authentication.rb', line 6 def token_type @token_type end |
#user ⇒ Object
Returns the value of attribute user.
6 7 8 |
# File 'lib/appilf/authentication.rb', line 6 def user @user end |
#username ⇒ Object
Returns the value of attribute username.
6 7 8 |
# File 'lib/appilf/authentication.rb', line 6 def username @username end |
Instance Method Details
#authenticate ⇒ Object
13 14 15 |
# File 'lib/appilf/authentication.rb', line 13 def authenticate auth_by_password if username && password end |
#authenticated_user_path ⇒ Object
21 22 23 |
# File 'lib/appilf/authentication.rb', line 21 def authenticated_user_path users_path(user.id) end |
#authentication_headers ⇒ Object
17 18 19 |
# File 'lib/appilf/authentication.rb', line 17 def authentication_headers { Authorization: self.access_token } end |