Class: DoceboRuby::User
- Defined in:
- lib/docebo_ruby/user.rb
Class Method Summary collapse
- .authenticate(username, password) ⇒ Object
- .check_username(username) ⇒ Object
- .create(attributes = {}) ⇒ Object
- .sso_url(username) ⇒ Object
Methods inherited from Resource
Class Method Details
.authenticate(username, password) ⇒ Object
14 15 16 17 18 |
# File 'lib/docebo_ruby/user.rb', line 14 def authenticate(username, password) fetch_data('authenticate', {password: password, username: username}) do |response| response['id_user'] || false end end |
.check_username(username) ⇒ Object
10 11 12 |
# File 'lib/docebo_ruby/user.rb', line 10 def check_username(username) fetch_data('checkUsername', {userid: username})['success'] end |
.create(attributes = {}) ⇒ Object
6 7 8 |
# File 'lib/docebo_ruby/user.rb', line 6 def create(attributes = {}) fetch_data('create', attributes) end |
.sso_url(username) ⇒ Object
20 21 22 23 24 |
# File 'lib/docebo_ruby/user.rb', line 20 def sso_url(username) = Time.now.to_i token = Digest::MD5.hexdigest([username, , DoceboRuby.config.sso_token].join(',')) "http://#{DoceboRuby.config.saas_url}/doceboLms/index.php?auth_regen=1&modname=login&op=confirm&login_user=#{username}&time=#{}&token=#{token}" end |