Module: Auth0::Api::V1::Users
- Included in:
- Auth0::Api::V1
- Defined in:
- lib/auth0/api/v1/users.rb
Overview
Instance Method Summary (collapse)
- - (Object) change_password_ticket(user_id, new_password, result_url = nil)
- - (Object) client_users(client_id = @client_id)
- - (Object) connection_users(connection_name, search = nil) (also: #search_connection_users)
- - (Object) 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 = {})
https://auth0.com/docs/api#!#put–api-users–user_id–metadata This will overwrite user's metadata, be really carefull, preffer using patch instead.
- - (Object) update_user_password(user_id, password, verify = true)
- - (Object) update_user_password_using_email(email, password, connection_name, verify = true)
- - (Object) user(user_id) (also: #get_user)
- - (Object) user_devices(user_id)
- - (Object) users(search = nil) (also: #users_search, #get_users)
- - (Object) verification_ticket(user_id, result_url = nil)
Instance Method Details
- (Object) change_password_ticket(user_id, new_password, result_url = nil)
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 |
- (Object) client_users(client_id = @client_id)
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 |
- (Object) connection_users(connection_name, search = nil) 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 |
- (Object) create_public_key(user_id, device, public_key)
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 |
- (Object) create_user(email, password, connection_name, request_params = {})
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 |
- (Object) delete_user(user_id)
143 144 145 146 147 |
# File 'lib/auth0/api/v1/users.rb', line 143 def delete_user(user_id) raise Auth0::UserIdIsBlank, "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 |
- (Object) delete_users
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 |
- (Object) enterpriseconnections_users(search_criteria = nil, per_page = 500)
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 |
- (Object) patch_user_metadata(user_id, metadata = {})
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 |
- (Object) revoke_user_device_public_key(user_id, device)
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 |
- (Object) revoke_user_refresh_token(user_id, refresh_token)
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 |
- (Object) send_verification_email(user_id)
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 |
- (Object) socialconnections_users(search_criteria = nil, per_page = 500)
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 |
- (Object) update_user_email(user_id, email, verify = true)
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 |
- (Object) update_user_metadata(user_id, metadata = {})
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 |
- (Object) update_user_password(user_id, password, verify = true)
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 |
- (Object) update_user_password_using_email(email, password, connection_name, verify = true)
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 |
- (Object) user(user_id) 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 |
- (Object) user_devices(user_id)
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 |
- (Object) users(search = nil) 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 |
- (Object) verification_ticket(user_id, result_url = nil)
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 |