Module: Auth0::Api::V1::Users
- Included in:
- Auth0::Api::V1
- Defined in:
- lib/auth0/api/v1/users.rb
Overview
Instance Method Summary collapse
- #change_password_ticket(user_id, new_password, result_url = nil) ⇒ Object
- #client_users(client_id = @client_id) ⇒ Object
- #connection_users(connection_name, search = nil) ⇒ Object (also: #search_connection_users)
- #create_public_key(user_id, device, public_key) ⇒ Object
- #create_user(email, password, connection_name, request_params = {}) ⇒ Object
-
#delete_user(user_id) ⇒ Object
-.
- #delete_users ⇒ Object
-
#enterpriseconnections_users(search_criteria = nil, per_page = 500) ⇒ Object
-.
- #patch_user_metadata(user_id, metadata = {}) ⇒ Object
-
#revoke_user_device_public_key(user_id, device) ⇒ Object
-.
-
#revoke_user_refresh_token(user_id, refresh_token) ⇒ Object
-.
- #send_verification_email(user_id) ⇒ Object
-
#socialconnections_users(search_criteria = nil, per_page = 500) ⇒ Object
-.
- #update_user_email(user_id, email, verify = true) ⇒ Object
-
#update_user_metadata(user_id, metadata = {}) ⇒ Object
https://auth0.com/docs/api#!#put--api-users--user_id--metadata This will overwrite user’s metadata, be really carefull, preffer using patch instead.
- #update_user_password(user_id, password, verify = true) ⇒ Object
- #update_user_password_using_email(email, password, connection_name, verify = true) ⇒ Object
-
#user(user_id) ⇒ Object
(also: #get_user)
-.
- #user_devices(user_id) ⇒ Object
- #users(search = nil) ⇒ Object (also: #users_search, #get_users)
- #verification_ticket(user_id, result_url = nil) ⇒ Object
Instance Method Details
#change_password_ticket(user_id, new_password, result_url = nil) ⇒ Object
75 76 77 78 79 |
# File 'lib/auth0/api/v1/users.rb', line 75 def change_password_ticket(user_id, new_password, result_url=nil) request_params = { "newPassword" => new_password, "resultUrl" => result_url } path = "/api/users/#{user_id}/change_password_ticket" post(path, request_params) end |
#client_users(client_id = @client_id) ⇒ Object
55 56 57 58 |
# File 'lib/auth0/api/v1/users.rb', line 55 def client_users(client_id=@client_id) path = "/api/clients/#{client_id}/users" get(path) end |
#connection_users(connection_name, search = nil) ⇒ Object Also known as: search_connection_users
34 35 36 37 38 |
# File 'lib/auth0/api/v1/users.rb', line 34 def connection_users(connection_name, search=nil) path = "/api/connections/#{connection_name}/users" path += "?search=#{search.to_s}" unless search.to_s.empty? get(path) end |
#create_public_key(user_id, device, public_key) ⇒ Object
89 90 91 92 93 |
# File 'lib/auth0/api/v1/users.rb', line 89 def create_public_key(user_id, device, public_key) path = "/api/users/#{user_id}/public_key" request_params = { device: device, public_key: public_key } post(path, request_params) end |
#create_user(email, password, connection_name, request_params = {}) ⇒ Object
61 62 63 64 65 66 |
# File 'lib/auth0/api/v1/users.rb', line 61 def create_user(email, password, connection_name, request_params={}) = { email: email, password: password, connection: connection_name } request_params.merge!() path = "/api/users" post(path, request_params) end |
#delete_user(user_id) ⇒ Object
143 144 145 146 147 |
# File 'lib/auth0/api/v1/users.rb', line 143 def delete_user(user_id) raise Auth0::MissingUserId, "if you want to remove all users user delete_users method" if user_id.to_s.empty? path = "/api/users/#{user_id}" delete(path) end |
#delete_users ⇒ Object
https://auth0.com/docs/api#!#delete--api-users
This will remove all your users
137 138 139 140 |
# File 'lib/auth0/api/v1/users.rb', line 137 def delete_users path = "/api/users/" delete(path) end |
#enterpriseconnections_users(search_criteria = nil, per_page = 500) ⇒ Object
43 44 45 46 |
# File 'lib/auth0/api/v1/users.rb', line 43 def enterpriseconnections_users(search_criteria=nil, per_page=500) path = "/api/enterpriseconnections/users?search=#{search_criteria.to_s}&per_page=#{per_page.to_i.to_s}" get(path) end |
#patch_user_metadata(user_id, metadata = {}) ⇒ Object
129 130 131 132 |
# File 'lib/auth0/api/v1/users.rb', line 129 def (user_id, ={}) path = "/api/users/#{user_id}/metadata" patch(path, ) end |
#revoke_user_device_public_key(user_id, device) ⇒ Object
156 157 158 159 |
# File 'lib/auth0/api/v1/users.rb', line 156 def revoke_user_device_public_key(user_id, device) path = "/api/users/#{user_id}/publickey?device=#{device}" delete(path) end |
#revoke_user_refresh_token(user_id, refresh_token) ⇒ Object
150 151 152 153 |
# File 'lib/auth0/api/v1/users.rb', line 150 def revoke_user_refresh_token(user_id, refresh_token) path = "/api/users/#{user_id}/refresh_tokens/#{refresh_token}" delete(path) end |
#send_verification_email(user_id) ⇒ Object
69 70 71 72 |
# File 'lib/auth0/api/v1/users.rb', line 69 def send_verification_email(user_id) path = "/api/users/#{user_id}/send_verification_email" post(path) end |
#socialconnections_users(search_criteria = nil, per_page = 500) ⇒ Object
49 50 51 52 |
# File 'lib/auth0/api/v1/users.rb', line 49 def (search_criteria=nil, per_page=500) path = "/api/socialconnections/users?search=#{search_criteria.to_s}&per_page=#{per_page.to_i.to_s}" get(path) end |
#update_user_email(user_id, email, verify = true) ⇒ Object
96 97 98 99 100 |
# File 'lib/auth0/api/v1/users.rb', line 96 def update_user_email(user_id, email, verify=true) path = "/api/users/#{user_id}/email" request_params = { email: email, verify: verify } put(path, request_params) end |
#update_user_metadata(user_id, metadata = {}) ⇒ Object
https://auth0.com/docs/api#!#put--api-users--user_id--metadata This will overwrite user’s metadata, be really carefull, preffer using patch instead
104 105 106 107 |
# File 'lib/auth0/api/v1/users.rb', line 104 def (user_id, ={}) path = "/api/users/#{user_id}/metadata" put(path, ) end |
#update_user_password(user_id, password, verify = true) ⇒ Object
110 111 112 113 114 |
# File 'lib/auth0/api/v1/users.rb', line 110 def update_user_password(user_id, password, verify=true) path = "/api/users/#{user_id}/password" request_params = { password: password, verify: verify } put(path, request_params) end |
#update_user_password_using_email(email, password, connection_name, verify = true) ⇒ Object
117 118 119 120 121 122 123 124 125 126 |
# File 'lib/auth0/api/v1/users.rb', line 117 def update_user_password_using_email(email, password, connection_name, verify=true) request_params = { email: email, password: password, connection: connection_name, verify: verify } path = "/api/users/#{email}/password" put(path, request_params) end |
#user(user_id) ⇒ Object Also known as: get_user
19 20 21 22 |
# File 'lib/auth0/api/v1/users.rb', line 19 def user(user_id) path = "/api/users/#{user_id}" get(path) end |
#user_devices(user_id) ⇒ Object
27 28 29 30 |
# File 'lib/auth0/api/v1/users.rb', line 27 def user_devices(user_id) path = "/api/users/#{user_id}/devices" get(path) end |
#users(search = nil) ⇒ Object Also known as: users_search, get_users
9 10 11 12 13 |
# File 'lib/auth0/api/v1/users.rb', line 9 def users(search=nil) path = "/api/users" path += "?search=#{search.to_s}" unless search.to_s.empty? get(path) end |
#verification_ticket(user_id, result_url = nil) ⇒ Object
82 83 84 85 86 |
# File 'lib/auth0/api/v1/users.rb', line 82 def verification_ticket(user_id, result_url=nil) request_params = {"resultUrl" => result_url} path = "/api/users/#{user_id}/verification_ticket" post(path, request_params) end |