login_radius 2.0.0 → 11.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +5 -5
  2. data/LICENSE.txt +21 -0
  3. data/README.md +58 -52
  4. data/lib/login_radius.rb +30 -13
  5. data/lib/login_radius/api/account/account_api.rb +581 -0
  6. data/lib/login_radius/api/account/role_api.rb +330 -0
  7. data/lib/login_radius/api/account/sott_api.rb +47 -0
  8. data/lib/login_radius/api/advanced/configuration_api.rb +57 -0
  9. data/lib/login_radius/api/advanced/consent_management_api.rb +161 -0
  10. data/lib/login_radius/api/advanced/custom_object_api.rb +316 -0
  11. data/lib/login_radius/api/advanced/custom_registration_data_api.rb +195 -0
  12. data/lib/login_radius/api/advanced/multi_factor_authentication_api.rb +606 -0
  13. data/lib/login_radius/api/advanced/re_authentication_api.rb +243 -0
  14. data/lib/login_radius/api/advanced/web_hook_api.rb +101 -0
  15. data/lib/login_radius/api/authentication/authentication_api.rb +989 -0
  16. data/lib/login_radius/api/authentication/one_touch_login_api.rb +160 -0
  17. data/lib/login_radius/api/authentication/password_less_login_api.rb +158 -0
  18. data/lib/login_radius/api/authentication/phone_authentication_api.rb +329 -0
  19. data/lib/login_radius/api/authentication/pin_authentication_api.rb +316 -0
  20. data/lib/login_radius/api/authentication/risk_based_authentication_api.rb +286 -0
  21. data/lib/login_radius/api/authentication/smart_login_api.rb +146 -0
  22. data/lib/login_radius/api/social/native_social_api.rb +255 -0
  23. data/lib/login_radius/api/social/social_api.rb +806 -0
  24. data/lib/login_radius/error.rb +7 -0
  25. data/lib/login_radius/request_client.rb +295 -0
  26. data/lib/login_radius/response.rb +12 -0
  27. data/lib/login_radius/version.rb +3 -3
  28. data/login_radius.gemspec +28 -0
  29. metadata +60 -19
  30. data/LICENSE +0 -22
  31. data/lib/hash.rb +0 -12
  32. data/lib/login_radius/account_api.rb +0 -130
  33. data/lib/login_radius/basic_api.rb +0 -389
  34. data/lib/login_radius/custom_object_api.rb +0 -347
  35. data/lib/login_radius/exception.rb +0 -4
  36. data/lib/login_radius/raas_api.rb +0 -102
  37. data/lib/login_radius/user_api.rb +0 -283
  38. data/lib/string.rb +0 -8
