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,101 +1,101 @@
|
|
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
|
-
# WebHookApi module
|
9
|
-
class WebHookApi
|
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 fatch all the subscribed URLs, for particular event
|
29
|
-
#
|
30
|
-
# @param event - Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject
|
31
|
-
#
|
32
|
-
# @return Response Containing List of Webhhook Data
|
33
|
-
# 40.1
|
34
|
-
def get_web_hook_subscribed_u_r_ls(event)
|
35
|
-
if isNullOrWhiteSpace(event)
|
36
|
-
raise LoginRadius::Error.new, getValidationMessage('event')
|
37
|
-
end
|
38
|
-
|
39
|
-
query_parameters = {}
|
40
|
-
query_parameters['apikey'] = @api_key
|
41
|
-
query_parameters['apisecret'] = @api_secret
|
42
|
-
query_parameters['event'] = event
|
43
|
-
|
44
|
-
resource_path = 'api/v2/webhook'
|
45
|
-
get_request(resource_path, query_parameters,
|
46
|
-
end
|
47
|
-
|
48
|
-
# API can be used to configure a WebHook on your LoginRadius site. Webhooks also work on subscribe and notification model, subscribe your hook and get a notification. Equivalent to RESThook but these provide security on basis of signature and RESThook work on unique URL. Following are the events that are allowed by LoginRadius to trigger a WebHook service call.
|
49
|
-
#
|
50
|
-
# @param web_hook_subscribe_model - Model Class containing Definition of payload for Webhook Subscribe API
|
51
|
-
#
|
52
|
-
# @return Response containing Definition of Complete Validation data
|
53
|
-
# 40.2
|
54
|
-
def web_hook_subscribe(web_hook_subscribe_model)
|
55
|
-
if web_hook_subscribe_model.blank?
|
56
|
-
raise LoginRadius::Error.new, getValidationMessage('web_hook_subscribe_model')
|
57
|
-
end
|
58
|
-
|
59
|
-
query_parameters = {}
|
60
|
-
query_parameters['apikey'] = @api_key
|
61
|
-
query_parameters['apisecret'] = @api_secret
|
62
|
-
|
63
|
-
resource_path = 'api/v2/webhook'
|
64
|
-
post_request(resource_path, query_parameters, web_hook_subscribe_model)
|
65
|
-
end
|
66
|
-
|
67
|
-
# API can be used to test a subscribed WebHook.
|
68
|
-
#
|
69
|
-
#
|
70
|
-
# @return Response containing Definition of Complete Validation data
|
71
|
-
# 40.3
|
72
|
-
def webhook_test()
|
73
|
-
|
74
|
-
query_parameters = {}
|
75
|
-
query_parameters['apikey'] = @api_key
|
76
|
-
query_parameters['apisecret'] = @api_secret
|
77
|
-
|
78
|
-
resource_path = 'api/v2/webhook/test'
|
79
|
-
get_request(resource_path, query_parameters,
|
80
|
-
end
|
81
|
-
|
82
|
-
# API can be used to unsubscribe a WebHook configured on your LoginRadius site.
|
83
|
-
#
|
84
|
-
# @param web_hook_subscribe_model - Model Class containing Definition of payload for Webhook Subscribe API
|
85
|
-
#
|
86
|
-
# @return Response containing Definition of Delete Request
|
87
|
-
# 40.4
|
88
|
-
def web_hook_unsubscribe(web_hook_subscribe_model)
|
89
|
-
if web_hook_subscribe_model.blank?
|
90
|
-
raise LoginRadius::Error.new, getValidationMessage('web_hook_subscribe_model')
|
91
|
-
end
|
92
|
-
|
93
|
-
query_parameters = {}
|
94
|
-
query_parameters['apikey'] = @api_key
|
95
|
-
query_parameters['apisecret'] = @api_secret
|
96
|
-
|
97
|
-
resource_path = 'api/v2/webhook'
|
98
|
-
delete_request(resource_path, query_parameters, web_hook_subscribe_model)
|
99
|
-
end
|
100
|
-
end
|
101
|
-
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
|
+
# WebHookApi module
|
9
|
+
class WebHookApi
|
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 fatch all the subscribed URLs, for particular event
|
29
|
+
#
|
30
|
+
# @param event - Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject
|
31
|
+
#
|
32
|
+
# @return Response Containing List of Webhhook Data
|
33
|
+
# 40.1
|
34
|
+
def get_web_hook_subscribed_u_r_ls(event)
|
35
|
+
if isNullOrWhiteSpace(event)
|
36
|
+
raise LoginRadius::Error.new, getValidationMessage('event')
|
37
|
+
end
|
38
|
+
|
39
|
+
query_parameters = {}
|
40
|
+
query_parameters['apikey'] = @api_key
|
41
|
+
query_parameters['apisecret'] = @api_secret
|
42
|
+
query_parameters['event'] = event
|
43
|
+
|
44
|
+
resource_path = 'api/v2/webhook'
|
45
|
+
get_request(resource_path, query_parameters, {})
|
46
|
+
end
|
47
|
+
|
48
|
+
# API can be used to configure a WebHook on your LoginRadius site. Webhooks also work on subscribe and notification model, subscribe your hook and get a notification. Equivalent to RESThook but these provide security on basis of signature and RESThook work on unique URL. Following are the events that are allowed by LoginRadius to trigger a WebHook service call.
|
49
|
+
#
|
50
|
+
# @param web_hook_subscribe_model - Model Class containing Definition of payload for Webhook Subscribe API
|
51
|
+
#
|
52
|
+
# @return Response containing Definition of Complete Validation data
|
53
|
+
# 40.2
|
54
|
+
def web_hook_subscribe(web_hook_subscribe_model)
|
55
|
+
if web_hook_subscribe_model.blank?
|
56
|
+
raise LoginRadius::Error.new, getValidationMessage('web_hook_subscribe_model')
|
57
|
+
end
|
58
|
+
|
59
|
+
query_parameters = {}
|
60
|
+
query_parameters['apikey'] = @api_key
|
61
|
+
query_parameters['apisecret'] = @api_secret
|
62
|
+
|
63
|
+
resource_path = 'api/v2/webhook'
|
64
|
+
post_request(resource_path, query_parameters, web_hook_subscribe_model)
|
65
|
+
end
|
66
|
+
|
67
|
+
# API can be used to test a subscribed WebHook.
|
68
|
+
#
|
69
|
+
#
|
70
|
+
# @return Response containing Definition of Complete Validation data
|
71
|
+
# 40.3
|
72
|
+
def webhook_test()
|
73
|
+
|
74
|
+
query_parameters = {}
|
75
|
+
query_parameters['apikey'] = @api_key
|
76
|
+
query_parameters['apisecret'] = @api_secret
|
77
|
+
|
78
|
+
resource_path = 'api/v2/webhook/test'
|
79
|
+
get_request(resource_path, query_parameters, {})
|
80
|
+
end
|
81
|
+
|
82
|
+
# API can be used to unsubscribe a WebHook configured on your LoginRadius site.
|
83
|
+
#
|
84
|
+
# @param web_hook_subscribe_model - Model Class containing Definition of payload for Webhook Subscribe API
|
85
|
+
#
|
86
|
+
# @return Response containing Definition of Delete Request
|
87
|
+
# 40.4
|
88
|
+
def web_hook_unsubscribe(web_hook_subscribe_model)
|
89
|
+
if web_hook_subscribe_model.blank?
|
90
|
+
raise LoginRadius::Error.new, getValidationMessage('web_hook_subscribe_model')
|
91
|
+
end
|
92
|
+
|
93
|
+
query_parameters = {}
|
94
|
+
query_parameters['apikey'] = @api_key
|
95
|
+
query_parameters['apisecret'] = @api_secret
|
96
|
+
|
97
|
+
resource_path = 'api/v2/webhook'
|
98
|
+
delete_request(resource_path, query_parameters, web_hook_subscribe_model)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|