login_radius 10.0.0 → 11.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +19 -0
  3. data/LICENSE.txt +21 -21
  4. data/README.md +58 -58
  5. data/lib/login_radius/api/account/account_api.rb +581 -581
  6. data/lib/login_radius/api/account/role_api.rb +330 -330
  7. data/lib/login_radius/api/account/sott_api.rb +47 -47
  8. data/lib/login_radius/api/advanced/configuration_api.rb +57 -57
  9. data/lib/login_radius/api/advanced/consent_management_api.rb +161 -161
  10. data/lib/login_radius/api/advanced/custom_object_api.rb +316 -316
  11. data/lib/login_radius/api/advanced/custom_registration_data_api.rb +195 -195
  12. data/lib/login_radius/api/advanced/multi_factor_authentication_api.rb +942 -606
  13. data/lib/login_radius/api/advanced/re_authentication_api.rb +317 -243
  14. data/lib/login_radius/api/advanced/web_hook_api.rb +101 -101
  15. data/lib/login_radius/api/authentication/authentication_api.rb +1036 -986
  16. data/lib/login_radius/api/authentication/one_touch_login_api.rb +160 -160
  17. data/lib/login_radius/api/authentication/password_less_login_api.rb +202 -158
  18. data/lib/login_radius/api/authentication/phone_authentication_api.rb +329 -329
  19. data/lib/login_radius/api/authentication/pin_authentication_api.rb +316 -316
  20. data/lib/login_radius/api/authentication/risk_based_authentication_api.rb +286 -286
  21. data/lib/login_radius/api/authentication/smart_login_api.rb +146 -146
  22. data/lib/login_radius/api/social/native_social_api.rb +255 -193
  23. data/lib/login_radius/api/social/social_api.rb +784 -802
  24. data/lib/login_radius/error.rb +7 -7
  25. data/lib/login_radius/request_client.rb +316 -295
  26. data/lib/login_radius/response.rb +18 -12
  27. data/lib/login_radius/version.rb +2 -2
  28. data/lib/login_radius.rb +30 -30
  29. data/login_radius.gemspec +25 -28
  30. metadata +8 -7