@@ -1,283 +0,0 @@
1
- module LoginRadiusRaas
2
- module UserApi
3
- #
4
- # This API is used to create a new user on your site. This API bypasses the normal email verification process and manually creates the user for your system.
5
- #
6
- # params = {:emailid => "example@example.com",
7
- # :password => "FakePass",
8
- # :firstname => "Joe",
9
- # :lastname => "Smith",
10
- # :gender => "M",
11
- # :birthdate => "11-08-1987",
12
- # :Country => "USA",
13
- # :city => "Chicago",
14
- # :state => "Illinois ",
15
- # :phonenumber => "1232333232",
16
- # :address1 => "23/43, II Street",
17
- # :address2 => "Near Paris garden",
18
- # :company => "Orange Inc.",
19
- # :postalcode => "43435",
20
- # :emailsubscription => "true",
21
- # :customfields => {
22
- # :example_field1 => "some data 1",
23
- # :example_field2 => "some data 2",
24
- # :example_field3 => "some data 3"
25
- # }
26
- # }
27
- #
28
- # return all user profile
29
- #
30
- def user_create_profile!(params)
31
- api_client("raas/v1/user", {}, params, 'json');
32
- end
33
-
34
- def user_create_profile(params={})
35
- user_create_profile!(params)
36
- rescue LoginRadiusRaas::Exception => e
37
- false
38
- end
39
-
40
- #
41
- # This API used to register user from server side, verification email will be send to provided email address
42
- #
43
- # params = {"emailid => "example@example.com",
44
- # :password => "FakePass",
45
- # :firstname => "Joe",
46
- # :lastname => "Smith",
47
- # :gender => "M",
48
- # :birthdate => "11-08-1987",
49
- # :Country => "USA",
50
- # :city => "Chicago",
51
- # :state => "Illinois ",
52
- # :phonenumber => "1232333232",
53
- # :address1 => "23/43, II Street",
54
- # :address2 => "Near Paris garden",
55
- # :company => "Orange Inc.",
56
- # :postalcode => "43435",
57
- # :emailsubscription => "true",
58
- # :customfields => {
59
- # :example_field1 => "some data 1",
60
- # :example_field2 => "some data 2",
61
- # :example_field3 => "some data 3"
62
- # },
63
- # :EmailVerificationUrl => "http://yoursite.com/verifyemail"
64
- # }
65
- #
66
- # return "isPosted": "true"
67
- #
68
- def user_registration!(params)
69
- api_client("raas/v1/user/register", {}, params, 'json');
70
- end
71
-
72
- def user_registration(params)
73
- user_registration!(params)
74
- rescue LoginRadiusRaas::Exception => e
75
- false
76
- end
77
-
78
- #
79
- # This API is used to Modify/Update details of an existing user.
80
- #
81
- # params = {
82
- # :firstname => 'first name',
83
- # :lastname => 'last name',
84
- # :gender => 'm',
85
- # :birthdate => 'MM-DD-YYYY',
86
- # ....................
87
- # ....................
88
- # }
89
- #
90
- # return {“isPosted”: “true”}
91
- #
92
- def user_edit_profile!(userId, params)
93
- api_client("raas/v1/user", {:userid => userId}, params, 'json');
94
- end
95
-
96
- def user_edit_profile(userId, params={})
97
- user_edit_profile!(userId, params)
98
- rescue LoginRadiusRaas::Exception => e
99
- false
100
- end
101
-
102
- #
103
- # This API is used to check email of an existing user.
104
- #
105
- # email = example@provider.com
106
- #
107
- # return {“isExist”: “true”}
108
- #
109
-
110
- def check_email!(email)
111
- api_client("raas/client/auth/checkEmail", {:email => email});
112
- end
113
-
114
- def check_email(email)
115
- check_email!(email)
116
- rescue LoginRadiusRaas::Exception => e
117
- false
118
- end
119
-
120
- #
121
- # This API is used to get token for forgot password of an existing user.
122
- #
123
- # email = example@provider.com
124
- #
125
- # return object of token and provider list
126
- #
127
-
128
- def user_forgot_password_token!(email)
129
- api_client("raas/v1/user", {:email => email});
130
- end
131
-
132
- def user_forgot_password_token(email)
133
- user_forgot_password_token!(email)
134
- rescue LoginRadiusRaas::Exception => e
135
- false
136
- end
137
-
138
- #
139
- # This API deletes the RaaS account of the user and allowing them to begin the registration process
140
- #
141
- # return [{"isPosted": "true"}]
142
- #
143
- def user_delete!(uid)
144
- api_client("raas/v1/user/delete", {:UID => uid});
145
- end
146
-
147
- def user_delete(uid)
148
- user_delete!(uid)
149
- rescue LoginRadiusRaas::Exception => e
150
- false
151
- end
152
-
153
- #
154
- # This API is used to create a user using the currently logged in social provider.
155
- #
156
- # params = {
157
- # :accountid => uid,
158
- # :password => 'xxxxxxxxxx',
159
- # :emailid => 'example@doamin.com'
160
- # }
161
- #
162
- # return {“isPosted”: “true”}
163
- #
164
- def user_set_password!(params)
165
- api_client("raas/v1/account/profile", {}, params, 'json');
166
- end
167
-
168
- def user_set_password(params={})
169
- user_set_password!(params)
170
- rescue LoginRadiusRaas::Exception => e
171
- false
172
- end
173
-
174
- #
175
- # This API is used to Update/Change the user’s password.
176
- #
177
- # userId => 'xxxxxxxxxx';
178
- # oldpassword => 'xxxxxxxxxx';
179
- # newpassword => 'xxxxxxxxxx';
180
- #
181
- # return {“isPosted”: “true”}
182
- #
183
- def user_change_password!(uid, oldPassword, newPassword)
184
- data = {:oldpassword => oldPassword, :newpassword => newPassword}
185
- api_client("raas/v1/account/password", {:accountid => uid}, data)
186
- end
187
-
188
- def user_change_password(uid, oldPassword, newPassword)
189
- user_change_password!(uid, oldPassword, newPassword)
190
- rescue LoginRadiusRaas::Exception => e
191
- false
192
- end
193
-
194
- #
195
- # This API is used to set the password of user, used in admin section.
196
- #
197
- # userId = 'xxxxxx'; // RaaS account ID only not Social Account ID
198
- # password = 'xxxxxxxxxx';
199
- # return {“isPosted”: “true”}
200
- #
201
- def user_set_password_by_admin!(userId, password)
202
- parameter = {:userid => userId, :action => 'set'}
203
- api_client('raas/v1/user/password', parameter, {:password => password});
204
- end
205
-
206
- def user_set_password_by_admin(userId, password)
207
- user_set_password_by_admin!(userId, password)
208
- rescue LoginRadiusRaas::Exception => e
209
- false
210
- end
211
-
212
- #
213
- # This API is used to authenticate users and returns the profile data associated with the authenticated user.
214
- #
215
- # username = 'username';//email id
216
- # password = 'xxxxxxxxxx';
217
- #
218
- # return all user profile
219
- #
220
- def user_authentication!(username, password)
221
- api_client('raas/v1/user', {:username => username, :password => password});
222
- end
223
-
224
- def user_authentication(username, password)
225
- user_authentication!(username, password)
226
- rescue LoginRadiusRaas::Exception => e
227
- false
228
- end
229
-
230
- #
231
- # This API retrieves the profile data associated with the specific user using the users unique UserID
232
- #
233
- # userId = 'xxxxxxxxxx';
234
- #
235
- # return all user profile
236
- #
237
- def user_get_profile_by_id!(userId)
238
- api_client('raas/v1/user', {:userid => userId});
239
- end
240
-
241
- def user_get_profile_by_id(userId)
242
- user_get_profile_by_id!(userId)
243
- rescue LoginRadiusRaas::Exception => e
244
- false
245
- end
246
-
247
- #
248
- # This API retrieves the profile data associated with the specific user using the users unique Email Address
249
- #
250
- # email = 'xxxxxxxxxx@xxxxxxxx.xxx';
251
- #
252
- # return all user profile
253
- #
254
- def user_get_profile_by_email!(email)
255
- api_client('raas/v1/user', {:emailid => email});
256
- end
257
-
258
- def user_get_profile_by_email(email)
259
- user_get_profile_by_email!(email)
260
- rescue LoginRadiusRaas::Exception => e
261
- false
262
- end
263
-
264
- #
265
- # This API is used to block or un-block a user using the users unique UserID (UID).
266
- #
267
- # uid = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
268
- # action = true/false(boolean)
269
- #
270
- # return all user profile
271
- #/
272
- def user_set_status!(uid, action)
273
- api_client('raas/v1/user/status', {:accountid => uid}, {:isblock => action});
274
- end
275
-
276
- def user_set_status(uid, action = true)
277
- user_set_status!(uid, action)
278
- rescue LoginRadiusRaas::Exception => e
279
- false
280
- end
281
-
282
- end
283
- end
@@ -1,8 +0,0 @@
1
- class String
2
- def lr_underscore #lr_ appended so no method naming conflicts with other gems
3
- self.gsub(/::/, '/').
4
- gsub(/([A-Z]+)([A-Z][a-z])/,'\1 \2').
5
- gsub(/([a-z\d])([A-Z])/,'\1 \2').
6
- downcase
7
- end
8
- end