login_radius 11.0.0 → 11.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +19 -0
- 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 +356 -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 +8 -7
@@ -1,316 +1,316 @@
|
|
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
|
-
# CustomObjectApi module
|
9
|
-
class CustomObjectApi
|
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 write information in JSON format to the custom object for the specified account.
|
29
|
-
#
|
30
|
-
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
31
|
-
# @param object_name - LoginRadius Custom Object Name
|
32
|
-
# @param payload - LoginRadius Custom Object Name
|
33
|
-
#
|
34
|
-
# @return Response containing Definition for Complete user custom object data
|
35
|
-
# 6.1
|
36
|
-
def create_custom_object_by_token(access_token, object_name, payload)
|
37
|
-
if isNullOrWhiteSpace(access_token)
|
38
|
-
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
39
|
-
end
|
40
|
-
if isNullOrWhiteSpace(object_name)
|
41
|
-
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
42
|
-
end
|
43
|
-
if payload.blank?
|
44
|
-
raise LoginRadius::Error.new, getValidationMessage('payload')
|
45
|
-
end
|
46
|
-
|
47
|
-
query_parameters = {}
|
48
|
-
query_parameters['access_token'] = access_token
|
49
|
-
query_parameters['apiKey'] = @api_key
|
50
|
-
query_parameters['objectName'] = object_name
|
51
|
-
|
52
|
-
resource_path = 'identity/v2/auth/customobject'
|
53
|
-
post_request(resource_path, query_parameters, payload)
|
54
|
-
end
|
55
|
-
|
56
|
-
# This API is used to update the specified custom object data of the specified account. If the value of updatetype is 'replace' then it will fully replace custom object with the new custom object and if the value of updatetype is 'partialreplace' then it will perform an upsert type operation
|
57
|
-
#
|
58
|
-
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
59
|
-
# @param object_name - LoginRadius Custom Object Name
|
60
|
-
# @param object_record_id - Unique identifier of the user's record in Custom Object
|
61
|
-
# @param payload - LoginRadius Custom Object Name
|
62
|
-
# @param update_type - Possible values: replace, partialreplace.
|
63
|
-
#
|
64
|
-
# @return Response containing Definition for Complete user custom object data
|
65
|
-
# 6.2
|
66
|
-
def update_custom_object_by_token(access_token, object_name, object_record_id, payload, update_type = '')
|
67
|
-
if isNullOrWhiteSpace(access_token)
|
68
|
-
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
69
|
-
end
|
70
|
-
if isNullOrWhiteSpace(object_name)
|
71
|
-
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
72
|
-
end
|
73
|
-
if isNullOrWhiteSpace(object_record_id)
|
74
|
-
raise LoginRadius::Error.new, getValidationMessage('object_record_id')
|
75
|
-
end
|
76
|
-
if payload.blank?
|
77
|
-
raise LoginRadius::Error.new, getValidationMessage('payload')
|
78
|
-
end
|
79
|
-
|
80
|
-
query_parameters = {}
|
81
|
-
query_parameters['access_token'] = access_token
|
82
|
-
query_parameters['apiKey'] = @api_key
|
83
|
-
query_parameters['objectName'] = object_name
|
84
|
-
unless update_type == false
|
85
|
-
query_parameters['updateType'] = update_type
|
86
|
-
end
|
87
|
-
|
88
|
-
resource_path = 'identity/v2/auth/customobject/' + object_record_id
|
89
|
-
put_request(resource_path, query_parameters, payload)
|
90
|
-
end
|
91
|
-
|
92
|
-
# This API is used to retrieve the specified Custom Object data for the specified account.
|
93
|
-
#
|
94
|
-
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
95
|
-
# @param object_name - LoginRadius Custom Object Name
|
96
|
-
#
|
97
|
-
# @return Complete user CustomObject data
|
98
|
-
# 6.3
|
99
|
-
def get_custom_object_by_token(access_token, object_name)
|
100
|
-
if isNullOrWhiteSpace(access_token)
|
101
|
-
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
102
|
-
end
|
103
|
-
if isNullOrWhiteSpace(object_name)
|
104
|
-
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
105
|
-
end
|
106
|
-
|
107
|
-
query_parameters = {}
|
108
|
-
query_parameters['access_token'] = access_token
|
109
|
-
query_parameters['apiKey'] = @api_key
|
110
|
-
query_parameters['objectName'] = object_name
|
111
|
-
|
112
|
-
resource_path = 'identity/v2/auth/customobject'
|
113
|
-
get_request(resource_path, query_parameters,
|
114
|
-
end
|
115
|
-
|
116
|
-
# This API is used to retrieve the Custom Object data for the specified account.
|
117
|
-
#
|
118
|
-
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
119
|
-
# @param object_name - LoginRadius Custom Object Name
|
120
|
-
# @param object_record_id - Unique identifier of the user's record in Custom Object
|
121
|
-
#
|
122
|
-
# @return Response containing Definition for Complete user custom object data
|
123
|
-
# 6.4
|
124
|
-
def get_custom_object_by_record_id_and_token(access_token, object_name, object_record_id)
|
125
|
-
if isNullOrWhiteSpace(access_token)
|
126
|
-
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
127
|
-
end
|
128
|
-
if isNullOrWhiteSpace(object_name)
|
129
|
-
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
130
|
-
end
|
131
|
-
if isNullOrWhiteSpace(object_record_id)
|
132
|
-
raise LoginRadius::Error.new, getValidationMessage('object_record_id')
|
133
|
-
end
|
134
|
-
|
135
|
-
query_parameters = {}
|
136
|
-
query_parameters['access_token'] = access_token
|
137
|
-
query_parameters['apiKey'] = @api_key
|
138
|
-
query_parameters['objectName'] = object_name
|
139
|
-
|
140
|
-
resource_path = 'identity/v2/auth/customobject/' + object_record_id
|
141
|
-
get_request(resource_path, query_parameters,
|
142
|
-
end
|
143
|
-
|
144
|
-
# This API is used to remove the specified Custom Object data using ObjectRecordId of a specified account.
|
145
|
-
#
|
146
|
-
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
147
|
-
# @param object_name - LoginRadius Custom Object Name
|
148
|
-
# @param object_record_id - Unique identifier of the user's record in Custom Object
|
149
|
-
#
|
150
|
-
# @return Response containing Definition of Delete Request
|
151
|
-
# 6.5
|
152
|
-
def delete_custom_object_by_token(access_token, object_name, object_record_id)
|
153
|
-
if isNullOrWhiteSpace(access_token)
|
154
|
-
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
155
|
-
end
|
156
|
-
if isNullOrWhiteSpace(object_name)
|
157
|
-
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
158
|
-
end
|
159
|
-
if isNullOrWhiteSpace(object_record_id)
|
160
|
-
raise LoginRadius::Error.new, getValidationMessage('object_record_id')
|
161
|
-
end
|
162
|
-
|
163
|
-
query_parameters = {}
|
164
|
-
query_parameters['access_token'] = access_token
|
165
|
-
query_parameters['apiKey'] = @api_key
|
166
|
-
query_parameters['objectName'] = object_name
|
167
|
-
|
168
|
-
resource_path = 'identity/v2/auth/customobject/' + object_record_id
|
169
|
-
delete_request(resource_path, query_parameters,
|
170
|
-
end
|
171
|
-
|
172
|
-
# This API is used to write information in JSON format to the custom object for the specified account.
|
173
|
-
#
|
174
|
-
# @param object_name - LoginRadius Custom Object Name
|
175
|
-
# @param payload - LoginRadius Custom Object Name
|
176
|
-
# @param uid - UID, the unified identifier for each user account
|
177
|
-
#
|
178
|
-
# @return Response containing Definition for Complete user custom object data
|
179
|
-
# 19.1
|
180
|
-
def create_custom_object_by_uid(object_name, payload, uid)
|
181
|
-
if isNullOrWhiteSpace(object_name)
|
182
|
-
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
183
|
-
end
|
184
|
-
if payload.blank?
|
185
|
-
raise LoginRadius::Error.new, getValidationMessage('payload')
|
186
|
-
end
|
187
|
-
if isNullOrWhiteSpace(uid)
|
188
|
-
raise LoginRadius::Error.new, getValidationMessage('uid')
|
189
|
-
end
|
190
|
-
|
191
|
-
query_parameters = {}
|
192
|
-
query_parameters['apiKey'] = @api_key
|
193
|
-
query_parameters['apiSecret'] = @api_secret
|
194
|
-
query_parameters['objectName'] = object_name
|
195
|
-
|
196
|
-
resource_path = 'identity/v2/manage/account/' + uid + '/customobject'
|
197
|
-
post_request(resource_path, query_parameters, payload)
|
198
|
-
end
|
199
|
-
|
200
|
-
# This API is used to update the specified custom object data of a specified account. If the value of updatetype is 'replace' then it will fully replace custom object with new custom object and if the value of updatetype is partialreplace then it will perform an upsert type operation.
|
201
|
-
#
|
202
|
-
# @param object_name - LoginRadius Custom Object Name
|
203
|
-
# @param object_record_id - Unique identifier of the user's record in Custom Object
|
204
|
-
# @param payload - LoginRadius Custom Object Name
|
205
|
-
# @param uid - UID, the unified identifier for each user account
|
206
|
-
# @param update_type - Possible values: replace, partialreplace.
|
207
|
-
#
|
208
|
-
# @return Response containing Definition for Complete user custom object data
|
209
|
-
# 19.2
|
210
|
-
def update_custom_object_by_uid(object_name, object_record_id, payload, uid, update_type = '')
|
211
|
-
if isNullOrWhiteSpace(object_name)
|
212
|
-
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
213
|
-
end
|
214
|
-
if isNullOrWhiteSpace(object_record_id)
|
215
|
-
raise LoginRadius::Error.new, getValidationMessage('object_record_id')
|
216
|
-
end
|
217
|
-
if payload.blank?
|
218
|
-
raise LoginRadius::Error.new, getValidationMessage('payload')
|
219
|
-
end
|
220
|
-
if isNullOrWhiteSpace(uid)
|
221
|
-
raise LoginRadius::Error.new, getValidationMessage('uid')
|
222
|
-
end
|
223
|
-
|
224
|
-
query_parameters = {}
|
225
|
-
query_parameters['apiKey'] = @api_key
|
226
|
-
query_parameters['apiSecret'] = @api_secret
|
227
|
-
query_parameters['objectName'] = object_name
|
228
|
-
unless update_type == false
|
229
|
-
query_parameters['updateType'] = update_type
|
230
|
-
end
|
231
|
-
|
232
|
-
resource_path = 'identity/v2/manage/account/' + uid + '/customobject/' + object_record_id
|
233
|
-
put_request(resource_path, query_parameters, payload)
|
234
|
-
end
|
235
|
-
|
236
|
-
# This API is used to retrieve all the custom objects by UID from cloud storage.
|
237
|
-
#
|
238
|
-
# @param object_name - LoginRadius Custom Object Name
|
239
|
-
# @param uid - UID, the unified identifier for each user account
|
240
|
-
#
|
241
|
-
# @return Complete user CustomObject data
|
242
|
-
# 19.3
|
243
|
-
def get_custom_object_by_uid(object_name, uid)
|
244
|
-
if isNullOrWhiteSpace(object_name)
|
245
|
-
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
246
|
-
end
|
247
|
-
if isNullOrWhiteSpace(uid)
|
248
|
-
raise LoginRadius::Error.new, getValidationMessage('uid')
|
249
|
-
end
|
250
|
-
|
251
|
-
query_parameters = {}
|
252
|
-
query_parameters['apiKey'] = @api_key
|
253
|
-
query_parameters['apiSecret'] = @api_secret
|
254
|
-
query_parameters['objectName'] = object_name
|
255
|
-
|
256
|
-
resource_path = 'identity/v2/manage/account/' + uid + '/customobject'
|
257
|
-
get_request(resource_path, query_parameters,
|
258
|
-
end
|
259
|
-
|
260
|
-
# This API is used to retrieve the Custom Object data for the specified account.
|
261
|
-
#
|
262
|
-
# @param object_name - LoginRadius Custom Object Name
|
263
|
-
# @param object_record_id - Unique identifier of the user's record in Custom Object
|
264
|
-
# @param uid - UID, the unified identifier for each user account
|
265
|
-
#
|
266
|
-
# @return Response containing Definition for Complete user custom object data
|
267
|
-
# 19.4
|
268
|
-
def get_custom_object_by_record_id(object_name, object_record_id, uid)
|
269
|
-
if isNullOrWhiteSpace(object_name)
|
270
|
-
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
271
|
-
end
|
272
|
-
if isNullOrWhiteSpace(object_record_id)
|
273
|
-
raise LoginRadius::Error.new, getValidationMessage('object_record_id')
|
274
|
-
end
|
275
|
-
if isNullOrWhiteSpace(uid)
|
276
|
-
raise LoginRadius::Error.new, getValidationMessage('uid')
|
277
|
-
end
|
278
|
-
|
279
|
-
query_parameters = {}
|
280
|
-
query_parameters['apiKey'] = @api_key
|
281
|
-
query_parameters['apiSecret'] = @api_secret
|
282
|
-
query_parameters['objectName'] = object_name
|
283
|
-
|
284
|
-
resource_path = 'identity/v2/manage/account/' + uid + '/customobject/' + object_record_id
|
285
|
-
get_request(resource_path, query_parameters,
|
286
|
-
end
|
287
|
-
|
288
|
-
# This API is used to remove the specified Custom Object data using ObjectRecordId of specified account.
|
289
|
-
#
|
290
|
-
# @param object_name - LoginRadius Custom Object Name
|
291
|
-
# @param object_record_id - Unique identifier of the user's record in Custom Object
|
292
|
-
# @param uid - UID, the unified identifier for each user account
|
293
|
-
#
|
294
|
-
# @return Response containing Definition of Delete Request
|
295
|
-
# 19.5
|
296
|
-
def delete_custom_object_by_record_id(object_name, object_record_id, uid)
|
297
|
-
if isNullOrWhiteSpace(object_name)
|
298
|
-
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
299
|
-
end
|
300
|
-
if isNullOrWhiteSpace(object_record_id)
|
301
|
-
raise LoginRadius::Error.new, getValidationMessage('object_record_id')
|
302
|
-
end
|
303
|
-
if isNullOrWhiteSpace(uid)
|
304
|
-
raise LoginRadius::Error.new, getValidationMessage('uid')
|
305
|
-
end
|
306
|
-
|
307
|
-
query_parameters = {}
|
308
|
-
query_parameters['apiKey'] = @api_key
|
309
|
-
query_parameters['apiSecret'] = @api_secret
|
310
|
-
query_parameters['objectName'] = object_name
|
311
|
-
|
312
|
-
resource_path = 'identity/v2/manage/account/' + uid + '/customobject/' + object_record_id
|
313
|
-
delete_request(resource_path, query_parameters,
|
314
|
-
end
|
315
|
-
end
|
316
|
-
end
|
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
|
+
# CustomObjectApi module
|
9
|
+
class CustomObjectApi
|
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 write information in JSON format to the custom object for the specified account.
|
29
|
+
#
|
30
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
31
|
+
# @param object_name - LoginRadius Custom Object Name
|
32
|
+
# @param payload - LoginRadius Custom Object Name
|
33
|
+
#
|
34
|
+
# @return Response containing Definition for Complete user custom object data
|
35
|
+
# 6.1
|
36
|
+
def create_custom_object_by_token(access_token, object_name, payload)
|
37
|
+
if isNullOrWhiteSpace(access_token)
|
38
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
39
|
+
end
|
40
|
+
if isNullOrWhiteSpace(object_name)
|
41
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
42
|
+
end
|
43
|
+
if payload.blank?
|
44
|
+
raise LoginRadius::Error.new, getValidationMessage('payload')
|
45
|
+
end
|
46
|
+
|
47
|
+
query_parameters = {}
|
48
|
+
query_parameters['access_token'] = access_token
|
49
|
+
query_parameters['apiKey'] = @api_key
|
50
|
+
query_parameters['objectName'] = object_name
|
51
|
+
|
52
|
+
resource_path = 'identity/v2/auth/customobject'
|
53
|
+
post_request(resource_path, query_parameters, payload)
|
54
|
+
end
|
55
|
+
|
56
|
+
# This API is used to update the specified custom object data of the specified account. If the value of updatetype is 'replace' then it will fully replace custom object with the new custom object and if the value of updatetype is 'partialreplace' then it will perform an upsert type operation
|
57
|
+
#
|
58
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
59
|
+
# @param object_name - LoginRadius Custom Object Name
|
60
|
+
# @param object_record_id - Unique identifier of the user's record in Custom Object
|
61
|
+
# @param payload - LoginRadius Custom Object Name
|
62
|
+
# @param update_type - Possible values: replace, partialreplace.
|
63
|
+
#
|
64
|
+
# @return Response containing Definition for Complete user custom object data
|
65
|
+
# 6.2
|
66
|
+
def update_custom_object_by_token(access_token, object_name, object_record_id, payload, update_type = '')
|
67
|
+
if isNullOrWhiteSpace(access_token)
|
68
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
69
|
+
end
|
70
|
+
if isNullOrWhiteSpace(object_name)
|
71
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
72
|
+
end
|
73
|
+
if isNullOrWhiteSpace(object_record_id)
|
74
|
+
raise LoginRadius::Error.new, getValidationMessage('object_record_id')
|
75
|
+
end
|
76
|
+
if payload.blank?
|
77
|
+
raise LoginRadius::Error.new, getValidationMessage('payload')
|
78
|
+
end
|
79
|
+
|
80
|
+
query_parameters = {}
|
81
|
+
query_parameters['access_token'] = access_token
|
82
|
+
query_parameters['apiKey'] = @api_key
|
83
|
+
query_parameters['objectName'] = object_name
|
84
|
+
unless update_type == false
|
85
|
+
query_parameters['updateType'] = update_type
|
86
|
+
end
|
87
|
+
|
88
|
+
resource_path = 'identity/v2/auth/customobject/' + object_record_id
|
89
|
+
put_request(resource_path, query_parameters, payload)
|
90
|
+
end
|
91
|
+
|
92
|
+
# This API is used to retrieve the specified Custom Object data for the specified account.
|
93
|
+
#
|
94
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
95
|
+
# @param object_name - LoginRadius Custom Object Name
|
96
|
+
#
|
97
|
+
# @return Complete user CustomObject data
|
98
|
+
# 6.3
|
99
|
+
def get_custom_object_by_token(access_token, object_name)
|
100
|
+
if isNullOrWhiteSpace(access_token)
|
101
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
102
|
+
end
|
103
|
+
if isNullOrWhiteSpace(object_name)
|
104
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
105
|
+
end
|
106
|
+
|
107
|
+
query_parameters = {}
|
108
|
+
query_parameters['access_token'] = access_token
|
109
|
+
query_parameters['apiKey'] = @api_key
|
110
|
+
query_parameters['objectName'] = object_name
|
111
|
+
|
112
|
+
resource_path = 'identity/v2/auth/customobject'
|
113
|
+
get_request(resource_path, query_parameters, {})
|
114
|
+
end
|
115
|
+
|
116
|
+
# This API is used to retrieve the Custom Object data for the specified account.
|
117
|
+
#
|
118
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
119
|
+
# @param object_name - LoginRadius Custom Object Name
|
120
|
+
# @param object_record_id - Unique identifier of the user's record in Custom Object
|
121
|
+
#
|
122
|
+
# @return Response containing Definition for Complete user custom object data
|
123
|
+
# 6.4
|
124
|
+
def get_custom_object_by_record_id_and_token(access_token, object_name, object_record_id)
|
125
|
+
if isNullOrWhiteSpace(access_token)
|
126
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
127
|
+
end
|
128
|
+
if isNullOrWhiteSpace(object_name)
|
129
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
130
|
+
end
|
131
|
+
if isNullOrWhiteSpace(object_record_id)
|
132
|
+
raise LoginRadius::Error.new, getValidationMessage('object_record_id')
|
133
|
+
end
|
134
|
+
|
135
|
+
query_parameters = {}
|
136
|
+
query_parameters['access_token'] = access_token
|
137
|
+
query_parameters['apiKey'] = @api_key
|
138
|
+
query_parameters['objectName'] = object_name
|
139
|
+
|
140
|
+
resource_path = 'identity/v2/auth/customobject/' + object_record_id
|
141
|
+
get_request(resource_path, query_parameters, {})
|
142
|
+
end
|
143
|
+
|
144
|
+
# This API is used to remove the specified Custom Object data using ObjectRecordId of a specified account.
|
145
|
+
#
|
146
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
147
|
+
# @param object_name - LoginRadius Custom Object Name
|
148
|
+
# @param object_record_id - Unique identifier of the user's record in Custom Object
|
149
|
+
#
|
150
|
+
# @return Response containing Definition of Delete Request
|
151
|
+
# 6.5
|
152
|
+
def delete_custom_object_by_token(access_token, object_name, object_record_id)
|
153
|
+
if isNullOrWhiteSpace(access_token)
|
154
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
155
|
+
end
|
156
|
+
if isNullOrWhiteSpace(object_name)
|
157
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
158
|
+
end
|
159
|
+
if isNullOrWhiteSpace(object_record_id)
|
160
|
+
raise LoginRadius::Error.new, getValidationMessage('object_record_id')
|
161
|
+
end
|
162
|
+
|
163
|
+
query_parameters = {}
|
164
|
+
query_parameters['access_token'] = access_token
|
165
|
+
query_parameters['apiKey'] = @api_key
|
166
|
+
query_parameters['objectName'] = object_name
|
167
|
+
|
168
|
+
resource_path = 'identity/v2/auth/customobject/' + object_record_id
|
169
|
+
delete_request(resource_path, query_parameters, {})
|
170
|
+
end
|
171
|
+
|
172
|
+
# This API is used to write information in JSON format to the custom object for the specified account.
|
173
|
+
#
|
174
|
+
# @param object_name - LoginRadius Custom Object Name
|
175
|
+
# @param payload - LoginRadius Custom Object Name
|
176
|
+
# @param uid - UID, the unified identifier for each user account
|
177
|
+
#
|
178
|
+
# @return Response containing Definition for Complete user custom object data
|
179
|
+
# 19.1
|
180
|
+
def create_custom_object_by_uid(object_name, payload, uid)
|
181
|
+
if isNullOrWhiteSpace(object_name)
|
182
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
183
|
+
end
|
184
|
+
if payload.blank?
|
185
|
+
raise LoginRadius::Error.new, getValidationMessage('payload')
|
186
|
+
end
|
187
|
+
if isNullOrWhiteSpace(uid)
|
188
|
+
raise LoginRadius::Error.new, getValidationMessage('uid')
|
189
|
+
end
|
190
|
+
|
191
|
+
query_parameters = {}
|
192
|
+
query_parameters['apiKey'] = @api_key
|
193
|
+
query_parameters['apiSecret'] = @api_secret
|
194
|
+
query_parameters['objectName'] = object_name
|
195
|
+
|
196
|
+
resource_path = 'identity/v2/manage/account/' + uid + '/customobject'
|
197
|
+
post_request(resource_path, query_parameters, payload)
|
198
|
+
end
|
199
|
+
|
200
|
+
# This API is used to update the specified custom object data of a specified account. If the value of updatetype is 'replace' then it will fully replace custom object with new custom object and if the value of updatetype is partialreplace then it will perform an upsert type operation.
|
201
|
+
#
|
202
|
+
# @param object_name - LoginRadius Custom Object Name
|
203
|
+
# @param object_record_id - Unique identifier of the user's record in Custom Object
|
204
|
+
# @param payload - LoginRadius Custom Object Name
|
205
|
+
# @param uid - UID, the unified identifier for each user account
|
206
|
+
# @param update_type - Possible values: replace, partialreplace.
|
207
|
+
#
|
208
|
+
# @return Response containing Definition for Complete user custom object data
|
209
|
+
# 19.2
|
210
|
+
def update_custom_object_by_uid(object_name, object_record_id, payload, uid, update_type = '')
|
211
|
+
if isNullOrWhiteSpace(object_name)
|
212
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
213
|
+
end
|
214
|
+
if isNullOrWhiteSpace(object_record_id)
|
215
|
+
raise LoginRadius::Error.new, getValidationMessage('object_record_id')
|
216
|
+
end
|
217
|
+
if payload.blank?
|
218
|
+
raise LoginRadius::Error.new, getValidationMessage('payload')
|
219
|
+
end
|
220
|
+
if isNullOrWhiteSpace(uid)
|
221
|
+
raise LoginRadius::Error.new, getValidationMessage('uid')
|
222
|
+
end
|
223
|
+
|
224
|
+
query_parameters = {}
|
225
|
+
query_parameters['apiKey'] = @api_key
|
226
|
+
query_parameters['apiSecret'] = @api_secret
|
227
|
+
query_parameters['objectName'] = object_name
|
228
|
+
unless update_type == false
|
229
|
+
query_parameters['updateType'] = update_type
|
230
|
+
end
|
231
|
+
|
232
|
+
resource_path = 'identity/v2/manage/account/' + uid + '/customobject/' + object_record_id
|
233
|
+
put_request(resource_path, query_parameters, payload)
|
234
|
+
end
|
235
|
+
|
236
|
+
# This API is used to retrieve all the custom objects by UID from cloud storage.
|
237
|
+
#
|
238
|
+
# @param object_name - LoginRadius Custom Object Name
|
239
|
+
# @param uid - UID, the unified identifier for each user account
|
240
|
+
#
|
241
|
+
# @return Complete user CustomObject data
|
242
|
+
# 19.3
|
243
|
+
def get_custom_object_by_uid(object_name, uid)
|
244
|
+
if isNullOrWhiteSpace(object_name)
|
245
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
246
|
+
end
|
247
|
+
if isNullOrWhiteSpace(uid)
|
248
|
+
raise LoginRadius::Error.new, getValidationMessage('uid')
|
249
|
+
end
|
250
|
+
|
251
|
+
query_parameters = {}
|
252
|
+
query_parameters['apiKey'] = @api_key
|
253
|
+
query_parameters['apiSecret'] = @api_secret
|
254
|
+
query_parameters['objectName'] = object_name
|
255
|
+
|
256
|
+
resource_path = 'identity/v2/manage/account/' + uid + '/customobject'
|
257
|
+
get_request(resource_path, query_parameters, {})
|
258
|
+
end
|
259
|
+
|
260
|
+
# This API is used to retrieve the Custom Object data for the specified account.
|
261
|
+
#
|
262
|
+
# @param object_name - LoginRadius Custom Object Name
|
263
|
+
# @param object_record_id - Unique identifier of the user's record in Custom Object
|
264
|
+
# @param uid - UID, the unified identifier for each user account
|
265
|
+
#
|
266
|
+
# @return Response containing Definition for Complete user custom object data
|
267
|
+
# 19.4
|
268
|
+
def get_custom_object_by_record_id(object_name, object_record_id, uid)
|
269
|
+
if isNullOrWhiteSpace(object_name)
|
270
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
271
|
+
end
|
272
|
+
if isNullOrWhiteSpace(object_record_id)
|
273
|
+
raise LoginRadius::Error.new, getValidationMessage('object_record_id')
|
274
|
+
end
|
275
|
+
if isNullOrWhiteSpace(uid)
|
276
|
+
raise LoginRadius::Error.new, getValidationMessage('uid')
|
277
|
+
end
|
278
|
+
|
279
|
+
query_parameters = {}
|
280
|
+
query_parameters['apiKey'] = @api_key
|
281
|
+
query_parameters['apiSecret'] = @api_secret
|
282
|
+
query_parameters['objectName'] = object_name
|
283
|
+
|
284
|
+
resource_path = 'identity/v2/manage/account/' + uid + '/customobject/' + object_record_id
|
285
|
+
get_request(resource_path, query_parameters, {})
|
286
|
+
end
|
287
|
+
|
288
|
+
# This API is used to remove the specified Custom Object data using ObjectRecordId of specified account.
|
289
|
+
#
|
290
|
+
# @param object_name - LoginRadius Custom Object Name
|
291
|
+
# @param object_record_id - Unique identifier of the user's record in Custom Object
|
292
|
+
# @param uid - UID, the unified identifier for each user account
|
293
|
+
#
|
294
|
+
# @return Response containing Definition of Delete Request
|
295
|
+
# 19.5
|
296
|
+
def delete_custom_object_by_record_id(object_name, object_record_id, uid)
|
297
|
+
if isNullOrWhiteSpace(object_name)
|
298
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
299
|
+
end
|
300
|
+
if isNullOrWhiteSpace(object_record_id)
|
301
|
+
raise LoginRadius::Error.new, getValidationMessage('object_record_id')
|
302
|
+
end
|
303
|
+
if isNullOrWhiteSpace(uid)
|
304
|
+
raise LoginRadius::Error.new, getValidationMessage('uid')
|
305
|
+
end
|
306
|
+
|
307
|
+
query_parameters = {}
|
308
|
+
query_parameters['apiKey'] = @api_key
|
309
|
+
query_parameters['apiSecret'] = @api_secret
|
310
|
+
query_parameters['objectName'] = object_name
|
311
|
+
|
312
|
+
resource_path = 'identity/v2/manage/account/' + uid + '/customobject/' + object_record_id
|
313
|
+
delete_request(resource_path, query_parameters, {})
|
314
|
+
end
|
315
|
+
end
|
316
|
+
end
|