auth0 4.10.0 → 4.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.env.example +2 -0
- data/CHANGELOG.md +55 -0
- data/DEPLOYMENT.md +14 -0
- data/Gemfile.lock +58 -53
- data/README.md +105 -25
- data/auth0.gemspec +2 -0
- data/lib/auth0.rb +1 -0
- data/lib/auth0/algorithm.rb +5 -0
- data/lib/auth0/api/authentication_endpoints.rb +38 -2
- data/lib/auth0/api/v1/clients.rb +12 -2
- data/lib/auth0/api/v1/connections.rb +15 -0
- data/lib/auth0/api/v1/logs.rb +9 -0
- data/lib/auth0/api/v1/rules.rb +12 -0
- data/lib/auth0/api/v1/users.rb +63 -0
- data/lib/auth0/api/v2.rb +4 -0
- data/lib/auth0/api/v2/log_streams.rb +78 -0
- data/lib/auth0/api/v2/prompts.rb +70 -0
- data/lib/auth0/exception.rb +2 -0
- data/lib/auth0/mixins/httpproxy.rb +1 -1
- data/lib/auth0/mixins/validation.rb +307 -0
- data/lib/auth0/version.rb +1 -1
- data/spec/lib/auth0/api/authentication_endpoints_spec.rb +37 -10
- data/spec/lib/auth0/api/v2/log_streams_spec.rb +84 -0
- data/spec/lib/auth0/api/v2/prompts_spec.rb +88 -0
- data/spec/lib/auth0/mixins/validation_spec.rb +466 -0
- data/spec/spec_helper.rb +4 -0
- metadata +43 -5
data/auth0.gemspec
CHANGED
@@ -17,6 +17,8 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.require_paths = ['lib']
|
18
18
|
|
19
19
|
s.add_runtime_dependency 'rest-client', '~> 2.0.0'
|
20
|
+
s.add_runtime_dependency 'jwt', '~> 2.2.0'
|
21
|
+
s.add_runtime_dependency 'zache', '~> 0.12.0'
|
20
22
|
|
21
23
|
s.add_development_dependency 'rake', '~> 13.0'
|
22
24
|
s.add_development_dependency 'fuubar', '~> 2.0'
|
data/lib/auth0.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# rubocop:disable Metrics/ModuleLength
|
3
|
+
|
4
|
+
require 'jwt'
|
5
|
+
|
2
6
|
module Auth0
|
3
7
|
module Api
|
4
8
|
# {https://auth0.com/docs/api/authentication}
|
@@ -170,7 +174,8 @@ module Auth0
|
|
170
174
|
send: send,
|
171
175
|
authParams: auth_params,
|
172
176
|
connection: 'email',
|
173
|
-
client_id: @client_id
|
177
|
+
client_id: @client_id,
|
178
|
+
client_secret: @client_secret
|
174
179
|
}
|
175
180
|
post('/passwordless/start', request_params)
|
176
181
|
end
|
@@ -185,7 +190,8 @@ module Auth0
|
|
185
190
|
request_params = {
|
186
191
|
phone_number: phone_number,
|
187
192
|
connection: 'sms',
|
188
|
-
client_id: @client_id
|
193
|
+
client_id: @client_id,
|
194
|
+
client_secret: @client_secret
|
189
195
|
}
|
190
196
|
post('/passwordless/start', request_params)
|
191
197
|
end
|
@@ -500,6 +506,36 @@ module Auth0
|
|
500
506
|
post('/unlink', request_params)
|
501
507
|
end
|
502
508
|
|
509
|
+
# Validate an ID token (signature and expiration).
|
510
|
+
# @see https://auth0.com/docs/tokens/guides/validate-id-tokens
|
511
|
+
# @param id_token [string] The JWT to validate.
|
512
|
+
# @param algorithm [JWKAlgorithm] The expected signing algorithm.
|
513
|
+
# Defaults to +Auth0::Algorithm::RS256.jwks_url("https://YOUR_AUTH0_DOMAIN/.well-known/jwks.json", lifetime: 10 * 60)+.
|
514
|
+
# @param leeway [integer] The clock skew to accept when verifying date related claims in seconds.
|
515
|
+
# Must be a non-negative value. Defaults to *60 seconds*.
|
516
|
+
# @param nonce [string] The nonce value sent during authentication.
|
517
|
+
# @param max_age [integer] The max_age value sent during authentication.
|
518
|
+
# Must be a non-negative value.
|
519
|
+
# @param issuer [string] The expected issuer claim value.
|
520
|
+
# Defaults to +https://YOUR_AUTH0_DOMAIN/+.
|
521
|
+
# @param audience [string] The expected audience claim value.
|
522
|
+
# Defaults to your *Auth0 Client ID*.
|
523
|
+
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/ParameterLists
|
524
|
+
def validate_id_token(id_token, algorithm: nil, leeway: 60, nonce: nil, max_age: nil, issuer: nil, audience: nil)
|
525
|
+
context = {
|
526
|
+
issuer: issuer || "https://#{@domain}/",
|
527
|
+
audience: audience || @client_id,
|
528
|
+
algorithm: algorithm || Auth0::Algorithm::RS256.jwks_url("https://#{@domain}/.well-known/jwks.json"),
|
529
|
+
leeway: leeway
|
530
|
+
}
|
531
|
+
|
532
|
+
context[:nonce] = nonce unless nonce.nil?
|
533
|
+
context[:max_age] = max_age unless max_age.nil?
|
534
|
+
|
535
|
+
Auth0::Mixins::Validation::IdTokenValidator.new(context).validate(id_token)
|
536
|
+
end
|
537
|
+
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize, Metrics/ParameterLists
|
538
|
+
|
503
539
|
private
|
504
540
|
|
505
541
|
# Build a URL query string from a hash.
|
data/lib/auth0/api/v1/clients.rb
CHANGED
@@ -4,7 +4,10 @@ module Auth0
|
|
4
4
|
# {https://auth0.com/docs/api#applications}
|
5
5
|
module Clients
|
6
6
|
# {https://auth0.com/docs/api#!#get--api-clients}
|
7
|
+
# @deprecated - 4.14.0, please use Auth0::Api::V2::Clients
|
8
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
7
9
|
def clients
|
10
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
8
11
|
path = '/api/clients'
|
9
12
|
get(path)
|
10
13
|
end
|
@@ -12,7 +15,10 @@ module Auth0
|
|
12
15
|
alias get_clients clients
|
13
16
|
|
14
17
|
# {https://auth0.com/docs/api#!#post--api-clients}
|
18
|
+
# @deprecated - 4.14.0, please use Auth0::Api::V2::Clients
|
19
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
15
20
|
def create_client(name, callbacks = '')
|
21
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
16
22
|
path = '/api/clients'
|
17
23
|
request_params = {
|
18
24
|
name: name,
|
@@ -21,10 +27,11 @@ module Auth0
|
|
21
27
|
post(path, request_params)
|
22
28
|
end
|
23
29
|
|
24
|
-
# @deprecated use {#patch_client}
|
25
30
|
# {https://auth0.com/docs/api#!#put--api-clients--client-id-}
|
31
|
+
# @deprecated - 4.14.0, please use Auth0::Api::V2::Clients
|
32
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
26
33
|
def update_client(name, callbacks = '', client_id = @client_id)
|
27
|
-
warn
|
34
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
28
35
|
path = "/api/clients/#{client_id}"
|
29
36
|
request_params = {
|
30
37
|
name: name,
|
@@ -34,7 +41,10 @@ module Auth0
|
|
34
41
|
end
|
35
42
|
|
36
43
|
# {https://auth0.com/docs/api#!#patch--api-clients--client-id-}
|
44
|
+
# @deprecated - 4.14.0, please use Auth0::Api::V2::Clients
|
45
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
37
46
|
def patch_client(name, callbacks = '', client_id = @client_id)
|
47
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
38
48
|
path = "/api/clients/#{client_id}"
|
39
49
|
request_params = {
|
40
50
|
name: name,
|
@@ -4,26 +4,38 @@ module Auth0
|
|
4
4
|
# {https://auth0.com/docs/api#connections}
|
5
5
|
module Connections
|
6
6
|
# {https://auth0.com/docs/api#!#get--api-connections}
|
7
|
+
# @deprecated - 4.14.0, please use Auth0::Api::V2::Connections
|
8
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
7
9
|
def connections
|
10
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
8
11
|
get('/api/connections')
|
9
12
|
end
|
10
13
|
alias get_connections connections
|
11
14
|
|
12
15
|
# {https://auth0.com/docs/api#!#get--api-connections--connection-name-}
|
16
|
+
# @deprecated - 4.14.0, please use Auth0::Api::V2::Connections
|
17
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
13
18
|
def connection(connection_name)
|
19
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
14
20
|
path = "/api/connections/#{connection_name}"
|
15
21
|
get(path)
|
16
22
|
end
|
17
23
|
alias get_connection connection
|
18
24
|
|
19
25
|
# {https://auth0.com/docs/api#!#delete--api-connections--connection-name-}
|
26
|
+
# @deprecated - 4.14.0, please use Auth0::Api::V2::Connections
|
27
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
20
28
|
def delete_connection(connection_name)
|
29
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
21
30
|
path = "/api/connections/#{connection_name}"
|
22
31
|
delete(path)
|
23
32
|
end
|
24
33
|
|
25
34
|
# {https://auth0.com/docs/api#!#post--api-connections}
|
35
|
+
# @deprecated - 4.14.0, please use Auth0::Api::V2::Connections
|
36
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
26
37
|
def create_connection(connection_name, strategy, tenant_domain, domain_aliases = nil)
|
38
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
27
39
|
path = '/api/connections'
|
28
40
|
request_params = {
|
29
41
|
name: connection_name,
|
@@ -37,7 +49,10 @@ module Auth0
|
|
37
49
|
end
|
38
50
|
|
39
51
|
# {https://auth0.com/docs/api#!#put--api-connections--connection-name-}
|
52
|
+
# @deprecated - 4.14.0, please use Auth0::Api::V2::Connections
|
53
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
40
54
|
def update_connection(connection_name, tenant_domain, status = true)
|
55
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
41
56
|
path = "/api/connections/#{connection_name}"
|
42
57
|
request_params = {
|
43
58
|
status: status,
|
data/lib/auth0/api/v1/logs.rb
CHANGED
@@ -4,7 +4,10 @@ module Auth0
|
|
4
4
|
# {https://auth0.com/docs/api#logs}
|
5
5
|
module Logs
|
6
6
|
# https://auth0.com/docs/api/v1#!#logs
|
7
|
+
# @deprecated - 4.14.0, please use Auth0::Api::V2::Logs
|
8
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
7
9
|
def logs(options = {})
|
10
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
8
11
|
acceptable_params = %i(take from search_criteria page per_page sort fields exclude_fields)
|
9
12
|
options.reject! do |key, value|
|
10
13
|
next unless key.nil? || value.nil? || !acceptable_params.include?(key.to_sym)
|
@@ -18,13 +21,19 @@ module Auth0
|
|
18
21
|
alias search_logs logs
|
19
22
|
|
20
23
|
# {https://auth0.com/docs/api#!#get--api-logs--_id-}
|
24
|
+
# @deprecated - 4.14.0, please use Auth0::Api::V2::Logs
|
25
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
21
26
|
def log(id)
|
27
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
22
28
|
path = "/api/logs/#{id}"
|
23
29
|
get(path)
|
24
30
|
end
|
25
31
|
|
26
32
|
# {https://auth0.com/docs/api#!#get--api-users--user_id--logs-page--number--per_page--items-}
|
33
|
+
# @deprecated - 4.14.0, please use Auth0::Api::V2::Logs
|
34
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
27
35
|
def user_logs(user_id, page = 0, per_page = 50)
|
36
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
28
37
|
path = "/api/users/#{user_id}/logs?page=#{page}&per_page=#{per_page}"
|
29
38
|
get(path)
|
30
39
|
end
|
data/lib/auth0/api/v1/rules.rb
CHANGED
@@ -4,7 +4,10 @@ module Auth0
|
|
4
4
|
# https://auth0.com/docs/api#rules
|
5
5
|
module Rules
|
6
6
|
# https://auth0.com/docs/api#!#get--api-rules
|
7
|
+
# @deprecated - 4.14.0, please use Auth0::Api::V2::Rules
|
8
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
7
9
|
def rules
|
10
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
8
11
|
path = '/api/rules'
|
9
12
|
get(path)
|
10
13
|
end
|
@@ -12,7 +15,10 @@ module Auth0
|
|
12
15
|
alias get_rules rules
|
13
16
|
|
14
17
|
# https://auth0.com/docs/api#!#post--api-rules
|
18
|
+
# @deprecated - 4.14.0, please use Auth0::Api::V2::Rules
|
19
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
15
20
|
def create_rule(name, script, order = nil, status = true)
|
21
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
16
22
|
path = '/api/rules'
|
17
23
|
request_params = {
|
18
24
|
name: name,
|
@@ -24,7 +30,10 @@ module Auth0
|
|
24
30
|
end
|
25
31
|
|
26
32
|
# https://auth0.com/docs/api#!#put--api-rules--rule-name-
|
33
|
+
# @deprecated - 4.14.0, please use Auth0::Api::V2::Rules
|
34
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
27
35
|
def update_rule(name, script, order = nil, status = true)
|
36
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
28
37
|
path = "/api/rules/#{name}"
|
29
38
|
request_params = {
|
30
39
|
status: status,
|
@@ -35,7 +44,10 @@ module Auth0
|
|
35
44
|
end
|
36
45
|
|
37
46
|
# https://auth0.com/docs/api#!#delete--api-rules--rule-name-
|
47
|
+
# @deprecated - 4.14.0, please use Auth0::Api::V2::Rules
|
48
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
38
49
|
def delete_rule(name)
|
50
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
39
51
|
path = "/api/rules/#{name}"
|
40
52
|
delete(path)
|
41
53
|
end
|
data/lib/auth0/api/v1/users.rb
CHANGED
@@ -7,7 +7,10 @@ module Auth0
|
|
7
7
|
# {https://auth0.com/docs/api#!#get--api-users}
|
8
8
|
#
|
9
9
|
# {https://auth0.com/docs/api#!#get--api-users-search--criteria-}
|
10
|
+
# @deprecated - 4.14.0, please use Auth0::Api::V2::Users
|
11
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
10
12
|
def users(search = nil)
|
13
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
11
14
|
path = '/api/users'
|
12
15
|
path += "?search=#{search}" unless search.to_s.empty?
|
13
16
|
get(path)
|
@@ -17,7 +20,10 @@ module Auth0
|
|
17
20
|
alias get_users users
|
18
21
|
|
19
22
|
# {https://auth0.com/docs/api#!#get--api-users--user_id-}
|
23
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
24
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
20
25
|
def user(user_id)
|
26
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
21
27
|
path = "/api/users/#{user_id}"
|
22
28
|
get(path)
|
23
29
|
end
|
@@ -25,14 +31,20 @@ module Auth0
|
|
25
31
|
alias get_user user
|
26
32
|
|
27
33
|
# {https://auth0.com/docs/api#!#get--api-users--user_id--devices}
|
34
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
35
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
28
36
|
def user_devices(user_id)
|
37
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
29
38
|
path = "/api/users/#{user_id}/devices"
|
30
39
|
get(path)
|
31
40
|
end
|
32
41
|
|
33
42
|
# {https://auth0.com/docs/api#!#get--api-connections--connection--users}
|
34
43
|
# {https://auth0.com/docs/api#!#get--api-connections--connection--users-search--criteria-}
|
44
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
45
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
35
46
|
def connection_users(connection_name, search = nil)
|
47
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
36
48
|
path = "/api/connections/#{connection_name}/users"
|
37
49
|
path += "?search=#{search}" unless search.to_s.empty?
|
38
50
|
get(path)
|
@@ -41,25 +53,37 @@ module Auth0
|
|
41
53
|
alias search_connection_users connection_users
|
42
54
|
|
43
55
|
# {https://auth0.com/docs/api#!#get--api-enterpriseconnections-users-search--criteria-}
|
56
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
57
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
44
58
|
def enterpriseconnections_users(search_criteria = nil, per_page = 500)
|
59
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
45
60
|
path = "/api/enterpriseconnections/users?search=#{search_criteria}&per_page=#{per_page.to_i}"
|
46
61
|
get(path)
|
47
62
|
end
|
48
63
|
|
49
64
|
# {https://auth0.com/docs/api#!#get--api-socialconnections-users-search--criteria-}
|
65
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
66
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
50
67
|
def socialconnections_users(search_criteria = nil, per_page = 500)
|
68
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
51
69
|
path = "/api/socialconnections/users?search=#{search_criteria}&per_page=#{per_page.to_i}"
|
52
70
|
get(path)
|
53
71
|
end
|
54
72
|
|
55
73
|
# {https://auth0.com/docs/api#!#get--api-clients--client-id--users}
|
74
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
75
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
56
76
|
def client_users(client_id = @client_id)
|
77
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
57
78
|
path = "/api/clients/#{client_id}/users"
|
58
79
|
get(path)
|
59
80
|
end
|
60
81
|
|
61
82
|
# {https://auth0.com/docs/api#!#post--api-users}
|
83
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
84
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
62
85
|
def create_user(email, password, connection_name, request_params = {})
|
86
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
63
87
|
options = { email: email, password: password, connection: connection_name }
|
64
88
|
request_params.merge!(options)
|
65
89
|
path = '/api/users'
|
@@ -67,55 +91,79 @@ module Auth0
|
|
67
91
|
end
|
68
92
|
|
69
93
|
# {https://auth0.com/docs/api#!#post--api-users--user_id--send_verification_email}
|
94
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
95
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
70
96
|
def send_verification_email(user_id)
|
97
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
71
98
|
path = "/api/users/#{user_id}/send_verification_email"
|
72
99
|
post(path)
|
73
100
|
end
|
74
101
|
|
75
102
|
# {https://auth0.com/docs/api#!#post--api-users--user_id--change_password_ticket}
|
103
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
104
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
76
105
|
def change_password_ticket(user_id, new_password, result_url = nil)
|
106
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
77
107
|
request_params = { 'newPassword' => new_password, 'resultUrl' => result_url }
|
78
108
|
path = "/api/users/#{user_id}/change_password_ticket"
|
79
109
|
post(path, request_params)
|
80
110
|
end
|
81
111
|
|
82
112
|
# {https://auth0.com/docs/api#!#post--api-users--user_id--verification_ticket}
|
113
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
114
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
83
115
|
def verification_ticket(user_id, result_url = nil)
|
116
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
84
117
|
request_params = { 'resultUrl' => result_url }
|
85
118
|
path = "/api/users/#{user_id}/verification_ticket"
|
86
119
|
post(path, request_params)
|
87
120
|
end
|
88
121
|
|
89
122
|
# {https://auth0.com/docs/api#!#post--api-users--user_id--publickey}
|
123
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
124
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
90
125
|
def create_public_key(user_id, device, public_key)
|
126
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
91
127
|
path = "/api/users/#{user_id}/public_key"
|
92
128
|
request_params = { device: device, public_key: public_key }
|
93
129
|
post(path, request_params)
|
94
130
|
end
|
95
131
|
|
96
132
|
# {https://auth0.com/docs/api#!#put--api-users--user_id--email}
|
133
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
134
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
97
135
|
def update_user_email(user_id, email, verify = true)
|
136
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
98
137
|
path = "/api/users/#{user_id}/email"
|
99
138
|
request_params = { email: email, verify: verify }
|
100
139
|
put(path, request_params)
|
101
140
|
end
|
102
141
|
|
103
142
|
# {https://auth0.com/docs/api#!#put--api-users--user_id--metadata}
|
143
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
144
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
104
145
|
# This will overwrite user's metadata, be really carefull, preffer using patch instead
|
105
146
|
def update_user_metadata(user_id, metadata = {})
|
147
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
106
148
|
path = "/api/users/#{user_id}/metadata"
|
107
149
|
put(path, metadata)
|
108
150
|
end
|
109
151
|
|
110
152
|
# {https://auth0.com/docs/api#!#put--api-users--user_id--password}
|
153
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
154
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
111
155
|
def update_user_password(user_id, password, verify = true)
|
156
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
112
157
|
path = "/api/users/#{user_id}/password"
|
113
158
|
request_params = { password: password, verify: verify }
|
114
159
|
put(path, request_params)
|
115
160
|
end
|
116
161
|
|
117
162
|
# {https://auth0.com/docs/api#!#put--api-users--email--password}
|
163
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
164
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
118
165
|
def update_user_password_using_email(email, password, connection_name, verify = true)
|
166
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
119
167
|
request_params = {
|
120
168
|
email: email,
|
121
169
|
password: password,
|
@@ -127,34 +175,49 @@ module Auth0
|
|
127
175
|
end
|
128
176
|
|
129
177
|
# {https://auth0.com/docs/api#!#patch--api-users--user_id--metadata}
|
178
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
179
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
130
180
|
def patch_user_metadata(user_id, metadata = {})
|
181
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
131
182
|
path = "/api/users/#{user_id}/metadata"
|
132
183
|
patch(path, metadata)
|
133
184
|
end
|
134
185
|
|
135
186
|
# {https://auth0.com/docs/api#!#delete--api-users}
|
187
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
188
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
136
189
|
#
|
137
190
|
# This will remove all your users
|
138
191
|
def delete_users
|
192
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
139
193
|
path = '/api/users/'
|
140
194
|
delete(path)
|
141
195
|
end
|
142
196
|
|
143
197
|
# {https://auth0.com/docs/api#!#delete--api-users--user_id-}
|
198
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
199
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
144
200
|
def delete_user(user_id)
|
201
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
145
202
|
raise Auth0::MissingUserId, 'if you want to remove all users use delete_users method' if user_id.to_s.empty?
|
146
203
|
path = "/api/users/#{user_id}"
|
147
204
|
delete(path)
|
148
205
|
end
|
149
206
|
|
150
207
|
# {https://auth0.com/docs/api#!#delete--api-users--user_id--refresh_tokens--refresh_token-}
|
208
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
209
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
151
210
|
def revoke_user_refresh_token(user_id, refresh_token)
|
211
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
152
212
|
path = "/api/users/#{user_id}/refresh_tokens/#{refresh_token}"
|
153
213
|
delete(path)
|
154
214
|
end
|
155
215
|
|
156
216
|
# {https://auth0.com/docs/api#!#delete--api-users--user_id--publickey-device--device-}
|
217
|
+
# @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
|
218
|
+
# @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
|
157
219
|
def revoke_user_device_public_key(user_id, device)
|
220
|
+
warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
|
158
221
|
path = "/api/users/#{user_id}/publickey?device=#{device}"
|
159
222
|
delete(path)
|
160
223
|
end
|