login_radius 3.0.0 → 10.0.0.pre.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE.txt +21 -0
- data/README.md +58 -52
- data/lib/login_radius.rb +30 -15
- data/lib/login_radius/api/account/account_api.rb +581 -0
- data/lib/login_radius/api/account/role_api.rb +330 -0
- data/lib/login_radius/api/account/sott_api.rb +47 -0
- data/lib/login_radius/api/advanced/configuration_api.rb +57 -0
- data/lib/login_radius/api/advanced/consent_management_api.rb +161 -0
- data/lib/login_radius/api/advanced/custom_object_api.rb +316 -0
- data/lib/login_radius/api/advanced/custom_registration_data_api.rb +195 -0
- data/lib/login_radius/api/advanced/multi_factor_authentication_api.rb +606 -0
- data/lib/login_radius/api/advanced/re_authentication_api.rb +243 -0
- data/lib/login_radius/api/advanced/web_hook_api.rb +101 -0
- data/lib/login_radius/api/authentication/authentication_api.rb +986 -0
- data/lib/login_radius/api/authentication/one_touch_login_api.rb +160 -0
- data/lib/login_radius/api/authentication/password_less_login_api.rb +158 -0
- data/lib/login_radius/api/authentication/phone_authentication_api.rb +329 -0
- data/lib/login_radius/api/authentication/pin_authentication_api.rb +316 -0
- data/lib/login_radius/api/authentication/risk_based_authentication_api.rb +286 -0
- data/lib/login_radius/api/authentication/smart_login_api.rb +146 -0
- data/lib/login_radius/api/social/native_social_api.rb +193 -0
- data/lib/login_radius/api/social/social_api.rb +802 -0
- data/lib/login_radius/error.rb +7 -0
- data/lib/login_radius/request_client.rb +295 -0
- data/lib/login_radius/response.rb +12 -0
- data/lib/login_radius/version.rb +3 -3
- data/login_radius.gemspec +36 -0
- metadata +61 -20
- data/LICENSE +0 -22
- data/lib/hash.rb +0 -12
- data/lib/login_radius/advanced_api.rb +0 -133
- data/lib/login_radius/authentication_api.rb +0 -597
- data/lib/login_radius/exception.rb +0 -4
- data/lib/login_radius/management_api.rb +0 -327
- data/lib/login_radius/rest_request.rb +0 -142
- data/lib/login_radius/social_api.rb +0 -402
- data/lib/login_radius/two_fa_api.rb +0 -191
- data/lib/string.rb +0 -8
@@ -1,402 +0,0 @@
|
|
1
|
-
module LoginRadius
|
2
|
-
module SocialApi
|
3
|
-
|
4
|
-
|
5
|
-
def authentication
|
6
|
-
return authentication = {
|
7
|
-
:appkey => appkey,
|
8
|
-
:appsecret => appsecret
|
9
|
-
}
|
10
|
-
end
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
#
|
15
|
-
# LoginRadius function - Fetch LoginRadius access token after authentication. It will be valid for the specific duration of time specified in the response.
|
16
|
-
# @param string LoginRadius API token
|
17
|
-
#
|
18
|
-
# @return mixed string|object LoginRadius access token.
|
19
|
-
#
|
20
|
-
#
|
21
|
-
|
22
|
-
|
23
|
-
def getAccessToken(token)
|
24
|
-
return getRequest("api/v2/access_token", {:token=>token,:secret=>appsecret},"api");
|
25
|
-
rescue LoginRadiusRaas::Exception => e
|
26
|
-
return false
|
27
|
-
end
|
28
|
-
|
29
|
-
|
30
|
-
#
|
31
|
-
# LoginRadius function - Validate LoginRadius access token.This API validates access token, if valid then returns a response with its expiry otherwise error.
|
32
|
-
# @param string LoginRadius API token
|
33
|
-
# @return mixed string|object LoginRadius access token.
|
34
|
-
#
|
35
|
-
#
|
36
|
-
|
37
|
-
|
38
|
-
def getValidateAccessToken(token)
|
39
|
-
return getRequest("api/v2/access_token/validate", {:access_token=>token,:key=>appkey,:secret=>appsecret},"api");
|
40
|
-
rescue LoginRadiusRaas::Exception => e
|
41
|
-
return false
|
42
|
-
end
|
43
|
-
|
44
|
-
|
45
|
-
#
|
46
|
-
# LoginRadius function - Invalidate LoginRadius access token.This api invalidates the active access token or expires an access token validity.
|
47
|
-
# @param string LoginRadius API token
|
48
|
-
# @return mixed string|object LoginRadius access token.
|
49
|
-
#
|
50
|
-
#
|
51
|
-
|
52
|
-
|
53
|
-
def getInvalidateAccessToken(token)
|
54
|
-
return getRequest("api/v2/access_token/invalidate", {:access_token=>token,:key=>appkey,:secret=>appsecret},"api");
|
55
|
-
rescue LoginRadiusRaas::Exception => e
|
56
|
-
return false
|
57
|
-
end
|
58
|
-
|
59
|
-
|
60
|
-
#
|
61
|
-
# LoginRadius function - To get the Albums data from the user's social account. The data will be normalized into LoginRadius' data format.
|
62
|
-
#
|
63
|
-
# @param string accessToken LoginRadius access token
|
64
|
-
# @param boolean raw If true, raw data is fetched
|
65
|
-
#
|
66
|
-
# @return object User's albums data.
|
67
|
-
#
|
68
|
-
#
|
69
|
-
|
70
|
-
|
71
|
-
def getAlbums(accessToken, raw = false)
|
72
|
-
return getRequest("api/v2/album" + get_row_data(raw), {:access_token=>accessToken},"api");
|
73
|
-
rescue LoginRadiusRaas::Exception => e
|
74
|
-
return false
|
75
|
-
end
|
76
|
-
|
77
|
-
|
78
|
-
#
|
79
|
-
# LoginRadius function - To fetch user's audio files data from the user's social account. The data will be normalized into LoginRadius' data format.
|
80
|
-
#
|
81
|
-
# @param string accessToken LoginRadius access token
|
82
|
-
# @param boolean raw If true, raw data is fetched
|
83
|
-
#
|
84
|
-
# @return object User's audio files data.
|
85
|
-
#
|
86
|
-
#
|
87
|
-
|
88
|
-
|
89
|
-
def getAudios(accessToken, raw = false)
|
90
|
-
return getRequest("api/v2/audio" + get_row_data(raw), {:access_token=>accessToken},"api");
|
91
|
-
rescue LoginRadiusRaas::Exception => e
|
92
|
-
return false
|
93
|
-
end
|
94
|
-
|
95
|
-
|
96
|
-
#
|
97
|
-
# LoginRadius function - To fetch check-ins data from the user's social account. The data will be normalized into LoginRadius' data format.
|
98
|
-
#
|
99
|
-
# @param string accessToken LoginRadius access token
|
100
|
-
# @param boolean raw If true, raw data is fetched
|
101
|
-
#
|
102
|
-
# @return object User's check-ins.
|
103
|
-
#
|
104
|
-
#
|
105
|
-
|
106
|
-
|
107
|
-
def getCheckins(accessToken, raw = false)
|
108
|
-
return getRequest("api/v2/checkin" + get_row_data(raw), {:access_token=>accessToken},"api");
|
109
|
-
rescue LoginRadiusRaas::Exception => e
|
110
|
-
return false
|
111
|
-
end
|
112
|
-
|
113
|
-
|
114
|
-
#
|
115
|
-
# LoginRadius function - To get the followed company's data in the user's social account. The data will be normalized into LoginRadius' data format.
|
116
|
-
#
|
117
|
-
# @param string $accessToken LoginRadius access token
|
118
|
-
# @param boolean $raw If true, raw data is fetched
|
119
|
-
#
|
120
|
-
# @return object Companies followed by user.
|
121
|
-
#
|
122
|
-
|
123
|
-
def getCompanies(accessToken, raw = false)
|
124
|
-
return getRequest("api/v2/company" + get_row_data(raw), {:access_token=>accessToken},"api");
|
125
|
-
rescue LoginRadiusRaas::Exception => e
|
126
|
-
return false
|
127
|
-
end
|
128
|
-
|
129
|
-
|
130
|
-
#
|
131
|
-
# LoginRadius function - To fetch user's contacts/friends/connections data from the user's social account. The data will normalized into LoginRadius' data format.
|
132
|
-
#
|
133
|
-
# @param string $accessToken LoginRadius access token
|
134
|
-
# @param integer $nextCursor Offset to start fetching contacts from
|
135
|
-
# @param boolean $raw If true, raw data is fetched
|
136
|
-
#
|
137
|
-
# @return object User's contacts/friends/followers.
|
138
|
-
#
|
139
|
-
#
|
140
|
-
|
141
|
-
|
142
|
-
def getContacts(accessToken, nextCursor = '0', raw = false)
|
143
|
-
return getRequest("api/v2/contact" + get_row_data(raw), {:access_token=>accessToken,:nextcursor=>nextCursor},"api");
|
144
|
-
rescue LoginRadiusRaas::Exception => e
|
145
|
-
return false
|
146
|
-
end
|
147
|
-
|
148
|
-
#
|
149
|
-
# LoginRadius function - To get the event data from the user's social account. The data will be normalized into LoginRadius' data format.
|
150
|
-
#
|
151
|
-
# @param string $accessToken LoginRadius access token
|
152
|
-
# @param boolean $raw If true, raw data is fetched
|
153
|
-
#
|
154
|
-
# @return object User's event data.
|
155
|
-
#
|
156
|
-
|
157
|
-
|
158
|
-
def getEvents(accessToken, raw = false)
|
159
|
-
return getRequest("api/v2/event" + get_row_data(raw), {:access_token=>accessToken},"api");
|
160
|
-
rescue LoginRadiusRaas::Exception => e
|
161
|
-
return false
|
162
|
-
end
|
163
|
-
|
164
|
-
|
165
|
-
#
|
166
|
-
# LoginRadius function - To fetch information of the people, user is following on Twitter.
|
167
|
-
#
|
168
|
-
# @param string $accessToken LoginRadius access token
|
169
|
-
# @param boolean $raw If true, raw data is fetched
|
170
|
-
#
|
171
|
-
# @return object Information of the people, user is following.
|
172
|
-
#
|
173
|
-
|
174
|
-
def getFollowing(accessToken, raw = false)
|
175
|
-
return getRequest("api/v2/following" + get_row_data(raw), {:access_token=>accessToken},"api");
|
176
|
-
rescue LoginRadiusRaas::Exception => e
|
177
|
-
return false
|
178
|
-
end
|
179
|
-
|
180
|
-
#
|
181
|
-
# LoginRadius function - To get group data from the user's social account. The data will be normalized into LoginRadius' data format.
|
182
|
-
#
|
183
|
-
# @param string $accessToken LoginRadius access token
|
184
|
-
# @param boolean $raw If true, raw data is fetched
|
185
|
-
#
|
186
|
-
# @return object Group data.
|
187
|
-
#
|
188
|
-
|
189
|
-
def getGroups(accessToken, raw = false)
|
190
|
-
return getRequest("api/v2/group" + get_row_data(raw), {:access_token=>accessToken},"api");
|
191
|
-
rescue LoginRadiusRaas::Exception => e
|
192
|
-
return false
|
193
|
-
end
|
194
|
-
|
195
|
-
#
|
196
|
-
# LoginRadius function - To get likes data from the user's social account. The data will be normalized into LoginRadius' data format.
|
197
|
-
#
|
198
|
-
# @param string $accessToken LoginRadius access token
|
199
|
-
# @param boolean $raw If true, raw data is fetched
|
200
|
-
#
|
201
|
-
# @return object likes data.
|
202
|
-
#
|
203
|
-
|
204
|
-
def getLikes(accessToken, raw = false)
|
205
|
-
return getRequest("api/v2/like" + get_row_data(raw), {:access_token=>accessToken},"api");
|
206
|
-
rescue LoginRadiusRaas::Exception => e
|
207
|
-
return false
|
208
|
-
end
|
209
|
-
|
210
|
-
|
211
|
-
#
|
212
|
-
# LoginRadius function - To get mention data from the user's social account. The data will be normalized into LoginRadius' data format.
|
213
|
-
#
|
214
|
-
# @param string $accessToken LoginRadius access token
|
215
|
-
# @param boolean $raw If true, raw data is fetched
|
216
|
-
#
|
217
|
-
# @return object User's twitter mentions.
|
218
|
-
#
|
219
|
-
|
220
|
-
|
221
|
-
def getMentions(accessToken, raw = false)
|
222
|
-
return getRequest("api/v2/mention" + get_row_data(raw), {:access_token=>accessToken},"api");
|
223
|
-
rescue LoginRadiusRaas::Exception => e
|
224
|
-
return false
|
225
|
-
end
|
226
|
-
|
227
|
-
|
228
|
-
#
|
229
|
-
# LoginRadius function - Post messages to the user's contacts. After using the Contact API, you can send messages to the retrieved contacts.
|
230
|
-
#
|
231
|
-
# @param string $accessToken LoginRadius access token
|
232
|
-
# @param string $to Social ID of the receiver
|
233
|
-
# @param string $subject Subject of the message
|
234
|
-
# @param string $message Message
|
235
|
-
#
|
236
|
-
# @return bool True on success, false otherwise
|
237
|
-
#
|
238
|
-
|
239
|
-
|
240
|
-
def postMessage(accessToken, to, subject, message)
|
241
|
-
param = {
|
242
|
-
:access_token => accessToken,
|
243
|
-
:to => to,
|
244
|
-
:subject => subject,
|
245
|
-
:message => message
|
246
|
-
}
|
247
|
-
return postRequest("api/v2/message", param,{},nil,"api");
|
248
|
-
rescue LoginRadiusRaas::Exception => e
|
249
|
-
return false
|
250
|
-
end
|
251
|
-
|
252
|
-
|
253
|
-
#
|
254
|
-
# LoginRadius function - To get the page data from the user's social account. The data will be normalized into LoginRadius' data format.
|
255
|
-
#
|
256
|
-
# @param string $accessToken LoginRadius access token
|
257
|
-
# @param string $pageName Page name
|
258
|
-
# @param boolean $raw If true, raw data is fetched
|
259
|
-
#
|
260
|
-
# @return object Page data.
|
261
|
-
#
|
262
|
-
|
263
|
-
def getPages(accessToken, pageName)
|
264
|
-
return getRequest("api/v2/page", {:access_token=>accessToken,:pagename=>pageName},"api");
|
265
|
-
rescue LoginRadiusRaas::Exception => e
|
266
|
-
return false
|
267
|
-
end
|
268
|
-
|
269
|
-
|
270
|
-
#
|
271
|
-
# LoginRadius function - To fetch photo data from the user's social account. The data will be normalized into LoginRadius' data format.
|
272
|
-
#
|
273
|
-
# @param string accessToken LoginRadius access token
|
274
|
-
# @param string albumId ID of the album to fetch photos from
|
275
|
-
# @param boolean raw If true, raw data is fetched
|
276
|
-
#
|
277
|
-
# @return object User's photo data.
|
278
|
-
#
|
279
|
-
|
280
|
-
|
281
|
-
def getPhotos(accessToken, albumId)
|
282
|
-
return getRequest("api/v2/photo", {:access_token=>accessToken,:albumid=>albumId},"api");
|
283
|
-
rescue LoginRadiusRaas::Exception => e
|
284
|
-
return false
|
285
|
-
end
|
286
|
-
|
287
|
-
|
288
|
-
#
|
289
|
-
# LoginRadius function - To get posted messages from the user's social account. The data will be normalized into LoginRadius' data format.
|
290
|
-
#
|
291
|
-
# @param string $accessToken LoginRadius access token
|
292
|
-
# @param boolean $raw If true, raw data is fetched
|
293
|
-
#
|
294
|
-
# @return object User's posted messages.
|
295
|
-
#
|
296
|
-
|
297
|
-
|
298
|
-
def getPosts(accessToken, raw = false)
|
299
|
-
return getRequest("api/v2/post" + get_row_data(raw), {:access_token=>accessToken},"api");
|
300
|
-
rescue LoginRadiusRaas::Exception => e
|
301
|
-
return false
|
302
|
-
end
|
303
|
-
|
304
|
-
|
305
|
-
#
|
306
|
-
# LoginRadius function - To get the status messages from the user's social account. The data will be normalized into LoginRadius' data format.
|
307
|
-
#
|
308
|
-
# @param string $accessToken LoginRadius access token
|
309
|
-
# @param boolean $raw If true, raw data is fetched
|
310
|
-
#
|
311
|
-
# @return object Status messages.
|
312
|
-
#
|
313
|
-
|
314
|
-
|
315
|
-
def getStatus(accessToken, raw = false)
|
316
|
-
return getRequest("api/v2/status" + get_row_data(raw), {:access_token=>accessToken},"api");
|
317
|
-
rescue LoginRadiusRaas::Exception => e
|
318
|
-
return false
|
319
|
-
end
|
320
|
-
|
321
|
-
|
322
|
-
#
|
323
|
-
# LoginRadius function - To update the status on the user's wall.
|
324
|
-
#
|
325
|
-
# @param string $accessToken LoginRadius access token
|
326
|
-
# @param string $title Title for status message (Optional).
|
327
|
-
# @param string $url A web link of the status message (Optional).
|
328
|
-
# @param string $imageurl An image URL of the status message (Optional).
|
329
|
-
# @param string $status The status message text (Required).
|
330
|
-
# @param string $caption Caption of the status message (Optional).
|
331
|
-
# @param string $description Description of the status message (Optional).
|
332
|
-
#
|
333
|
-
# @return boolean Returns true if successful, false otherwise.
|
334
|
-
#
|
335
|
-
|
336
|
-
|
337
|
-
def postStatus(accessToken, title, url, imageurl, status, caption, description)
|
338
|
-
param = {
|
339
|
-
:access_token => accessToken,
|
340
|
-
:title => title,
|
341
|
-
:url => url,
|
342
|
-
:imageurl => imageurl,
|
343
|
-
:status => status,
|
344
|
-
:caption => caption,
|
345
|
-
:description => description
|
346
|
-
}
|
347
|
-
return postRequest("api/v2/status", param, {},nil,"api");
|
348
|
-
rescue LoginRadiusRaas::Exception => e
|
349
|
-
return false
|
350
|
-
end
|
351
|
-
|
352
|
-
#
|
353
|
-
# LoginRadius function - To fetch social profile data from the user's social account after authentication. The social profile will be retrieved via oAuth and OpenID protocols. The data is normalized into LoginRadius' standard data format.
|
354
|
-
#
|
355
|
-
# @param string accessToken LoginRadius access token
|
356
|
-
# @param boolean raw If true, raw data is fetched
|
357
|
-
#
|
358
|
-
# @return object User profile data.
|
359
|
-
#
|
360
|
-
|
361
|
-
def getUserProfile(accessToken, raw = false)
|
362
|
-
return getRequest("api/v2/userprofile" + get_row_data(raw), {:access_token=>accessToken},"api");
|
363
|
-
rescue LoginRadiusRaas::Exception => e
|
364
|
-
return false
|
365
|
-
end
|
366
|
-
|
367
|
-
|
368
|
-
#
|
369
|
-
# LoginRadius function - To get videos data from the user's social account. The data will be normalized into LoginRadius' data format.
|
370
|
-
#
|
371
|
-
# @param string $accessToken LoginRadius access token
|
372
|
-
# @param boolean $raw If true, raw data is fetched
|
373
|
-
#
|
374
|
-
# @return object Videos data.
|
375
|
-
#
|
376
|
-
|
377
|
-
def getVideos(accessToken, raw = false)
|
378
|
-
return getRequest("api/v2/video" + get_row_data(raw), {:access_token=>accessToken},"api");
|
379
|
-
rescue LoginRadiusRaas::Exception => e
|
380
|
-
return false
|
381
|
-
end
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
#
|
388
|
-
# LoginRadius function - To fetch data from the LoginRadius Raw API URL.
|
389
|
-
#
|
390
|
-
# @param boolean raw If true, raw data is fetched
|
391
|
-
#
|
392
|
-
# @return string Data to add in API URL.
|
393
|
-
#
|
394
|
-
def get_row_data(raw)
|
395
|
-
if raw
|
396
|
-
return '/raw';
|
397
|
-
else
|
398
|
-
return '';
|
399
|
-
end
|
400
|
-
end
|
401
|
-
end
|
402
|
-
end
|
@@ -1,191 +0,0 @@
|
|
1
|
-
module LoginRadius
|
2
|
-
module Two_FA_Api
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
# ------------------------------------------------------------- Get API --------------------------------------------------------------------#
|
7
|
-
|
8
|
-
|
9
|
-
def validateGoogleAuthCode_2FA(secondfactorauthenticationtoken,googleauthenticatorcode)
|
10
|
-
return getRequest("identity/v2/auth/login/2fa/verification",{:apikey=> appkey,:secondfactorauthenticationtoken=> secondfactorauthenticationtoken,:googleauthenticatorcode=> googleauthenticatorcode},"api");
|
11
|
-
rescue LoginRadiusRaas::Exception => e
|
12
|
-
false
|
13
|
-
end
|
14
|
-
|
15
|
-
|
16
|
-
def validateOtp_2FA(secondfactorauthenticationtoken,otp,smstemplate2fa)
|
17
|
-
return getRequest("identity/v2/auth/login/2fa/verification",{:apikey=> appkey,:secondfactorauthenticationtoken=> secondfactorauthenticationtoken,:otp=> otp,:smstemplate2fa=> smstemplate2fa},"api");
|
18
|
-
rescue LoginRadiusRaas::Exception => e
|
19
|
-
false
|
20
|
-
end
|
21
|
-
|
22
|
-
|
23
|
-
def validateAccessToken_2FA(access_token,smstemplate2fa)
|
24
|
-
return getRequest("identity/v2/auth/account/2fa",{:apikey=> appkey,:access_token=> access_token,:smstemplate2fa=> smstemplate2fa},"api");
|
25
|
-
rescue LoginRadiusRaas::Exception => e
|
26
|
-
false
|
27
|
-
end
|
28
|
-
|
29
|
-
|
30
|
-
def validateBackupCode_2FA(secondfactorauthenticationtoken,backupcode)
|
31
|
-
return getRequest("identity/v2/auth/login/2fa/backupcode",{:apikey=> appkey,:secondfactorauthenticationtoken=> secondfactorauthenticationtoken,:backupcode=> backupcode},"api");
|
32
|
-
rescue LoginRadiusRaas::Exception => e
|
33
|
-
false
|
34
|
-
end
|
35
|
-
|
36
|
-
|
37
|
-
def getBackupCode_2FA(access_token)
|
38
|
-
return getRequest("identity/v2/auth/login/2fa/backupcode",{:apikey=> appkey,:access_token=> access_token},"api");
|
39
|
-
rescue LoginRadiusRaas::Exception => e
|
40
|
-
false
|
41
|
-
end
|
42
|
-
|
43
|
-
|
44
|
-
def resetBackupCode_2FA(access_token)
|
45
|
-
return getRequest("identity/v2/auth/account/2fa/backupcode/reset",{:apikey=> appkey,:access_token=> access_token},"api");
|
46
|
-
rescue LoginRadiusRaas::Exception => e
|
47
|
-
false
|
48
|
-
end
|
49
|
-
|
50
|
-
def getBackupCodeByUid_2FA(uid)
|
51
|
-
return getRequest("identity/v2/manage/account/2fa/backupcode",{:apikey=> appkey,:apisecret=>appsecret,:uid=> uid},"api");
|
52
|
-
rescue LoginRadiusRaas::Exception => e
|
53
|
-
false
|
54
|
-
end
|
55
|
-
|
56
|
-
|
57
|
-
def resetBackupCodeByUid_2FA(uid)
|
58
|
-
return getRequest("identity/v2/manage/account/2fa/backupcode/reset",{:apikey=> appkey,:apisecret=>appsecret,:uid=> uid},"api");
|
59
|
-
rescue LoginRadiusRaas::Exception => e
|
60
|
-
false
|
61
|
-
end
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
# ------------------------------------------------------------- Post API --------------------------------------------------------------------#
|
71
|
-
|
72
|
-
|
73
|
-
def emailLogin_2FA(email,password,loginurl,verificationurl,emailtemplate,smstemplate2fa)
|
74
|
-
param = {
|
75
|
-
:apikey=> appkey,
|
76
|
-
:loginurl=> loginurl,
|
77
|
-
:verificationurl => verificationurl,
|
78
|
-
:emailtemplate=> emailtemplate,
|
79
|
-
:smstemplate2fa => smstemplate2fa
|
80
|
-
}
|
81
|
-
payload = {
|
82
|
-
:email=> email,
|
83
|
-
:password => password
|
84
|
-
}
|
85
|
-
return postRequest("identity/v2/auth/login/2fa",param,payload,nil,"api");
|
86
|
-
rescue LoginRadiusRaas::Exception => e
|
87
|
-
false
|
88
|
-
end
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
def usernameLogin_2FA(username,password,loginurl,verificationurl,emailtemplate,smstemplate2fa)
|
94
|
-
param = {
|
95
|
-
:apikey=> appkey,
|
96
|
-
:loginurl=> loginurl,
|
97
|
-
:verificationurl => verificationurl,
|
98
|
-
:emailtemplate=> emailtemplate,
|
99
|
-
:smstemplate2fa => smstemplate2fa
|
100
|
-
}
|
101
|
-
payload = {
|
102
|
-
:username=> username,
|
103
|
-
:password => password
|
104
|
-
}
|
105
|
-
return postRequest("identity/v2/auth/login/2fa",param,payload,nil,"api");
|
106
|
-
rescue LoginRadiusRaas::Exception => e
|
107
|
-
false
|
108
|
-
end
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
def phoneLogin_2FA(phone,password,loginurl,verificationurl,emailtemplate,smstemplate2fa)
|
113
|
-
param = {
|
114
|
-
:apikey=> appkey,
|
115
|
-
:loginurl=> loginurl,
|
116
|
-
:verificationurl => verificationurl,
|
117
|
-
:emailtemplate=> emailtemplate,
|
118
|
-
:smstemplate2fa => smstemplate2fa
|
119
|
-
}
|
120
|
-
payload = {
|
121
|
-
:phone=> phone,
|
122
|
-
:password => password
|
123
|
-
}
|
124
|
-
return postRequest("identity/v2/auth/login/2fa",param,payload,nil,"api");
|
125
|
-
rescue LoginRadiusRaas::Exception => e
|
126
|
-
false
|
127
|
-
end
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
# ------------------------------------------------------------- Put API --------------------------------------------------------------------#
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
def updatePhoneNumber_2FA(phoneno2fa,secondfactorauthenticationtoken,smstemplate2fa)
|
137
|
-
payload = {
|
138
|
-
:phoneno2fa=> phoneno2fa
|
139
|
-
}
|
140
|
-
return putRequest("identity/v2/auth/phone",{:apikey=> appkey,:secondfactorauthenticationtoken=> secondfactorauthenticationtoken,:smstemplate2fa=> smstemplate2fa},payload,"api");
|
141
|
-
rescue LoginRadiusRaas::Exception => e
|
142
|
-
false
|
143
|
-
end
|
144
|
-
|
145
|
-
|
146
|
-
def updatePhoneNumberByToken_2FA(phoneno2fa,access_token,smstemplate2fa)
|
147
|
-
payload = {
|
148
|
-
:phoneno2fa=> phoneno2fa
|
149
|
-
}
|
150
|
-
return putRequest("identity/v2/auth/phone",{:apikey=> appkey,:access_token=> access_token,:smstemplate2fa=> smstemplate2fa},payload,"api");
|
151
|
-
rescue LoginRadiusRaas::Exception => e
|
152
|
-
false
|
153
|
-
end
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
# ------------------------------------------------------------- Delete API --------------------------------------------------------------------#
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
def resetGoogleAuthenticatorByToken_2FA(access_token,payload)
|
163
|
-
return deleteRequest("identity/v2/auth/account/2fa/authenticator",{:apikey=> appkey,:access_token=> access_token},payload);
|
164
|
-
rescue LoginRadiusRaas::Exception => e
|
165
|
-
false
|
166
|
-
end
|
167
|
-
|
168
|
-
|
169
|
-
def resetSmsAuthenticatorByToken_2FA(access_token,payload)
|
170
|
-
return deleteRequest("identity/v2/auth/account/2fa/authenticator",{:apikey=> appkey,:access_token=> access_token},payload);
|
171
|
-
rescue LoginRadiusRaas::Exception => e
|
172
|
-
false
|
173
|
-
end
|
174
|
-
|
175
|
-
|
176
|
-
def resetGoogleAuthenticatorByUid_2FA(uid,payload)
|
177
|
-
return deleteRequest("identity/v2/manage/account/2fa/authenticator",{:apikey=> appkey,:apisecret=>appsecret,:uid=> uid},payload);
|
178
|
-
rescue LoginRadiusRaas::Exception => e
|
179
|
-
false
|
180
|
-
end
|
181
|
-
|
182
|
-
def resetSmsAuthenticatorByUid_2FA(uid,payload)
|
183
|
-
return deleteRequest("identity/v2/manage/account/2fa/authenticator",{:apikey=> appkey,:apisecret=>appsecret,:uid=> uid},payload);
|
184
|
-
rescue LoginRadiusRaas::Exception => e
|
185
|
-
false
|
186
|
-
end
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
end
|
191
|
-
end
|