Class: Citadel::Authenticator
- Inherits:
-
Object
- Object
- Citadel::Authenticator
- Defined in:
- lib/citadel-ruby-client/authenticator.rb
Instance Method Summary collapse
Instance Method Details
#get_token(login, password) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/citadel-ruby-client/authenticator.rb', line 7 def get_token(login, password) matrix_paths = MatrixPaths.new url = matrix_paths.base_uri + matrix_paths.login_path data_hash = { type: 'm.login.password', user: login, password: password } data = JSON.generate data_hash response = HTTP.post(url, body: data) JSON.parse(response.body)['access_token'] end |