login_radius 11.0.0 → 11.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +21 -21
- data/README.md +58 -58
- data/lib/login_radius/api/account/account_api.rb +581 -581
- data/lib/login_radius/api/account/role_api.rb +330 -330
- data/lib/login_radius/api/account/sott_api.rb +47 -47
- data/lib/login_radius/api/advanced/configuration_api.rb +57 -57
- data/lib/login_radius/api/advanced/consent_management_api.rb +161 -161
- data/lib/login_radius/api/advanced/custom_object_api.rb +316 -316
- data/lib/login_radius/api/advanced/custom_registration_data_api.rb +195 -195
- data/lib/login_radius/api/advanced/multi_factor_authentication_api.rb +942 -606
- data/lib/login_radius/api/advanced/re_authentication_api.rb +317 -243
- data/lib/login_radius/api/advanced/web_hook_api.rb +101 -101
- data/lib/login_radius/api/authentication/authentication_api.rb +1036 -989
- data/lib/login_radius/api/authentication/one_touch_login_api.rb +160 -160
- data/lib/login_radius/api/authentication/password_less_login_api.rb +202 -158
- data/lib/login_radius/api/authentication/phone_authentication_api.rb +329 -329
- data/lib/login_radius/api/authentication/pin_authentication_api.rb +316 -316
- data/lib/login_radius/api/authentication/risk_based_authentication_api.rb +286 -286
- data/lib/login_radius/api/authentication/smart_login_api.rb +146 -146
- data/lib/login_radius/api/social/native_social_api.rb +255 -255
- data/lib/login_radius/api/social/social_api.rb +784 -806
- data/lib/login_radius/error.rb +7 -7
- data/lib/login_radius/request_client.rb +311 -295
- data/lib/login_radius/response.rb +18 -12
- data/lib/login_radius/version.rb +2 -2
- data/lib/login_radius.rb +30 -30
- data/login_radius.gemspec +25 -28
- metadata +7 -7
@@ -1,606 +1,942 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Created by LoginRadius Development Team
|
4
|
-
# Copyright 2019 LoginRadius Inc. All rights reserved.
|
5
|
-
require_relative '../../request_client'
|
6
|
-
|
7
|
-
module LoginRadius
|
8
|
-
# MultiFactorAuthenticationApi module
|
9
|
-
class MultiFactorAuthenticationApi
|
10
|
-
include RequestClient
|
11
|
-
|
12
|
-
attr_accessor :site_name, :api_key, :api_secret
|
13
|
-
|
14
|
-
# Initializes a LoginRadius Account object with an apikey and secret
|
15
|
-
# Takes in a hash containing site_name(required), api_key(required), api_secret(required)
|
16
|
-
def initialize
|
17
|
-
@site_name = ENV['SITE_NAME']
|
18
|
-
@api_key = ENV['API_KEY']
|
19
|
-
@api_secret = ENV['API_SECRET']
|
20
|
-
raise LoginRadius::Error.new, "'site_name' is a required option for Account class initialization." \
|
21
|
-
unless @site_name != '' && @site_name != nil
|
22
|
-
raise LoginRadius::Error.new, "'api_key' is a required option for Account class initialization." \
|
23
|
-
unless @api_key != '' && @api_key != nil
|
24
|
-
raise LoginRadius::Error.new, "'api_secret is a required option for Account class initialization." \
|
25
|
-
unless @api_secret != '' && @api_secret != nil
|
26
|
-
end
|
27
|
-
|
28
|
-
# This API is used to configure the Multi-factor authentication after login by using the access token when MFA is set as optional on the LoginRadius site.
|
29
|
-
#
|
30
|
-
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
31
|
-
# @param sms_template2_f_a - SMS Template Name
|
32
|
-
#
|
33
|
-
# @return Response containing Definition of Complete Multi-Factor Authentication Settings data
|
34
|
-
# 5.7
|
35
|
-
def mfa_configure_by_access_token(access_token, sms_template2_f_a = '')
|
36
|
-
if isNullOrWhiteSpace(access_token)
|
37
|
-
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
38
|
-
end
|
39
|
-
|
40
|
-
query_parameters = {}
|
41
|
-
query_parameters['access_token'] = access_token
|
42
|
-
query_parameters['apiKey'] = @api_key
|
43
|
-
unless isNullOrWhiteSpace(sms_template2_f_a)
|
44
|
-
query_parameters['smsTemplate2FA'] = sms_template2_f_a
|
45
|
-
end
|
46
|
-
|
47
|
-
resource_path = 'identity/v2/auth/account/2fa'
|
48
|
-
get_request(resource_path, query_parameters,
|
49
|
-
end
|
50
|
-
|
51
|
-
# This API is used to trigger the Multi-factor authentication settings after login for secure actions
|
52
|
-
#
|
53
|
-
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
54
|
-
# @param multi_factor_auth_model_with_lockout - Model Class containing Definition of payload for MultiFactorAuthModel With Lockout API
|
55
|
-
# @param fields - The fields parameter filters the API response so that the response only includes a specific set of fields
|
56
|
-
#
|
57
|
-
# @return Response containing Definition for Complete profile data
|
58
|
-
# 5.9
|
59
|
-
def mfa_update_setting(access_token, multi_factor_auth_model_with_lockout, fields = '')
|
60
|
-
if isNullOrWhiteSpace(access_token)
|
61
|
-
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
62
|
-
end
|
63
|
-
if multi_factor_auth_model_with_lockout.blank?
|
64
|
-
raise LoginRadius::Error.new, getValidationMessage('multi_factor_auth_model_with_lockout')
|
65
|
-
end
|
66
|
-
|
67
|
-
query_parameters = {}
|
68
|
-
query_parameters['access_token'] = access_token
|
69
|
-
query_parameters['apiKey'] = @api_key
|
70
|
-
unless isNullOrWhiteSpace(fields)
|
71
|
-
query_parameters['fields'] = fields
|
72
|
-
end
|
73
|
-
|
74
|
-
resource_path = 'identity/v2/auth/account/2fa/verification/otp'
|
75
|
-
put_request(resource_path, query_parameters, multi_factor_auth_model_with_lockout)
|
76
|
-
end
|
77
|
-
|
78
|
-
# This API is used to Enable Multi-factor authentication by access token on user login
|
79
|
-
#
|
80
|
-
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
81
|
-
# @param multi_factor_auth_model_by_google_authenticator_code - Model Class containing Definition of payload for MultiFactorAuthModel By GoogleAuthenticator Code API
|
82
|
-
# @param fields - The fields parameter filters the API response so that the response only includes a specific set of fields
|
83
|
-
# @param sms_template - SMS Template name
|
84
|
-
#
|
85
|
-
# @return Response containing Definition for Complete profile data
|
86
|
-
# 5.10
|
87
|
-
def mfa_update_by_access_token(access_token, multi_factor_auth_model_by_google_authenticator_code, fields = '', sms_template = '')
|
88
|
-
if isNullOrWhiteSpace(access_token)
|
89
|
-
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
90
|
-
end
|
91
|
-
if multi_factor_auth_model_by_google_authenticator_code.blank?
|
92
|
-
raise LoginRadius::Error.new, getValidationMessage('multi_factor_auth_model_by_google_authenticator_code')
|
93
|
-
end
|
94
|
-
|
95
|
-
query_parameters = {}
|
96
|
-
query_parameters['access_token'] = access_token
|
97
|
-
query_parameters['apiKey'] = @api_key
|
98
|
-
unless isNullOrWhiteSpace(fields)
|
99
|
-
query_parameters['fields'] = fields
|
100
|
-
end
|
101
|
-
unless isNullOrWhiteSpace(sms_template)
|
102
|
-
query_parameters['smsTemplate'] = sms_template
|
103
|
-
end
|
104
|
-
|
105
|
-
resource_path = 'identity/v2/auth/account/2fa/verification/googleauthenticatorcode'
|
106
|
-
put_request(resource_path, query_parameters, multi_factor_auth_model_by_google_authenticator_code)
|
107
|
-
end
|
108
|
-
|
109
|
-
# This API is used to update the Multi-factor authentication phone number by sending the verification OTP to the provided phone number
|
110
|
-
#
|
111
|
-
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
112
|
-
# @param phone_no2_f_a - Phone Number For 2FA
|
113
|
-
# @param sms_template2_f_a - SMS Template Name
|
114
|
-
#
|
115
|
-
# @return Response containing Definition for Complete SMS data
|
116
|
-
# 5.11
|
117
|
-
def mfa_update_phone_number_by_token(access_token, phone_no2_f_a, sms_template2_f_a = '')
|
118
|
-
if isNullOrWhiteSpace(access_token)
|
119
|
-
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
120
|
-
end
|
121
|
-
if isNullOrWhiteSpace(phone_no2_f_a)
|
122
|
-
raise LoginRadius::Error.new, getValidationMessage('phone_no2_f_a')
|
123
|
-
end
|
124
|
-
|
125
|
-
query_parameters = {}
|
126
|
-
query_parameters['access_token'] = access_token
|
127
|
-
query_parameters['apiKey'] = @api_key
|
128
|
-
unless isNullOrWhiteSpace(sms_template2_f_a)
|
129
|
-
query_parameters['smsTemplate2FA'] = sms_template2_f_a
|
130
|
-
end
|
131
|
-
|
132
|
-
body_parameters = {}
|
133
|
-
body_parameters['phoneNo2FA'] = phone_no2_f_a
|
134
|
-
|
135
|
-
resource_path = 'identity/v2/auth/account/2fa'
|
136
|
-
put_request(resource_path, query_parameters, body_parameters)
|
137
|
-
end
|
138
|
-
|
139
|
-
# This API Resets the Google Authenticator configurations on a given account via the access token
|
140
|
-
#
|
141
|
-
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
142
|
-
# @param googleauthenticator - boolean type value,Enable google Authenticator Code.
|
143
|
-
#
|
144
|
-
# @return Response containing Definition of Delete Request
|
145
|
-
# 5.12.1
|
146
|
-
def mfa_reset_google_auth_by_token(access_token, googleauthenticator)
|
147
|
-
if isNullOrWhiteSpace(access_token)
|
148
|
-
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
149
|
-
end
|
150
|
-
|
151
|
-
query_parameters = {}
|
152
|
-
query_parameters['access_token'] = access_token
|
153
|
-
query_parameters['apiKey'] = @api_key
|
154
|
-
|
155
|
-
body_parameters = {}
|
156
|
-
body_parameters['googleauthenticator'] = googleauthenticator
|
157
|
-
|
158
|
-
resource_path = 'identity/v2/auth/account/2fa/authenticator'
|
159
|
-
delete_request(resource_path, query_parameters, body_parameters)
|
160
|
-
end
|
161
|
-
|
162
|
-
# This API resets the SMS Authenticator configurations on a given account via the access token.
|
163
|
-
#
|
164
|
-
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
165
|
-
# @param otpauthenticator - Pass 'otpauthenticator' to remove SMS Authenticator
|
166
|
-
#
|
167
|
-
# @return Response containing Definition of Delete Request
|
168
|
-
# 5.12.2
|
169
|
-
def mfa_reset_sms_auth_by_token(access_token, otpauthenticator)
|
170
|
-
if isNullOrWhiteSpace(access_token)
|
171
|
-
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
172
|
-
end
|
173
|
-
|
174
|
-
query_parameters = {}
|
175
|
-
query_parameters['access_token'] = access_token
|
176
|
-
query_parameters['apiKey'] = @api_key
|
177
|
-
|
178
|
-
body_parameters = {}
|
179
|
-
body_parameters['otpauthenticator'] = otpauthenticator
|
180
|
-
|
181
|
-
resource_path = 'identity/v2/auth/account/2fa/authenticator'
|
182
|
-
delete_request(resource_path, query_parameters, body_parameters)
|
183
|
-
end
|
184
|
-
|
185
|
-
# This API is used to get a set of backup codes via access token to allow the user login on a site that has Multi-factor Authentication enabled in the event that the user does not have a secondary factor available. We generate 10 codes, each code can only be consumed once. If any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically
|
186
|
-
#
|
187
|
-
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
188
|
-
#
|
189
|
-
# @return Response containing Definition of Complete Backup Code data
|
190
|
-
# 5.13
|
191
|
-
def mfa_backup_code_by_access_token(access_token)
|
192
|
-
if isNullOrWhiteSpace(access_token)
|
193
|
-
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
194
|
-
end
|
195
|
-
|
196
|
-
query_parameters = {}
|
197
|
-
query_parameters['access_token'] = access_token
|
198
|
-
query_parameters['apiKey'] = @api_key
|
199
|
-
|
200
|
-
resource_path = 'identity/v2/auth/account/2fa/backupcode'
|
201
|
-
get_request(resource_path, query_parameters,
|
202
|
-
end
|
203
|
-
|
204
|
-
# API is used to reset the backup codes on a given account via the access token. This API call will generate 10 new codes, each code can only be consumed once
|
205
|
-
#
|
206
|
-
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
207
|
-
#
|
208
|
-
# @return Response containing Definition of Complete Backup Code data
|
209
|
-
# 5.14
|
210
|
-
def mfa_reset_backup_code_by_access_token(access_token)
|
211
|
-
if isNullOrWhiteSpace(access_token)
|
212
|
-
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
213
|
-
end
|
214
|
-
|
215
|
-
query_parameters = {}
|
216
|
-
query_parameters['access_token'] = access_token
|
217
|
-
query_parameters['apiKey'] = @api_key
|
218
|
-
|
219
|
-
resource_path = 'identity/v2/auth/account/2fa/backupcode/reset'
|
220
|
-
get_request(resource_path, query_parameters,
|
221
|
-
end
|
222
|
-
|
223
|
-
# This API
|
224
|
-
#
|
225
|
-
# @param
|
226
|
-
# @param
|
227
|
-
# @param
|
228
|
-
#
|
229
|
-
# @
|
230
|
-
#
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
#
|
275
|
-
#
|
276
|
-
# @param
|
277
|
-
#
|
278
|
-
# @
|
279
|
-
#
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
#
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
#
|
444
|
-
#
|
445
|
-
#
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
body_parameters
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
#
|
498
|
-
#
|
499
|
-
#
|
500
|
-
# @
|
501
|
-
#
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
#
|
545
|
-
#
|
546
|
-
#
|
547
|
-
# @
|
548
|
-
#
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
end
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
#
|
591
|
-
#
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Created by LoginRadius Development Team
|
4
|
+
# Copyright 2019 LoginRadius Inc. All rights reserved.
|
5
|
+
require_relative '../../request_client'
|
6
|
+
|
7
|
+
module LoginRadius
|
8
|
+
# MultiFactorAuthenticationApi module
|
9
|
+
class MultiFactorAuthenticationApi
|
10
|
+
include RequestClient
|
11
|
+
|
12
|
+
attr_accessor :site_name, :api_key, :api_secret
|
13
|
+
|
14
|
+
# Initializes a LoginRadius Account object with an apikey and secret
|
15
|
+
# Takes in a hash containing site_name(required), api_key(required), api_secret(required)
|
16
|
+
def initialize
|
17
|
+
@site_name = ENV['SITE_NAME']
|
18
|
+
@api_key = ENV['API_KEY']
|
19
|
+
@api_secret = ENV['API_SECRET']
|
20
|
+
raise LoginRadius::Error.new, "'site_name' is a required option for Account class initialization." \
|
21
|
+
unless @site_name != '' && @site_name != nil
|
22
|
+
raise LoginRadius::Error.new, "'api_key' is a required option for Account class initialization." \
|
23
|
+
unless @api_key != '' && @api_key != nil
|
24
|
+
raise LoginRadius::Error.new, "'api_secret is a required option for Account class initialization." \
|
25
|
+
unless @api_secret != '' && @api_secret != nil
|
26
|
+
end
|
27
|
+
|
28
|
+
# This API is used to configure the Multi-factor authentication after login by using the access token when MFA is set as optional on the LoginRadius site.
|
29
|
+
#
|
30
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
31
|
+
# @param sms_template2_f_a - SMS Template Name
|
32
|
+
#
|
33
|
+
# @return Response containing Definition of Complete Multi-Factor Authentication Settings data
|
34
|
+
# 5.7
|
35
|
+
def mfa_configure_by_access_token(access_token, sms_template2_f_a = '')
|
36
|
+
if isNullOrWhiteSpace(access_token)
|
37
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
38
|
+
end
|
39
|
+
|
40
|
+
query_parameters = {}
|
41
|
+
query_parameters['access_token'] = access_token
|
42
|
+
query_parameters['apiKey'] = @api_key
|
43
|
+
unless isNullOrWhiteSpace(sms_template2_f_a)
|
44
|
+
query_parameters['smsTemplate2FA'] = sms_template2_f_a
|
45
|
+
end
|
46
|
+
|
47
|
+
resource_path = 'identity/v2/auth/account/2fa'
|
48
|
+
get_request(resource_path, query_parameters, {})
|
49
|
+
end
|
50
|
+
|
51
|
+
# This API is used to trigger the Multi-factor authentication settings after login for secure actions
|
52
|
+
#
|
53
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
54
|
+
# @param multi_factor_auth_model_with_lockout - Model Class containing Definition of payload for MultiFactorAuthModel With Lockout API
|
55
|
+
# @param fields - The fields parameter filters the API response so that the response only includes a specific set of fields
|
56
|
+
#
|
57
|
+
# @return Response containing Definition for Complete profile data
|
58
|
+
# 5.9
|
59
|
+
def mfa_update_setting(access_token, multi_factor_auth_model_with_lockout, fields = '')
|
60
|
+
if isNullOrWhiteSpace(access_token)
|
61
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
62
|
+
end
|
63
|
+
if multi_factor_auth_model_with_lockout.blank?
|
64
|
+
raise LoginRadius::Error.new, getValidationMessage('multi_factor_auth_model_with_lockout')
|
65
|
+
end
|
66
|
+
|
67
|
+
query_parameters = {}
|
68
|
+
query_parameters['access_token'] = access_token
|
69
|
+
query_parameters['apiKey'] = @api_key
|
70
|
+
unless isNullOrWhiteSpace(fields)
|
71
|
+
query_parameters['fields'] = fields
|
72
|
+
end
|
73
|
+
|
74
|
+
resource_path = 'identity/v2/auth/account/2fa/verification/otp'
|
75
|
+
put_request(resource_path, query_parameters, multi_factor_auth_model_with_lockout)
|
76
|
+
end
|
77
|
+
|
78
|
+
# This API is used to Enable Multi-factor authentication by access token on user login
|
79
|
+
#
|
80
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
81
|
+
# @param multi_factor_auth_model_by_google_authenticator_code - Model Class containing Definition of payload for MultiFactorAuthModel By GoogleAuthenticator Code API
|
82
|
+
# @param fields - The fields parameter filters the API response so that the response only includes a specific set of fields
|
83
|
+
# @param sms_template - SMS Template name
|
84
|
+
#
|
85
|
+
# @return Response containing Definition for Complete profile data
|
86
|
+
# 5.10
|
87
|
+
def mfa_update_by_access_token(access_token, multi_factor_auth_model_by_google_authenticator_code, fields = '', sms_template = '')
|
88
|
+
if isNullOrWhiteSpace(access_token)
|
89
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
90
|
+
end
|
91
|
+
if multi_factor_auth_model_by_google_authenticator_code.blank?
|
92
|
+
raise LoginRadius::Error.new, getValidationMessage('multi_factor_auth_model_by_google_authenticator_code')
|
93
|
+
end
|
94
|
+
|
95
|
+
query_parameters = {}
|
96
|
+
query_parameters['access_token'] = access_token
|
97
|
+
query_parameters['apiKey'] = @api_key
|
98
|
+
unless isNullOrWhiteSpace(fields)
|
99
|
+
query_parameters['fields'] = fields
|
100
|
+
end
|
101
|
+
unless isNullOrWhiteSpace(sms_template)
|
102
|
+
query_parameters['smsTemplate'] = sms_template
|
103
|
+
end
|
104
|
+
|
105
|
+
resource_path = 'identity/v2/auth/account/2fa/verification/googleauthenticatorcode'
|
106
|
+
put_request(resource_path, query_parameters, multi_factor_auth_model_by_google_authenticator_code)
|
107
|
+
end
|
108
|
+
|
109
|
+
# This API is used to update the Multi-factor authentication phone number by sending the verification OTP to the provided phone number
|
110
|
+
#
|
111
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
112
|
+
# @param phone_no2_f_a - Phone Number For 2FA
|
113
|
+
# @param sms_template2_f_a - SMS Template Name
|
114
|
+
#
|
115
|
+
# @return Response containing Definition for Complete SMS data
|
116
|
+
# 5.11
|
117
|
+
def mfa_update_phone_number_by_token(access_token, phone_no2_f_a, sms_template2_f_a = '')
|
118
|
+
if isNullOrWhiteSpace(access_token)
|
119
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
120
|
+
end
|
121
|
+
if isNullOrWhiteSpace(phone_no2_f_a)
|
122
|
+
raise LoginRadius::Error.new, getValidationMessage('phone_no2_f_a')
|
123
|
+
end
|
124
|
+
|
125
|
+
query_parameters = {}
|
126
|
+
query_parameters['access_token'] = access_token
|
127
|
+
query_parameters['apiKey'] = @api_key
|
128
|
+
unless isNullOrWhiteSpace(sms_template2_f_a)
|
129
|
+
query_parameters['smsTemplate2FA'] = sms_template2_f_a
|
130
|
+
end
|
131
|
+
|
132
|
+
body_parameters = {}
|
133
|
+
body_parameters['phoneNo2FA'] = phone_no2_f_a
|
134
|
+
|
135
|
+
resource_path = 'identity/v2/auth/account/2fa'
|
136
|
+
put_request(resource_path, query_parameters, body_parameters)
|
137
|
+
end
|
138
|
+
|
139
|
+
# This API Resets the Google Authenticator configurations on a given account via the access token
|
140
|
+
#
|
141
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
142
|
+
# @param googleauthenticator - boolean type value,Enable google Authenticator Code.
|
143
|
+
#
|
144
|
+
# @return Response containing Definition of Delete Request
|
145
|
+
# 5.12.1
|
146
|
+
def mfa_reset_google_auth_by_token(access_token, googleauthenticator)
|
147
|
+
if isNullOrWhiteSpace(access_token)
|
148
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
149
|
+
end
|
150
|
+
|
151
|
+
query_parameters = {}
|
152
|
+
query_parameters['access_token'] = access_token
|
153
|
+
query_parameters['apiKey'] = @api_key
|
154
|
+
|
155
|
+
body_parameters = {}
|
156
|
+
body_parameters['googleauthenticator'] = googleauthenticator
|
157
|
+
|
158
|
+
resource_path = 'identity/v2/auth/account/2fa/authenticator'
|
159
|
+
delete_request(resource_path, query_parameters, body_parameters)
|
160
|
+
end
|
161
|
+
|
162
|
+
# This API resets the SMS Authenticator configurations on a given account via the access token.
|
163
|
+
#
|
164
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
165
|
+
# @param otpauthenticator - Pass 'otpauthenticator' to remove SMS Authenticator
|
166
|
+
#
|
167
|
+
# @return Response containing Definition of Delete Request
|
168
|
+
# 5.12.2
|
169
|
+
def mfa_reset_sms_auth_by_token(access_token, otpauthenticator)
|
170
|
+
if isNullOrWhiteSpace(access_token)
|
171
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
172
|
+
end
|
173
|
+
|
174
|
+
query_parameters = {}
|
175
|
+
query_parameters['access_token'] = access_token
|
176
|
+
query_parameters['apiKey'] = @api_key
|
177
|
+
|
178
|
+
body_parameters = {}
|
179
|
+
body_parameters['otpauthenticator'] = otpauthenticator
|
180
|
+
|
181
|
+
resource_path = 'identity/v2/auth/account/2fa/authenticator'
|
182
|
+
delete_request(resource_path, query_parameters, body_parameters)
|
183
|
+
end
|
184
|
+
|
185
|
+
# This API is used to get a set of backup codes via access token to allow the user login on a site that has Multi-factor Authentication enabled in the event that the user does not have a secondary factor available. We generate 10 codes, each code can only be consumed once. If any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically
|
186
|
+
#
|
187
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
188
|
+
#
|
189
|
+
# @return Response containing Definition of Complete Backup Code data
|
190
|
+
# 5.13
|
191
|
+
def mfa_backup_code_by_access_token(access_token)
|
192
|
+
if isNullOrWhiteSpace(access_token)
|
193
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
194
|
+
end
|
195
|
+
|
196
|
+
query_parameters = {}
|
197
|
+
query_parameters['access_token'] = access_token
|
198
|
+
query_parameters['apiKey'] = @api_key
|
199
|
+
|
200
|
+
resource_path = 'identity/v2/auth/account/2fa/backupcode'
|
201
|
+
get_request(resource_path, query_parameters, {})
|
202
|
+
end
|
203
|
+
|
204
|
+
# API is used to reset the backup codes on a given account via the access token. This API call will generate 10 new codes, each code can only be consumed once
|
205
|
+
#
|
206
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
207
|
+
#
|
208
|
+
# @return Response containing Definition of Complete Backup Code data
|
209
|
+
# 5.14
|
210
|
+
def mfa_reset_backup_code_by_access_token(access_token)
|
211
|
+
if isNullOrWhiteSpace(access_token)
|
212
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
213
|
+
end
|
214
|
+
|
215
|
+
query_parameters = {}
|
216
|
+
query_parameters['access_token'] = access_token
|
217
|
+
query_parameters['apiKey'] = @api_key
|
218
|
+
|
219
|
+
resource_path = 'identity/v2/auth/account/2fa/backupcode/reset'
|
220
|
+
get_request(resource_path, query_parameters, {})
|
221
|
+
end
|
222
|
+
|
223
|
+
# This API is created to send the OTP to the email if email OTP authenticator is enabled in app's MFA configuration.
|
224
|
+
#
|
225
|
+
# @param access_token - access_token
|
226
|
+
# @param email_id - EmailId
|
227
|
+
# @param email_template2_f_a - EmailTemplate2FA
|
228
|
+
#
|
229
|
+
# @return Response containing Definition of Complete Validation data
|
230
|
+
# 5.17
|
231
|
+
def mfa_email_otp_by_access_token(access_token, email_id, email_template2_f_a = '')
|
232
|
+
if isNullOrWhiteSpace(access_token)
|
233
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
234
|
+
end
|
235
|
+
if isNullOrWhiteSpace(email_id)
|
236
|
+
raise LoginRadius::Error.new, getValidationMessage('email_id')
|
237
|
+
end
|
238
|
+
|
239
|
+
query_parameters = {}
|
240
|
+
query_parameters['access_token'] = access_token
|
241
|
+
query_parameters['apiKey'] = @api_key
|
242
|
+
query_parameters['emailId'] = email_id
|
243
|
+
unless isNullOrWhiteSpace(email_template2_f_a)
|
244
|
+
query_parameters['emailTemplate2FA'] = email_template2_f_a
|
245
|
+
end
|
246
|
+
|
247
|
+
resource_path = 'identity/v2/auth/account/2fa/otp/email'
|
248
|
+
get_request(resource_path, query_parameters, {})
|
249
|
+
end
|
250
|
+
|
251
|
+
# This API is used to set up MFA Email OTP authenticator on profile after login.
|
252
|
+
#
|
253
|
+
# @param access_token - access_token
|
254
|
+
# @param multi_factor_auth_model_by_email_otp_with_lockout - payload
|
255
|
+
#
|
256
|
+
# @return Response containing Definition for Complete profile data
|
257
|
+
# 5.18
|
258
|
+
def mfa_validate_email_otp_by_access_token(access_token, multi_factor_auth_model_by_email_otp_with_lockout)
|
259
|
+
if isNullOrWhiteSpace(access_token)
|
260
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
261
|
+
end
|
262
|
+
if multi_factor_auth_model_by_email_otp_with_lockout.blank?
|
263
|
+
raise LoginRadius::Error.new, getValidationMessage('multi_factor_auth_model_by_email_otp_with_lockout')
|
264
|
+
end
|
265
|
+
|
266
|
+
query_parameters = {}
|
267
|
+
query_parameters['access_token'] = access_token
|
268
|
+
query_parameters['apiKey'] = @api_key
|
269
|
+
|
270
|
+
resource_path = 'identity/v2/auth/account/2fa/verification/otp/email'
|
271
|
+
put_request(resource_path, query_parameters, multi_factor_auth_model_by_email_otp_with_lockout)
|
272
|
+
end
|
273
|
+
|
274
|
+
# This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user
|
275
|
+
#
|
276
|
+
# @param access_token - access_token
|
277
|
+
#
|
278
|
+
# @return Response containing Definition of Delete Request
|
279
|
+
# 5.19
|
280
|
+
def mfa_reset_email_otp_authenticator_by_access_token(access_token)
|
281
|
+
if isNullOrWhiteSpace(access_token)
|
282
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
283
|
+
end
|
284
|
+
|
285
|
+
query_parameters = {}
|
286
|
+
query_parameters['access_token'] = access_token
|
287
|
+
query_parameters['apiKey'] = @api_key
|
288
|
+
|
289
|
+
resource_path = 'identity/v2/auth/account/2fa/authenticator/otp/email'
|
290
|
+
delete_request(resource_path, query_parameters, {})
|
291
|
+
end
|
292
|
+
|
293
|
+
# This API is used to set up MFA Security Question authenticator on profile after login.
|
294
|
+
#
|
295
|
+
# @param access_token - access_token
|
296
|
+
# @param security_question_answer_model_by_access_token - payload
|
297
|
+
#
|
298
|
+
# @return Response containing Definition of Complete Validation data
|
299
|
+
# 5.20
|
300
|
+
def mfa_security_question_answer_by_access_token(access_token, security_question_answer_model_by_access_token)
|
301
|
+
if isNullOrWhiteSpace(access_token)
|
302
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
303
|
+
end
|
304
|
+
if security_question_answer_model_by_access_token.blank?
|
305
|
+
raise LoginRadius::Error.new, getValidationMessage('security_question_answer_model_by_access_token')
|
306
|
+
end
|
307
|
+
|
308
|
+
query_parameters = {}
|
309
|
+
query_parameters['access_token'] = access_token
|
310
|
+
query_parameters['apiKey'] = @api_key
|
311
|
+
|
312
|
+
resource_path = 'identity/v2/auth/account/2fa/securityquestionanswer'
|
313
|
+
put_request(resource_path, query_parameters, security_question_answer_model_by_access_token)
|
314
|
+
end
|
315
|
+
|
316
|
+
# This API is used to Reset MFA Security Question Authenticator By Access Token
|
317
|
+
#
|
318
|
+
# @param access_token - access_token
|
319
|
+
#
|
320
|
+
# @return Response containing Definition of Delete Request
|
321
|
+
# 5.21
|
322
|
+
def mfa_reset_security_question_authenticator_by_access_token(access_token)
|
323
|
+
if isNullOrWhiteSpace(access_token)
|
324
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
325
|
+
end
|
326
|
+
|
327
|
+
query_parameters = {}
|
328
|
+
query_parameters['access_token'] = access_token
|
329
|
+
query_parameters['apiKey'] = @api_key
|
330
|
+
|
331
|
+
resource_path = 'identity/v2/auth/account/2fa/authenticator/securityquestionanswer'
|
332
|
+
delete_request(resource_path, query_parameters, {})
|
333
|
+
end
|
334
|
+
|
335
|
+
# This API can be used to login by emailid on a Multi-factor authentication enabled LoginRadius site.
|
336
|
+
#
|
337
|
+
# @param email - user's email
|
338
|
+
# @param password - Password for the email
|
339
|
+
# @param email_template - Email template name
|
340
|
+
# @param fields - The fields parameter filters the API response so that the response only includes a specific set of fields
|
341
|
+
# @param login_url - Url where the user is logging from
|
342
|
+
# @param sms_template - SMS Template name
|
343
|
+
# @param sms_template2_f_a - SMS Template Name
|
344
|
+
# @param verification_url - Email verification url
|
345
|
+
# @param email_template2_f_a - 2FA Email Template name
|
346
|
+
#
|
347
|
+
# @return Complete user UserProfile data
|
348
|
+
# 9.8.1
|
349
|
+
def mfa_login_by_email(email, password, email_template = '', fields = '', login_url = '', sms_template = '', sms_template2_f_a = '', verification_url = '', email_template2_f_a = '')
|
350
|
+
if isNullOrWhiteSpace(email)
|
351
|
+
raise LoginRadius::Error.new, getValidationMessage('email')
|
352
|
+
end
|
353
|
+
if isNullOrWhiteSpace(password)
|
354
|
+
raise LoginRadius::Error.new, getValidationMessage('password')
|
355
|
+
end
|
356
|
+
|
357
|
+
query_parameters = {}
|
358
|
+
query_parameters['apiKey'] = @api_key
|
359
|
+
unless isNullOrWhiteSpace(email_template)
|
360
|
+
query_parameters['emailTemplate'] = email_template
|
361
|
+
end
|
362
|
+
unless isNullOrWhiteSpace(fields)
|
363
|
+
query_parameters['fields'] = fields
|
364
|
+
end
|
365
|
+
unless isNullOrWhiteSpace(login_url)
|
366
|
+
query_parameters['loginUrl'] = login_url
|
367
|
+
end
|
368
|
+
unless isNullOrWhiteSpace(sms_template)
|
369
|
+
query_parameters['smsTemplate'] = sms_template
|
370
|
+
end
|
371
|
+
unless isNullOrWhiteSpace(sms_template2_f_a)
|
372
|
+
query_parameters['smsTemplate2FA'] = sms_template2_f_a
|
373
|
+
end
|
374
|
+
unless isNullOrWhiteSpace(verification_url)
|
375
|
+
query_parameters['verificationUrl'] = verification_url
|
376
|
+
end
|
377
|
+
unless isNullOrWhiteSpace(email_template2_f_a)
|
378
|
+
query_parameters['emailTemplate2FA'] = email_template2_f_a
|
379
|
+
end
|
380
|
+
|
381
|
+
body_parameters = {}
|
382
|
+
body_parameters['email'] = email
|
383
|
+
body_parameters['password'] = password
|
384
|
+
|
385
|
+
resource_path = 'identity/v2/auth/login/2fa'
|
386
|
+
post_request(resource_path, query_parameters, body_parameters)
|
387
|
+
end
|
388
|
+
|
389
|
+
# This API can be used to login by username on a Multi-factor authentication enabled LoginRadius site.
|
390
|
+
#
|
391
|
+
# @param password - Password for the email
|
392
|
+
# @param username - Username of the user
|
393
|
+
# @param email_template - Email template name
|
394
|
+
# @param fields - The fields parameter filters the API response so that the response only includes a specific set of fields
|
395
|
+
# @param login_url - Url where the user is logging from
|
396
|
+
# @param sms_template - SMS Template name
|
397
|
+
# @param sms_template2_f_a - SMS Template Name
|
398
|
+
# @param verification_url - Email verification url
|
399
|
+
# @param email_template2_f_a - 2FA Email Template name
|
400
|
+
#
|
401
|
+
# @return Complete user UserProfile data
|
402
|
+
# 9.8.2
|
403
|
+
def mfa_login_by_user_name(password, username, email_template = '', fields = '', login_url = '', sms_template = '', sms_template2_f_a = '', verification_url = '', email_template2_f_a = '')
|
404
|
+
if isNullOrWhiteSpace(password)
|
405
|
+
raise LoginRadius::Error.new, getValidationMessage('password')
|
406
|
+
end
|
407
|
+
if isNullOrWhiteSpace(username)
|
408
|
+
raise LoginRadius::Error.new, getValidationMessage('username')
|
409
|
+
end
|
410
|
+
|
411
|
+
query_parameters = {}
|
412
|
+
query_parameters['apiKey'] = @api_key
|
413
|
+
unless isNullOrWhiteSpace(email_template)
|
414
|
+
query_parameters['emailTemplate'] = email_template
|
415
|
+
end
|
416
|
+
unless isNullOrWhiteSpace(fields)
|
417
|
+
query_parameters['fields'] = fields
|
418
|
+
end
|
419
|
+
unless isNullOrWhiteSpace(login_url)
|
420
|
+
query_parameters['loginUrl'] = login_url
|
421
|
+
end
|
422
|
+
unless isNullOrWhiteSpace(sms_template)
|
423
|
+
query_parameters['smsTemplate'] = sms_template
|
424
|
+
end
|
425
|
+
unless isNullOrWhiteSpace(sms_template2_f_a)
|
426
|
+
query_parameters['smsTemplate2FA'] = sms_template2_f_a
|
427
|
+
end
|
428
|
+
unless isNullOrWhiteSpace(verification_url)
|
429
|
+
query_parameters['verificationUrl'] = verification_url
|
430
|
+
end
|
431
|
+
unless isNullOrWhiteSpace(email_template2_f_a)
|
432
|
+
query_parameters['emailTemplate2FA'] = email_template2_f_a
|
433
|
+
end
|
434
|
+
|
435
|
+
body_parameters = {}
|
436
|
+
body_parameters['password'] = password
|
437
|
+
body_parameters['username'] = username
|
438
|
+
|
439
|
+
resource_path = 'identity/v2/auth/login/2fa'
|
440
|
+
post_request(resource_path, query_parameters, body_parameters)
|
441
|
+
end
|
442
|
+
|
443
|
+
# This API can be used to login by Phone on a Multi-factor authentication enabled LoginRadius site.
|
444
|
+
#
|
445
|
+
# @param password - Password for the email
|
446
|
+
# @param phone - New Phone Number
|
447
|
+
# @param email_template - Email template name
|
448
|
+
# @param fields - The fields parameter filters the API response so that the response only includes a specific set of fields
|
449
|
+
# @param login_url - Url where the user is logging from
|
450
|
+
# @param sms_template - SMS Template name
|
451
|
+
# @param sms_template2_f_a - SMS Template Name
|
452
|
+
# @param verification_url - Email verification url
|
453
|
+
# @param email_template2_f_a - 2FA Email Template name
|
454
|
+
#
|
455
|
+
# @return Complete user UserProfile data
|
456
|
+
# 9.8.3
|
457
|
+
def mfa_login_by_phone(password, phone, email_template = '', fields = '', login_url = '', sms_template = '', sms_template2_f_a = '', verification_url = '', email_template2_f_a = '')
|
458
|
+
if isNullOrWhiteSpace(password)
|
459
|
+
raise LoginRadius::Error.new, getValidationMessage('password')
|
460
|
+
end
|
461
|
+
if isNullOrWhiteSpace(phone)
|
462
|
+
raise LoginRadius::Error.new, getValidationMessage('phone')
|
463
|
+
end
|
464
|
+
|
465
|
+
query_parameters = {}
|
466
|
+
query_parameters['apiKey'] = @api_key
|
467
|
+
unless isNullOrWhiteSpace(email_template)
|
468
|
+
query_parameters['emailTemplate'] = email_template
|
469
|
+
end
|
470
|
+
unless isNullOrWhiteSpace(fields)
|
471
|
+
query_parameters['fields'] = fields
|
472
|
+
end
|
473
|
+
unless isNullOrWhiteSpace(login_url)
|
474
|
+
query_parameters['loginUrl'] = login_url
|
475
|
+
end
|
476
|
+
unless isNullOrWhiteSpace(sms_template)
|
477
|
+
query_parameters['smsTemplate'] = sms_template
|
478
|
+
end
|
479
|
+
unless isNullOrWhiteSpace(sms_template2_f_a)
|
480
|
+
query_parameters['smsTemplate2FA'] = sms_template2_f_a
|
481
|
+
end
|
482
|
+
unless isNullOrWhiteSpace(verification_url)
|
483
|
+
query_parameters['verificationUrl'] = verification_url
|
484
|
+
end
|
485
|
+
unless isNullOrWhiteSpace(email_template2_f_a)
|
486
|
+
query_parameters['emailTemplate2FA'] = email_template2_f_a
|
487
|
+
end
|
488
|
+
|
489
|
+
body_parameters = {}
|
490
|
+
body_parameters['password'] = password
|
491
|
+
body_parameters['phone'] = phone
|
492
|
+
|
493
|
+
resource_path = 'identity/v2/auth/login/2fa'
|
494
|
+
post_request(resource_path, query_parameters, body_parameters)
|
495
|
+
end
|
496
|
+
|
497
|
+
# This API is used to login via Multi-factor authentication by passing the One Time Password received via SMS
|
498
|
+
#
|
499
|
+
# @param multi_factor_auth_model_with_lockout - Model Class containing Definition of payload for MultiFactorAuthModel With Lockout API
|
500
|
+
# @param second_factor_authentication_token - A Uniquely generated MFA identifier token after successful authentication
|
501
|
+
# @param fields - The fields parameter filters the API response so that the response only includes a specific set of fields
|
502
|
+
# @param sms_template2_f_a - SMS Template Name
|
503
|
+
# @param rba_browser_email_template -
|
504
|
+
# @param rba_city_email_template -
|
505
|
+
# @param rba_country_email_template -
|
506
|
+
# @param rba_ip_email_template -
|
507
|
+
#
|
508
|
+
# @return Complete user UserProfile data
|
509
|
+
# 9.12
|
510
|
+
def mfa_validate_otp_by_phone(multi_factor_auth_model_with_lockout, second_factor_authentication_token, fields = '', sms_template2_f_a = '' ,rba_browser_email_template = '', rba_city_email_template = '', rba_country_email_template = '', rba_ip_email_template = '')
|
511
|
+
if multi_factor_auth_model_with_lockout.blank?
|
512
|
+
raise LoginRadius::Error.new, getValidationMessage('multi_factor_auth_model_with_lockout')
|
513
|
+
end
|
514
|
+
if isNullOrWhiteSpace(second_factor_authentication_token)
|
515
|
+
raise LoginRadius::Error.new, getValidationMessage('second_factor_authentication_token')
|
516
|
+
end
|
517
|
+
|
518
|
+
query_parameters = {}
|
519
|
+
query_parameters['apiKey'] = @api_key
|
520
|
+
query_parameters['secondFactorAuthenticationToken'] = second_factor_authentication_token
|
521
|
+
unless isNullOrWhiteSpace(fields)
|
522
|
+
query_parameters['fields'] = fields
|
523
|
+
end
|
524
|
+
unless isNullOrWhiteSpace(sms_template2_f_a)
|
525
|
+
query_parameters['smsTemplate2FA'] = sms_template2_f_a
|
526
|
+
end
|
527
|
+
unless isNullOrWhiteSpace(rba_browser_email_template)
|
528
|
+
query_parameters['rbaBrowserEmailTemplate'] = rba_browser_email_template
|
529
|
+
end
|
530
|
+
unless isNullOrWhiteSpace(rba_city_email_template)
|
531
|
+
query_parameters['rbaCityEmailTemplate'] = rba_city_email_template
|
532
|
+
end
|
533
|
+
unless isNullOrWhiteSpace(rba_country_email_template)
|
534
|
+
query_parameters['rbaCountryEmailTemplate'] = rba_country_email_template
|
535
|
+
end
|
536
|
+
unless isNullOrWhiteSpace(rba_ip_email_template)
|
537
|
+
query_parameters['rbaIpEmailTemplate'] = rba_ip_email_template
|
538
|
+
end
|
539
|
+
|
540
|
+
resource_path = 'identity/v2/auth/login/2fa/verification/otp'
|
541
|
+
put_request(resource_path, query_parameters, multi_factor_auth_model_with_lockout)
|
542
|
+
end
|
543
|
+
|
544
|
+
# This API is used to login via Multi-factor-authentication by passing the google authenticator code.
|
545
|
+
#
|
546
|
+
# @param google_authenticator_code - The code generated by google authenticator app after scanning QR code
|
547
|
+
# @param second_factor_authentication_token - SecondFactorAuthenticationToken
|
548
|
+
# @param fields - The fields parameter filters the API response so that the response only includes a specific set of fields
|
549
|
+
# @param rba_browser_email_template - RbaBrowserEmailTemplate
|
550
|
+
# @param rba_city_email_template - RbaCityEmailTemplate
|
551
|
+
# @param rba_country_email_template - RbaCountryEmailTemplate
|
552
|
+
# @param rba_ip_email_template - RbaIpEmailTemplate
|
553
|
+
#
|
554
|
+
# @return Complete user UserProfile data
|
555
|
+
# 9.13
|
556
|
+
def mfa_validate_google_auth_code(google_authenticator_code, second_factor_authentication_token, fields = '', rba_browser_email_template = '', rba_city_email_template = '', rba_country_email_template = '', rba_ip_email_template = '')
|
557
|
+
if isNullOrWhiteSpace(google_authenticator_code)
|
558
|
+
raise LoginRadius::Error.new, getValidationMessage('google_authenticator_code')
|
559
|
+
end
|
560
|
+
if isNullOrWhiteSpace(second_factor_authentication_token)
|
561
|
+
raise LoginRadius::Error.new, getValidationMessage('second_factor_authentication_token')
|
562
|
+
end
|
563
|
+
|
564
|
+
query_parameters = {}
|
565
|
+
query_parameters['apiKey'] = @api_key
|
566
|
+
query_parameters['secondFactorAuthenticationToken'] = second_factor_authentication_token
|
567
|
+
unless isNullOrWhiteSpace(fields)
|
568
|
+
query_parameters['fields'] = fields
|
569
|
+
end
|
570
|
+
unless isNullOrWhiteSpace(rba_browser_email_template)
|
571
|
+
query_parameters['rbaBrowserEmailTemplate'] = rba_browser_email_template
|
572
|
+
end
|
573
|
+
unless isNullOrWhiteSpace(rba_city_email_template)
|
574
|
+
query_parameters['rbaCityEmailTemplate'] = rba_city_email_template
|
575
|
+
end
|
576
|
+
unless isNullOrWhiteSpace(rba_country_email_template)
|
577
|
+
query_parameters['rbaCountryEmailTemplate'] = rba_country_email_template
|
578
|
+
end
|
579
|
+
unless isNullOrWhiteSpace(rba_ip_email_template)
|
580
|
+
query_parameters['rbaIpEmailTemplate'] = rba_ip_email_template
|
581
|
+
end
|
582
|
+
|
583
|
+
body_parameters = {}
|
584
|
+
body_parameters['googleAuthenticatorCode'] = google_authenticator_code
|
585
|
+
|
586
|
+
resource_path = 'identity/v2/auth/login/2fa/verification/googleauthenticatorcode'
|
587
|
+
put_request(resource_path, query_parameters, body_parameters)
|
588
|
+
end
|
589
|
+
|
590
|
+
# This API is used to validate the backup code provided by the user and if valid, we return an access token allowing the user to login incases where Multi-factor authentication (MFA) is enabled and the secondary factor is unavailable. When a user initially downloads the Backup codes, We generate 10 codes, each code can only be consumed once. if any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically
|
591
|
+
#
|
592
|
+
# @param multi_factor_auth_model_by_backup_code - Model Class containing Definition of payload for MultiFactorAuth By BackupCode API
|
593
|
+
# @param second_factor_authentication_token - A Uniquely generated MFA identifier token after successful authentication
|
594
|
+
# @param fields - The fields parameter filters the API response so that the response only includes a specific set of fields
|
595
|
+
# @param rba_browser_email_template -
|
596
|
+
# @param rba_city_email_template -
|
597
|
+
# @param rba_country_email_template -
|
598
|
+
# @param rba_ip_email_template -
|
599
|
+
#
|
600
|
+
# @return Complete user UserProfile data
|
601
|
+
# 9.14
|
602
|
+
def mfa_validate_backup_code(multi_factor_auth_model_by_backup_code, second_factor_authentication_token, fields = '', rba_browser_email_template = '', rba_city_email_template = '', rba_country_email_template = '', rba_ip_email_template = '')
|
603
|
+
if multi_factor_auth_model_by_backup_code.blank?
|
604
|
+
raise LoginRadius::Error.new, getValidationMessage('multi_factor_auth_model_by_backup_code')
|
605
|
+
end
|
606
|
+
if isNullOrWhiteSpace(second_factor_authentication_token)
|
607
|
+
raise LoginRadius::Error.new, getValidationMessage('second_factor_authentication_token')
|
608
|
+
end
|
609
|
+
|
610
|
+
query_parameters = {}
|
611
|
+
query_parameters['apiKey'] = @api_key
|
612
|
+
query_parameters['secondFactorAuthenticationToken'] = second_factor_authentication_token
|
613
|
+
unless isNullOrWhiteSpace(fields)
|
614
|
+
query_parameters['fields'] = fields
|
615
|
+
end
|
616
|
+
unless isNullOrWhiteSpace(rba_browser_email_template)
|
617
|
+
query_parameters['rbaBrowserEmailTemplate'] = rba_browser_email_template
|
618
|
+
end
|
619
|
+
unless isNullOrWhiteSpace(rba_city_email_template)
|
620
|
+
query_parameters['rbaCityEmailTemplate'] = rba_city_email_template
|
621
|
+
end
|
622
|
+
unless isNullOrWhiteSpace(rba_country_email_template)
|
623
|
+
query_parameters['rbaCountryEmailTemplate'] = rba_country_email_template
|
624
|
+
end
|
625
|
+
unless isNullOrWhiteSpace(rba_ip_email_template)
|
626
|
+
query_parameters['rbaIpEmailTemplate'] = rba_ip_email_template
|
627
|
+
end
|
628
|
+
|
629
|
+
resource_path = 'identity/v2/auth/login/2fa/verification/backupcode'
|
630
|
+
put_request(resource_path, query_parameters, multi_factor_auth_model_by_backup_code)
|
631
|
+
end
|
632
|
+
|
633
|
+
# This API is used to update (if configured) the phone number used for Multi-factor authentication by sending the verification OTP to the provided phone number
|
634
|
+
#
|
635
|
+
# @param phone_no2_f_a - Phone Number For 2FA
|
636
|
+
# @param second_factor_authentication_token - A Uniquely generated MFA identifier token after successful authentication
|
637
|
+
# @param sms_template2_f_a - SMS Template Name
|
638
|
+
#
|
639
|
+
# @return Response containing Definition for Complete SMS data
|
640
|
+
# 9.16
|
641
|
+
def mfa_update_phone_number(phone_no2_f_a, second_factor_authentication_token, sms_template2_f_a = '')
|
642
|
+
if isNullOrWhiteSpace(phone_no2_f_a)
|
643
|
+
raise LoginRadius::Error.new, getValidationMessage('phone_no2_f_a')
|
644
|
+
end
|
645
|
+
if isNullOrWhiteSpace(second_factor_authentication_token)
|
646
|
+
raise LoginRadius::Error.new, getValidationMessage('second_factor_authentication_token')
|
647
|
+
end
|
648
|
+
|
649
|
+
query_parameters = {}
|
650
|
+
query_parameters['apiKey'] = @api_key
|
651
|
+
query_parameters['secondFactorAuthenticationToken'] = second_factor_authentication_token
|
652
|
+
unless isNullOrWhiteSpace(sms_template2_f_a)
|
653
|
+
query_parameters['smsTemplate2FA'] = sms_template2_f_a
|
654
|
+
end
|
655
|
+
|
656
|
+
body_parameters = {}
|
657
|
+
body_parameters['phoneNo2FA'] = phone_no2_f_a
|
658
|
+
|
659
|
+
resource_path = 'identity/v2/auth/login/2fa'
|
660
|
+
put_request(resource_path, query_parameters, body_parameters)
|
661
|
+
end
|
662
|
+
|
663
|
+
# This API is used to resending the verification OTP to the provided phone number
|
664
|
+
#
|
665
|
+
# @param second_factor_authentication_token - A Uniquely generated MFA identifier token after successful authentication
|
666
|
+
# @param sms_template2_f_a - SMS Template Name
|
667
|
+
#
|
668
|
+
# @return Response containing Definition for Complete SMS data
|
669
|
+
# 9.17
|
670
|
+
def mfa_resend_otp(second_factor_authentication_token, sms_template2_f_a = '')
|
671
|
+
if isNullOrWhiteSpace(second_factor_authentication_token)
|
672
|
+
raise LoginRadius::Error.new, getValidationMessage('second_factor_authentication_token')
|
673
|
+
end
|
674
|
+
|
675
|
+
query_parameters = {}
|
676
|
+
query_parameters['apiKey'] = @api_key
|
677
|
+
query_parameters['secondFactorAuthenticationToken'] = second_factor_authentication_token
|
678
|
+
unless isNullOrWhiteSpace(sms_template2_f_a)
|
679
|
+
query_parameters['smsTemplate2FA'] = sms_template2_f_a
|
680
|
+
end
|
681
|
+
|
682
|
+
resource_path = 'identity/v2/auth/login/2fa/resend'
|
683
|
+
get_request(resource_path, query_parameters, {})
|
684
|
+
end
|
685
|
+
|
686
|
+
# An API designed to send the MFA Email OTP to the email.
|
687
|
+
#
|
688
|
+
# @param email_id_model - payload
|
689
|
+
# @param second_factor_authentication_token - SecondFactorAuthenticationToken
|
690
|
+
# @param email_template2_f_a - EmailTemplate2FA
|
691
|
+
#
|
692
|
+
# @return Response containing Definition of Complete Validation data
|
693
|
+
# 9.18
|
694
|
+
def mfa_email_otp(email_id_model, second_factor_authentication_token, email_template2_f_a = '')
|
695
|
+
if email_id_model.blank?
|
696
|
+
raise LoginRadius::Error.new, getValidationMessage('email_id_model')
|
697
|
+
end
|
698
|
+
if isNullOrWhiteSpace(second_factor_authentication_token)
|
699
|
+
raise LoginRadius::Error.new, getValidationMessage('second_factor_authentication_token')
|
700
|
+
end
|
701
|
+
|
702
|
+
query_parameters = {}
|
703
|
+
query_parameters['apiKey'] = @api_key
|
704
|
+
query_parameters['secondFactorAuthenticationToken'] = second_factor_authentication_token
|
705
|
+
unless isNullOrWhiteSpace(email_template2_f_a)
|
706
|
+
query_parameters['emailTemplate2FA'] = email_template2_f_a
|
707
|
+
end
|
708
|
+
|
709
|
+
resource_path = 'identity/v2/auth/login/2fa/otp/email'
|
710
|
+
post_request(resource_path, query_parameters, email_id_model)
|
711
|
+
end
|
712
|
+
|
713
|
+
# This API is used to Verify MFA Email OTP by MFA Token
|
714
|
+
#
|
715
|
+
# @param multi_factor_auth_model_by_email_otp - payload
|
716
|
+
# @param second_factor_authentication_token - SecondFactorAuthenticationToken
|
717
|
+
# @param rba_browser_email_template - RbaBrowserEmailTemplate
|
718
|
+
# @param rba_city_email_template - RbaCityEmailTemplate
|
719
|
+
# @param rba_country_email_template - RbaCountryEmailTemplate
|
720
|
+
# @param rba_ip_email_template - RbaIpEmailTemplate
|
721
|
+
#
|
722
|
+
# @return Response Containing Access Token and Complete Profile Data
|
723
|
+
# 9.25
|
724
|
+
def mfa_validate_email_otp(multi_factor_auth_model_by_email_otp, second_factor_authentication_token, rba_browser_email_template = '', rba_city_email_template = '', rba_country_email_template = '', rba_ip_email_template = '')
|
725
|
+
if multi_factor_auth_model_by_email_otp.blank?
|
726
|
+
raise LoginRadius::Error.new, getValidationMessage('multi_factor_auth_model_by_email_otp')
|
727
|
+
end
|
728
|
+
if isNullOrWhiteSpace(second_factor_authentication_token)
|
729
|
+
raise LoginRadius::Error.new, getValidationMessage('second_factor_authentication_token')
|
730
|
+
end
|
731
|
+
|
732
|
+
query_parameters = {}
|
733
|
+
query_parameters['apiKey'] = @api_key
|
734
|
+
query_parameters['secondFactorAuthenticationToken'] = second_factor_authentication_token
|
735
|
+
unless isNullOrWhiteSpace(rba_browser_email_template)
|
736
|
+
query_parameters['rbaBrowserEmailTemplate'] = rba_browser_email_template
|
737
|
+
end
|
738
|
+
unless isNullOrWhiteSpace(rba_city_email_template)
|
739
|
+
query_parameters['rbaCityEmailTemplate'] = rba_city_email_template
|
740
|
+
end
|
741
|
+
unless isNullOrWhiteSpace(rba_country_email_template)
|
742
|
+
query_parameters['rbaCountryEmailTemplate'] = rba_country_email_template
|
743
|
+
end
|
744
|
+
unless isNullOrWhiteSpace(rba_ip_email_template)
|
745
|
+
query_parameters['rbaIpEmailTemplate'] = rba_ip_email_template
|
746
|
+
end
|
747
|
+
|
748
|
+
resource_path = 'identity/v2/auth/login/2fa/verification/otp/email'
|
749
|
+
put_request(resource_path, query_parameters, multi_factor_auth_model_by_email_otp)
|
750
|
+
end
|
751
|
+
|
752
|
+
# This API is used to set the security questions on the profile with the MFA token when MFA flow is required.
|
753
|
+
#
|
754
|
+
# @param security_question_answer_update_model - payload
|
755
|
+
# @param second_factor_authentication_token - SecondFactorAuthenticationToken
|
756
|
+
#
|
757
|
+
# @return Response Containing Access Token and Complete Profile Data
|
758
|
+
# 9.26
|
759
|
+
def mfa_security_question_answer(security_question_answer_update_model, second_factor_authentication_token)
|
760
|
+
if security_question_answer_update_model.blank?
|
761
|
+
raise LoginRadius::Error.new, getValidationMessage('security_question_answer_update_model')
|
762
|
+
end
|
763
|
+
if isNullOrWhiteSpace(second_factor_authentication_token)
|
764
|
+
raise LoginRadius::Error.new, getValidationMessage('second_factor_authentication_token')
|
765
|
+
end
|
766
|
+
|
767
|
+
query_parameters = {}
|
768
|
+
query_parameters['apiKey'] = @api_key
|
769
|
+
query_parameters['secondFactorAuthenticationToken'] = second_factor_authentication_token
|
770
|
+
|
771
|
+
resource_path = 'identity/v2/auth/login/2fa/securityquestionanswer'
|
772
|
+
put_request(resource_path, query_parameters, security_question_answer_update_model)
|
773
|
+
end
|
774
|
+
|
775
|
+
# This API is used to resending the verification OTP to the provided phone number
|
776
|
+
#
|
777
|
+
# @param security_question_answer_update_model - payload
|
778
|
+
# @param second_factor_authentication_token - SecondFactorAuthenticationToken
|
779
|
+
# @param rba_browser_email_template - RbaBrowserEmailTemplate
|
780
|
+
# @param rba_city_email_template - RbaCityEmailTemplate
|
781
|
+
# @param rba_country_email_template - RbaCountryEmailTemplate
|
782
|
+
# @param rba_ip_email_template - RbaIpEmailTemplate
|
783
|
+
#
|
784
|
+
# @return Response Containing Access Token and Complete Profile Data
|
785
|
+
# 9.27
|
786
|
+
def mfa_security_question_answer_verification(security_question_answer_update_model, second_factor_authentication_token, rba_browser_email_template = '', rba_city_email_template = '', rba_country_email_template = '', rba_ip_email_template = '')
|
787
|
+
if security_question_answer_update_model.blank?
|
788
|
+
raise LoginRadius::Error.new, getValidationMessage('security_question_answer_update_model')
|
789
|
+
end
|
790
|
+
if isNullOrWhiteSpace(second_factor_authentication_token)
|
791
|
+
raise LoginRadius::Error.new, getValidationMessage('second_factor_authentication_token')
|
792
|
+
end
|
793
|
+
|
794
|
+
query_parameters = {}
|
795
|
+
query_parameters['apiKey'] = @api_key
|
796
|
+
query_parameters['secondFactorAuthenticationToken'] = second_factor_authentication_token
|
797
|
+
unless isNullOrWhiteSpace(rba_browser_email_template)
|
798
|
+
query_parameters['rbaBrowserEmailTemplate'] = rba_browser_email_template
|
799
|
+
end
|
800
|
+
unless isNullOrWhiteSpace(rba_city_email_template)
|
801
|
+
query_parameters['rbaCityEmailTemplate'] = rba_city_email_template
|
802
|
+
end
|
803
|
+
unless isNullOrWhiteSpace(rba_country_email_template)
|
804
|
+
query_parameters['rbaCountryEmailTemplate'] = rba_country_email_template
|
805
|
+
end
|
806
|
+
unless isNullOrWhiteSpace(rba_ip_email_template)
|
807
|
+
query_parameters['rbaIpEmailTemplate'] = rba_ip_email_template
|
808
|
+
end
|
809
|
+
|
810
|
+
resource_path = 'identity/v2/auth/login/2fa/verification/securityquestionanswer'
|
811
|
+
post_request(resource_path, query_parameters, security_question_answer_update_model)
|
812
|
+
end
|
813
|
+
|
814
|
+
# This API resets the SMS Authenticator configurations on a given account via the UID.
|
815
|
+
#
|
816
|
+
# @param otpauthenticator - Pass 'otpauthenticator' to remove SMS Authenticator
|
817
|
+
# @param uid - UID, the unified identifier for each user account
|
818
|
+
#
|
819
|
+
# @return Response containing Definition of Delete Request
|
820
|
+
# 18.21.1
|
821
|
+
def mfa_reset_sms_authenticator_by_uid(otpauthenticator, uid)
|
822
|
+
if isNullOrWhiteSpace(uid)
|
823
|
+
raise LoginRadius::Error.new, getValidationMessage('uid')
|
824
|
+
end
|
825
|
+
|
826
|
+
query_parameters = {}
|
827
|
+
query_parameters['apiKey'] = @api_key
|
828
|
+
query_parameters['apiSecret'] = @api_secret
|
829
|
+
query_parameters['uid'] = uid
|
830
|
+
|
831
|
+
body_parameters = {}
|
832
|
+
body_parameters['otpauthenticator'] = otpauthenticator
|
833
|
+
|
834
|
+
resource_path = 'identity/v2/manage/account/2fa/authenticator'
|
835
|
+
delete_request(resource_path, query_parameters, body_parameters)
|
836
|
+
end
|
837
|
+
|
838
|
+
# This API resets the Google Authenticator configurations on a given account via the UID.
|
839
|
+
#
|
840
|
+
# @param googleauthenticator - boolean type value,Enable google Authenticator Code.
|
841
|
+
# @param uid - UID, the unified identifier for each user account
|
842
|
+
#
|
843
|
+
# @return Response containing Definition of Delete Request
|
844
|
+
# 18.21.2
|
845
|
+
def mfa_reset_google_authenticator_by_uid(googleauthenticator, uid)
|
846
|
+
if isNullOrWhiteSpace(uid)
|
847
|
+
raise LoginRadius::Error.new, getValidationMessage('uid')
|
848
|
+
end
|
849
|
+
|
850
|
+
query_parameters = {}
|
851
|
+
query_parameters['apiKey'] = @api_key
|
852
|
+
query_parameters['apiSecret'] = @api_secret
|
853
|
+
query_parameters['uid'] = uid
|
854
|
+
|
855
|
+
body_parameters = {}
|
856
|
+
body_parameters['googleauthenticator'] = googleauthenticator
|
857
|
+
|
858
|
+
resource_path = 'identity/v2/manage/account/2fa/authenticator'
|
859
|
+
delete_request(resource_path, query_parameters, body_parameters)
|
860
|
+
end
|
861
|
+
|
862
|
+
# This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once.
|
863
|
+
#
|
864
|
+
# @param uid - UID, the unified identifier for each user account
|
865
|
+
#
|
866
|
+
# @return Response containing Definition of Complete Backup Code data
|
867
|
+
# 18.25
|
868
|
+
def mfa_backup_code_by_uid(uid)
|
869
|
+
if isNullOrWhiteSpace(uid)
|
870
|
+
raise LoginRadius::Error.new, getValidationMessage('uid')
|
871
|
+
end
|
872
|
+
|
873
|
+
query_parameters = {}
|
874
|
+
query_parameters['apiKey'] = @api_key
|
875
|
+
query_parameters['apiSecret'] = @api_secret
|
876
|
+
query_parameters['uid'] = uid
|
877
|
+
|
878
|
+
resource_path = 'identity/v2/manage/account/2fa/backupcode'
|
879
|
+
get_request(resource_path, query_parameters, {})
|
880
|
+
end
|
881
|
+
|
882
|
+
# This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once.
|
883
|
+
#
|
884
|
+
# @param uid - UID, the unified identifier for each user account
|
885
|
+
#
|
886
|
+
# @return Response containing Definition of Complete Backup Code data
|
887
|
+
# 18.26
|
888
|
+
def mfa_reset_backup_code_by_uid(uid)
|
889
|
+
if isNullOrWhiteSpace(uid)
|
890
|
+
raise LoginRadius::Error.new, getValidationMessage('uid')
|
891
|
+
end
|
892
|
+
|
893
|
+
query_parameters = {}
|
894
|
+
query_parameters['apiKey'] = @api_key
|
895
|
+
query_parameters['apiSecret'] = @api_secret
|
896
|
+
query_parameters['uid'] = uid
|
897
|
+
|
898
|
+
resource_path = 'identity/v2/manage/account/2fa/backupcode/reset'
|
899
|
+
get_request(resource_path, query_parameters, {})
|
900
|
+
end
|
901
|
+
|
902
|
+
# This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user.
|
903
|
+
#
|
904
|
+
# @param uid - UID, the unified identifier for each user account
|
905
|
+
#
|
906
|
+
# @return Response containing Definition of Delete Request
|
907
|
+
# 18.42
|
908
|
+
def mfa_reset_email_otp_authenticator_by_uid(uid)
|
909
|
+
if isNullOrWhiteSpace(uid)
|
910
|
+
raise LoginRadius::Error.new, getValidationMessage('uid')
|
911
|
+
end
|
912
|
+
|
913
|
+
query_parameters = {}
|
914
|
+
query_parameters['apiKey'] = @api_key
|
915
|
+
query_parameters['apiSecret'] = @api_secret
|
916
|
+
query_parameters['uid'] = uid
|
917
|
+
|
918
|
+
resource_path = 'identity/v2/manage/account/2fa/authenticator/otp/email'
|
919
|
+
delete_request(resource_path, query_parameters, {})
|
920
|
+
end
|
921
|
+
|
922
|
+
# This API is used to reset the Security Question Authenticator settings for an MFA-enabled user.
|
923
|
+
#
|
924
|
+
# @param uid - UID, the unified identifier for each user account
|
925
|
+
#
|
926
|
+
# @return Response containing Definition of Delete Request
|
927
|
+
# 18.43
|
928
|
+
def mfa_reset_security_question_authenticator_by_uid(uid)
|
929
|
+
if isNullOrWhiteSpace(uid)
|
930
|
+
raise LoginRadius::Error.new, getValidationMessage('uid')
|
931
|
+
end
|
932
|
+
|
933
|
+
query_parameters = {}
|
934
|
+
query_parameters['apiKey'] = @api_key
|
935
|
+
query_parameters['apiSecret'] = @api_secret
|
936
|
+
query_parameters['uid'] = uid
|
937
|
+
|
938
|
+
resource_path = 'identity/v2/manage/account/2fa/authenticator/securityquestionanswer'
|
939
|
+
delete_request(resource_path, query_parameters, {})
|
940
|
+
end
|
941
|
+
end
|
942
|
+
end
|