Module: Auth0::Api::V1::Users

Included in:
Auth0::Api::V1
Defined in:
lib/auth0/api/v1/users.rb

Overview

Instance Method Summary collapse

Instance Method Details

#change_password_ticket(user_id, new_password, result_url = nil) ⇒ Object

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

https://auth0.com/docs/api#!#post--api-users--user_id--change_password_ticket

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

105
106
107
108
109
110
# File 'lib/auth0/api/v1/users.rb', line 105

def change_password_ticket(user_id, new_password, result_url = nil)
  warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  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

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

https://auth0.com/docs/api#!#get--api-clients--client-id--users

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

76
77
78
79
80
# File 'lib/auth0/api/v1/users.rb', line 76

def client_users(client_id = @client_id)
  warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  path = "/api/clients/#{client_id}/users"
  get(path)
end

#connection_users(connection_name, search = nil) ⇒ Object Also known as: search_connection_users

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

https://auth0.com/docs/api#!#get--api-connections--connection--users -

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

46
47
48
49
50
51
# File 'lib/auth0/api/v1/users.rb', line 46

def connection_users(connection_name, search = nil)
  warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  path = "/api/connections/#{connection_name}/users"
  path += "?search=#{search}" unless search.to_s.empty?
  get(path)
end

#create_public_key(user_id, device, public_key) ⇒ Object

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

https://auth0.com/docs/api#!#post--api-users--user_id--publickey

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

125
126
127
128
129
130
# File 'lib/auth0/api/v1/users.rb', line 125

def create_public_key(user_id, device, public_key)
  warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  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

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

https://auth0.com/docs/api#!#post--api-users

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

85
86
87
88
89
90
91
# File 'lib/auth0/api/v1/users.rb', line 85

def create_user(email, password, connection_name, request_params = {})
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  options = { email: email, password: password, connection: connection_name }
  request_params.merge!(options)
  path = '/api/users'
  post(path, request_params)
end

#delete_user(user_id) ⇒ Object

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

-

Raises:

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

200
201
202
203
204
205
# File 'lib/auth0/api/v1/users.rb', line 200

def delete_user(user_id)
  warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  raise Auth0::MissingUserId, 'if you want to remove all users use delete_users method' if user_id.to_s.empty?
  path = "/api/users/#{user_id}"
  delete(path)
end

#delete_usersObject

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

https://auth0.com/docs/api#!#delete--api-users This will remove all your users

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

191
192
193
194
195
# File 'lib/auth0/api/v1/users.rb', line 191

def delete_users
  warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  path = '/api/users/'
  delete(path)
end

#enterpriseconnections_users(search_criteria = nil, per_page = 500) ⇒ Object

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

-

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

58
59
60
61
62
# File 'lib/auth0/api/v1/users.rb', line 58

def enterpriseconnections_users(search_criteria = nil, per_page = 500)
  warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  path = "/api/enterpriseconnections/users?search=#{search_criteria}&per_page=#{per_page.to_i}"
  get(path)
end

#patch_user_metadata(user_id, metadata = {}) ⇒ Object

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

https://auth0.com/docs/api#!#patch--api-users--user_id--metadata

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

180
181
182
183
184
# File 'lib/auth0/api/v1/users.rb', line 180

def (user_id,  = {})
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  path = "/api/users/#{user_id}/metadata"
  patch(path, )
end

#revoke_user_device_public_key(user_id, device) ⇒ Object

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

-

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

219
220
221
222
223
# File 'lib/auth0/api/v1/users.rb', line 219

def revoke_user_device_public_key(user_id, device)
  warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  path = "/api/users/#{user_id}/publickey?device=#{device}"
  delete(path)
end

#revoke_user_refresh_token(user_id, refresh_token) ⇒ Object

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

-

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

210
211
212
213
214
# File 'lib/auth0/api/v1/users.rb', line 210

def revoke_user_refresh_token(user_id, refresh_token)
  warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  path = "/api/users/#{user_id}/refresh_tokens/#{refresh_token}"
  delete(path)
end

#send_verification_email(user_id) ⇒ Object

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

https://auth0.com/docs/api#!#post--api-users--user_id--send_verification_email

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

96
97
98
99
100
# File 'lib/auth0/api/v1/users.rb', line 96

def send_verification_email(user_id)
  warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  path = "/api/users/#{user_id}/send_verification_email"
  post(path)
end

#socialconnections_users(search_criteria = nil, per_page = 500) ⇒ Object

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

-

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

67
68
69
70
71
# File 'lib/auth0/api/v1/users.rb', line 67

def socialconnections_users(search_criteria = nil, per_page = 500)
  warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  path = "/api/socialconnections/users?search=#{search_criteria}&per_page=#{per_page.to_i}"
  get(path)
end

#update_user_email(user_id, email, verify = true) ⇒ Object

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

https://auth0.com/docs/api#!#put--api-users--user_id--email

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

135
136
137
138
139
140
# File 'lib/auth0/api/v1/users.rb', line 135

def update_user_email(user_id, email, verify = true)
  warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  path = "/api/users/#{user_id}/email"
  request_params = { email: email, verify: verify }
  put(path, request_params)
end

#update_user_metadata(user_id, metadata = {}) ⇒ Object

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

https://auth0.com/docs/api#!#put--api-users--user_id--metadata This will overwrite user's metadata, be really carefull, preffer using patch instead

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

146
147
148
149
150
# File 'lib/auth0/api/v1/users.rb', line 146

def (user_id,  = {})
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  path = "/api/users/#{user_id}/metadata"
  put(path, )
end

#update_user_password(user_id, password, verify = true) ⇒ Object

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

https://auth0.com/docs/api#!#put--api-users--user_id--password

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

155
156
157
158
159
160
# File 'lib/auth0/api/v1/users.rb', line 155

def update_user_password(user_id, password, verify = true)
  warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  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

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

https://auth0.com/docs/api#!#put--api-users--email--password

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

165
166
167
168
169
170
171
172
173
174
175
# File 'lib/auth0/api/v1/users.rb', line 165

def update_user_password_using_email(email, password, connection_name, verify = true)
  warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  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

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

-

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

25
26
27
28
29
# File 'lib/auth0/api/v1/users.rb', line 25

def user(user_id)
  warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  path = "/api/users/#{user_id}"
  get(path)
end

#user_devices(user_id) ⇒ Object

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

https://auth0.com/docs/api#!#get--api-users--user_id--devices

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

36
37
38
39
40
# File 'lib/auth0/api/v1/users.rb', line 36

def user_devices(user_id)
  warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  path = "/api/users/#{user_id}/devices"
  get(path)
end

#users(search = nil) ⇒ Object Also known as: users_search, get_users

Deprecated.
  • 4.14.0, please use Auth0::Api::V2::Users

https://auth0.com/docs/api#!#get--api-users

-

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

12
13
14
15
16
17
# File 'lib/auth0/api/v1/users.rb', line 12

def users(search = nil)
  warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  path = '/api/users'
  path += "?search=#{search}" unless search.to_s.empty?
  get(path)
end

#verification_ticket(user_id, result_url = nil) ⇒ Object

Deprecated.
  • 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users

https://auth0.com/docs/api#!#post--api-users--user_id--verification_ticket

See Also:

  • https://auth0.com/docs/migrations/guides/management-api-v1-v2

115
116
117
118
119
120
# File 'lib/auth0/api/v1/users.rb', line 115

def verification_ticket(user_id, result_url = nil)
  warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
  request_params = { 'resultUrl' => result_url }
  path = "/api/users/#{user_id}/verification_ticket"
  post(path, request_params)
end