@@ -1,146 +1,146 @@
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
- # SmartLoginApi module
9
- class SmartLoginApi
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 verifies the provided token for Smart Login
29
- #
30
- # @param verification_token - Verification token received in the email
31
- # @param welcome_email_template - Name of the welcome email template
32
- #
33
- # @return Complete verified response data
34
- # 8.4.1
35
- def smart_login_token_verification(verification_token, welcome_email_template = '')
36
- if isNullOrWhiteSpace(verification_token)
37
- raise LoginRadius::Error.new, getValidationMessage('verification_token')
38
- end
39
-
40
- query_parameters = {}
41
- query_parameters['apiKey'] = @api_key
42
- query_parameters['verificationToken'] = verification_token
43
- unless isNullOrWhiteSpace(welcome_email_template)
44
- query_parameters['welcomeEmailTemplate'] = welcome_email_template
45
- end
46
-
47
- resource_path = 'identity/v2/auth/email/smartlogin'
48
- get_request(resource_path, query_parameters, nil)
49
- end
50
-
51
- # This API sends a Smart Login link to the user's Email Id.
52
- #
53
- # @param client_guid - Unique string used in the Smart Login request
54
- # @param email - Email of the user
55
- # @param redirect_url - Url where the user will redirect after success authentication
56
- # @param smart_login_email_template - Email template for Smart Login link
57
- # @param welcome_email_template - Name of the welcome email template
58
- #
59
- # @return Response containing Definition of Complete Validation data
60
- # 9.17.1
61
- def smart_login_by_email(client_guid, email, redirect_url = '', smart_login_email_template = '', welcome_email_template = '')
62
- if isNullOrWhiteSpace(client_guid)
63
- raise LoginRadius::Error.new, getValidationMessage('client_guid')
64
- end
65
- if isNullOrWhiteSpace(email)
66
- raise LoginRadius::Error.new, getValidationMessage('email')
67
- end
68
-
69
- query_parameters = {}
70
- query_parameters['apiKey'] = @api_key
71
- query_parameters['clientGuid'] = client_guid
72
- query_parameters['email'] = email
73
- unless isNullOrWhiteSpace(redirect_url)
74
- query_parameters['redirectUrl'] = redirect_url
75
- end
76
- unless isNullOrWhiteSpace(smart_login_email_template)
77
- query_parameters['smartLoginEmailTemplate'] = smart_login_email_template
78
- end
79
- unless isNullOrWhiteSpace(welcome_email_template)
80
- query_parameters['welcomeEmailTemplate'] = welcome_email_template
81
- end
82
-
83
- resource_path = 'identity/v2/auth/login/smartlogin'
84
- get_request(resource_path, query_parameters, nil)
85
- end
86
-
87
- # This API sends a Smart Login link to the user's Email Id.
88
- #
89
- # @param client_guid - Unique string used in the Smart Login request
90
- # @param username - UserName of the user
91
- # @param redirect_url - Url where the user will redirect after success authentication
92
- # @param smart_login_email_template - Email template for Smart Login link
93
- # @param welcome_email_template - Name of the welcome email template
94
- #
95
- # @return Response containing Definition of Complete Validation data
96
- # 9.17.2
97
- def smart_login_by_user_name(client_guid, username, redirect_url = '', smart_login_email_template = '', welcome_email_template = '')
98
- if isNullOrWhiteSpace(client_guid)
99
- raise LoginRadius::Error.new, getValidationMessage('client_guid')
100
- end
101
- if isNullOrWhiteSpace(username)
102
- raise LoginRadius::Error.new, getValidationMessage('username')
103
- end
104
-
105
- query_parameters = {}
106
- query_parameters['apiKey'] = @api_key
107
- query_parameters['clientGuid'] = client_guid
108
- query_parameters['username'] = username
109
- unless isNullOrWhiteSpace(redirect_url)
110
- query_parameters['redirectUrl'] = redirect_url
111
- end
112
- unless isNullOrWhiteSpace(smart_login_email_template)
113
- query_parameters['smartLoginEmailTemplate'] = smart_login_email_template
114
- end
115
- unless isNullOrWhiteSpace(welcome_email_template)
116
- query_parameters['welcomeEmailTemplate'] = welcome_email_template
117
- end
118
-
119
- resource_path = 'identity/v2/auth/login/smartlogin'
120
- get_request(resource_path, query_parameters, nil)
121
- end
122
-
123
- # This API is used to check if the Smart Login link has been clicked or not
124
- #
125
- # @param client_guid - Unique string used in the Smart Login request
126
- # @param fields - The fields parameter filters the API response so that the response only includes a specific set of fields
127
- #
128
- # @return Response containing User Profile Data and access token
129
- # 9.21.1
130
- def smart_login_ping(client_guid, fields = '')
131
- if isNullOrWhiteSpace(client_guid)
132
- raise LoginRadius::Error.new, getValidationMessage('client_guid')
133
- end
134
-
135
- query_parameters = {}
136
- query_parameters['apiKey'] = @api_key
137
- query_parameters['clientGuid'] = client_guid
138
- unless isNullOrWhiteSpace(fields)
139
- query_parameters['fields'] = fields
140
- end
141
-
142
- resource_path = 'identity/v2/auth/login/smartlogin/ping'
143
- get_request(resource_path, query_parameters, nil)
144
- end
145
- end
146
- 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
+ # SmartLoginApi module
9
+ class SmartLoginApi
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 verifies the provided token for Smart Login
29
+ #
30
+ # @param verification_token - Verification token received in the email
31
+ # @param welcome_email_template - Name of the welcome email template
32
+ #
33
+ # @return Complete verified response data
34
+ # 8.4.1
35
+ def smart_login_token_verification(verification_token, welcome_email_template = '')
36
+ if isNullOrWhiteSpace(verification_token)
37
+ raise LoginRadius::Error.new, getValidationMessage('verification_token')
38
+ end
39
+
40
+ query_parameters = {}
41
+ query_parameters['apiKey'] = @api_key
42
+ query_parameters['verificationToken'] = verification_token
43
+ unless isNullOrWhiteSpace(welcome_email_template)
44
+ query_parameters['welcomeEmailTemplate'] = welcome_email_template
45
+ end
46
+
47
+ resource_path = 'identity/v2/auth/email/smartlogin'
48
+ get_request(resource_path, query_parameters, {})
49
+ end
50
+
51
+ # This API sends a Smart Login link to the user's Email Id.
52
+ #
53
+ # @param client_guid - Unique string used in the Smart Login request
54
+ # @param email - Email of the user
55
+ # @param redirect_url - Url where the user will redirect after success authentication
56
+ # @param smart_login_email_template - Email template for Smart Login link
57
+ # @param welcome_email_template - Name of the welcome email template
58
+ #
59
+ # @return Response containing Definition of Complete Validation data
60
+ # 9.17.1
61
+ def smart_login_by_email(client_guid, email, redirect_url = '', smart_login_email_template = '', welcome_email_template = '')
62
+ if isNullOrWhiteSpace(client_guid)
63
+ raise LoginRadius::Error.new, getValidationMessage('client_guid')
64
+ end
65
+ if isNullOrWhiteSpace(email)
66
+ raise LoginRadius::Error.new, getValidationMessage('email')
67
+ end
68
+
69
+ query_parameters = {}
70
+ query_parameters['apiKey'] = @api_key
71
+ query_parameters['clientGuid'] = client_guid
72
+ query_parameters['email'] = email
73
+ unless isNullOrWhiteSpace(redirect_url)
74
+ query_parameters['redirectUrl'] = redirect_url
75
+ end
76
+ unless isNullOrWhiteSpace(smart_login_email_template)
77
+ query_parameters['smartLoginEmailTemplate'] = smart_login_email_template
78
+ end
79
+ unless isNullOrWhiteSpace(welcome_email_template)
80
+ query_parameters['welcomeEmailTemplate'] = welcome_email_template
81
+ end
82
+
83
+ resource_path = 'identity/v2/auth/login/smartlogin'
84
+ get_request(resource_path, query_parameters, {})
85
+ end
86
+
87
+ # This API sends a Smart Login link to the user's Email Id.
88
+ #
89
+ # @param client_guid - Unique string used in the Smart Login request
90
+ # @param username - UserName of the user
91
+ # @param redirect_url - Url where the user will redirect after success authentication
92
+ # @param smart_login_email_template - Email template for Smart Login link
93
+ # @param welcome_email_template - Name of the welcome email template
94
+ #
95
+ # @return Response containing Definition of Complete Validation data
96
+ # 9.17.2
97
+ def smart_login_by_user_name(client_guid, username, redirect_url = '', smart_login_email_template = '', welcome_email_template = '')
98
+ if isNullOrWhiteSpace(client_guid)
99
+ raise LoginRadius::Error.new, getValidationMessage('client_guid')
100
+ end
101
+ if isNullOrWhiteSpace(username)
102
+ raise LoginRadius::Error.new, getValidationMessage('username')
103
+ end
104
+
105
+ query_parameters = {}
106
+ query_parameters['apiKey'] = @api_key
107
+ query_parameters['clientGuid'] = client_guid
108
+ query_parameters['username'] = username
109
+ unless isNullOrWhiteSpace(redirect_url)
110
+ query_parameters['redirectUrl'] = redirect_url
111
+ end
112
+ unless isNullOrWhiteSpace(smart_login_email_template)
113
+ query_parameters['smartLoginEmailTemplate'] = smart_login_email_template
114
+ end
115
+ unless isNullOrWhiteSpace(welcome_email_template)
116
+ query_parameters['welcomeEmailTemplate'] = welcome_email_template
117
+ end
118
+
119
+ resource_path = 'identity/v2/auth/login/smartlogin'
120
+ get_request(resource_path, query_parameters, {})
121
+ end
122
+
123
+ # This API is used to check if the Smart Login link has been clicked or not
124
+ #
125
+ # @param client_guid - Unique string used in the Smart Login request
126
+ # @param fields - The fields parameter filters the API response so that the response only includes a specific set of fields
127
+ #
128
+ # @return Response containing User Profile Data and access token
129
+ # 9.21.1
130
+ def smart_login_ping(client_guid, fields = '')
131
+ if isNullOrWhiteSpace(client_guid)
132
+ raise LoginRadius::Error.new, getValidationMessage('client_guid')
133
+ end
134
+
135
+ query_parameters = {}
136
+ query_parameters['apiKey'] = @api_key
137
+ query_parameters['clientGuid'] = client_guid
138
+ unless isNullOrWhiteSpace(fields)
139
+ query_parameters['fields'] = fields
140
+ end
141
+
142
+ resource_path = 'identity/v2/auth/login/smartlogin/ping'
143
+ get_request(resource_path, query_parameters, {})
144
+ end
145
+ end
146
+ end