login_radius 11.0.0 → 11.2.2

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 (29) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +21 -21
  3. data/README.md +58 -58
  4. data/lib/login_radius/api/account/account_api.rb +581 -581
  5. data/lib/login_radius/api/account/role_api.rb +330 -330
  6. data/lib/login_radius/api/account/sott_api.rb +47 -47
  7. data/lib/login_radius/api/advanced/configuration_api.rb +57 -57
  8. data/lib/login_radius/api/advanced/consent_management_api.rb +161 -161
  9. data/lib/login_radius/api/advanced/custom_object_api.rb +316 -316
  10. data/lib/login_radius/api/advanced/custom_registration_data_api.rb +195 -195
  11. data/lib/login_radius/api/advanced/multi_factor_authentication_api.rb +942 -606
  12. data/lib/login_radius/api/advanced/re_authentication_api.rb +317 -243
  13. data/lib/login_radius/api/advanced/web_hook_api.rb +101 -101
  14. data/lib/login_radius/api/authentication/authentication_api.rb +1036 -989
  15. data/lib/login_radius/api/authentication/one_touch_login_api.rb +160 -160
  16. data/lib/login_radius/api/authentication/password_less_login_api.rb +202 -158
  17. data/lib/login_radius/api/authentication/phone_authentication_api.rb +329 -329
  18. data/lib/login_radius/api/authentication/pin_authentication_api.rb +316 -316
  19. data/lib/login_radius/api/authentication/risk_based_authentication_api.rb +286 -286
  20. data/lib/login_radius/api/authentication/smart_login_api.rb +146 -146
  21. data/lib/login_radius/api/social/native_social_api.rb +255 -255
  22. data/lib/login_radius/api/social/social_api.rb +784 -806
  23. data/lib/login_radius/error.rb +7 -7
  24. data/lib/login_radius/request_client.rb +311 -295
  25. data/lib/login_radius/response.rb +18 -12
  26. data/lib/login_radius/version.rb +2 -2
  27. data/lib/login_radius.rb +30 -30
  28. data/login_radius.gemspec +25 -28
  29. metadata +7 -7
@@ -1,47 +1,47 @@
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
- # SottApi module
9
- class SottApi
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 allows you to generate SOTT with a given expiration time.
29
- #
30
- # @param time_difference - The time difference you would like to pass, If you not pass difference then the default value is 10 minutes
31
- #
32
- # @return Sott data For Registration
33
- # 18.28
34
- def generate_sott(time_difference = '')
35
-
36
- query_parameters = {}
37
- query_parameters['apiKey'] = @api_key
38
- query_parameters['apiSecret'] = @api_secret
39
- unless time_difference == false
40
- query_parameters['timeDifference'] = time_difference
41
- end
42
-
43
- resource_path = 'identity/v2/manage/account/sott'
44
- get_request(resource_path, query_parameters, nil)
45
- end
46
- end
47
- 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
+ # SottApi module
9
+ class SottApi
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 allows you to generate SOTT with a given expiration time.
29
+ #
30
+ # @param time_difference - The time difference you would like to pass, If you not pass difference then the default value is 10 minutes
31
+ #
32
+ # @return Sott data For Registration
33
+ # 18.28
34
+ def generate_sott(time_difference = '')
35
+
36
+ query_parameters = {}
37
+ query_parameters['apiKey'] = @api_key
38
+ query_parameters['apiSecret'] = @api_secret
39
+ unless time_difference == false
40
+ query_parameters['timeDifference'] = time_difference
41
+ end
42
+
43
+ resource_path = 'identity/v2/manage/account/sott'
44
+ get_request(resource_path, query_parameters, {})
45
+ end
46
+ end
47
+ end
@@ -1,57 +1,57 @@
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
- # ConfigurationApi module
9
- class ConfigurationApi
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
- # This API is used to get the configurations which are set in the LoginRadius Dashboard for a particular LoginRadius site/environment
28
- #
29
- # @return Response containing LoginRadius App configurations which are set in the LoginRadius Dashboard for a particular LoginRadius site/environment
30
- # 100
31
- def get_configurations()
32
- resource_path = 'ciam/appinfo'
33
- query_parameters = {}
34
- query_parameters['apikey'] = @api_key
35
-
36
- get_request(resource_path, query_parameters, nil)
37
- end
38
-
39
- # This API allows you to query your LoginRadius account for basic server information and server time information which is useful when generating an SOTT token.
40
- #
41
- # @param time_difference - The time difference you would like to pass, If you not pass difference then the default value is 10 minutes
42
- #
43
- # @return Response containing Definition of Complete service info data
44
- # 3.1
45
- def get_server_info(time_difference = '')
46
-
47
- query_parameters = {}
48
- query_parameters['apiKey'] = @api_key
49
- unless time_difference == false
50
- query_parameters['timeDifference'] = time_difference
51
- end
52
-
53
- resource_path = 'identity/v2/serverinfo'
54
- get_request(resource_path, query_parameters, nil)
55
- end
56
- end
57
- 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
+ # ConfigurationApi module
9
+ class ConfigurationApi
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
+ # This API is used to get the configurations which are set in the LoginRadius Dashboard for a particular LoginRadius site/environment
28
+ #
29
+ # @return Response containing LoginRadius App configurations which are set in the LoginRadius Dashboard for a particular LoginRadius site/environment
30
+ # 100
31
+ def get_configurations()
32
+ resource_path = 'ciam/appinfo'
33
+ query_parameters = {}
34
+ query_parameters['apikey'] = @api_key
35
+
36
+ get_request(resource_path, query_parameters, nil)
37
+ end
38
+
39
+ # This API allows you to query your LoginRadius account for basic server information and server time information which is useful when generating an SOTT token.
40
+ #
41
+ # @param time_difference - The time difference you would like to pass, If you not pass difference then the default value is 10 minutes
42
+ #
43
+ # @return Response containing Definition of Complete service info data
44
+ # 3.1
45
+ def get_server_info(time_difference = '')
46
+
47
+ query_parameters = {}
48
+ query_parameters['apiKey'] = @api_key
49
+ unless time_difference == false
50
+ query_parameters['timeDifference'] = time_difference
51
+ end
52
+
53
+ resource_path = 'identity/v2/serverinfo'
54
+ get_request(resource_path, query_parameters, {})
55
+ end
56
+ end
57
+ end
@@ -1,161 +1,161 @@
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
- # ConsentManagementApi module
9
- class ConsentManagementApi
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 get the Consent logs of the user.
29
- #
30
- # @param uid - UID, the unified identifier for each user account
31
- #
32
- # @return Response containing consent logs
33
- # 18.37
34
- def get_consent_logs_by_uid(uid)
35
- if isNullOrWhiteSpace(uid)
36
- raise LoginRadius::Error.new, getValidationMessage('uid')
37
- end
38
-
39
- query_parameters = {}
40
- query_parameters['apiKey'] = @api_key
41
- query_parameters['apiSecret'] = @api_secret
42
-
43
- resource_path = 'identity/v2/manage/account/' + uid + '/consent/logs'
44
- get_request(resource_path, query_parameters, nil)
45
- end
46
-
47
- # This API is to submit consent form using consent token.
48
- #
49
- # @param consent_token - The consent token received after login error 1226
50
- # @param consent_submit_model - Model class containing list of multiple consent
51
- #
52
- # @return Response containing User Profile Data and access token
53
- # 43.1
54
- def submit_consent_by_consent_token(consent_token, consent_submit_model)
55
- if isNullOrWhiteSpace(consent_token)
56
- raise LoginRadius::Error.new, getValidationMessage('consent_token')
57
- end
58
- if consent_submit_model.blank?
59
- raise LoginRadius::Error.new, getValidationMessage('consent_submit_model')
60
- end
61
-
62
- query_parameters = {}
63
- query_parameters['apiKey'] = @api_key
64
- query_parameters['consentToken'] = consent_token
65
-
66
- resource_path = 'identity/v2/auth/consent'
67
- post_request(resource_path, query_parameters, consent_submit_model)
68
- end
69
-
70
- # This API is used to fetch consent logs.
71
- #
72
- # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
73
- #
74
- # @return Response containing consent logs
75
- # 43.2
76
- def get_consent_logs(access_token)
77
- if isNullOrWhiteSpace(access_token)
78
- raise LoginRadius::Error.new, getValidationMessage('access_token')
79
- end
80
-
81
- query_parameters = {}
82
- query_parameters['access_token'] = access_token
83
- query_parameters['apiKey'] = @api_key
84
-
85
- resource_path = 'identity/v2/auth/consent/logs'
86
- get_request(resource_path, query_parameters, nil)
87
- end
88
-
89
- # API to provide a way to end user to submit a consent form for particular event type.
90
- #
91
- # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
92
- # @param consent_submit_model - Model class containing list of multiple consent
93
- #
94
- # @return Response containing Definition for Complete profile data
95
- # 43.3
96
- def submit_consent_by_access_token(access_token, consent_submit_model)
97
- if isNullOrWhiteSpace(access_token)
98
- raise LoginRadius::Error.new, getValidationMessage('access_token')
99
- end
100
- if consent_submit_model.blank?
101
- raise LoginRadius::Error.new, getValidationMessage('consent_submit_model')
102
- end
103
-
104
- query_parameters = {}
105
- query_parameters['access_token'] = access_token
106
- query_parameters['apiKey'] = @api_key
107
-
108
- resource_path = 'identity/v2/auth/consent/profile'
109
- post_request(resource_path, query_parameters, consent_submit_model)
110
- end
111
-
112
- # This API is used to check if consent is submitted for a particular event or not.
113
- #
114
- # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
115
- # @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
116
- # @param is_custom - true/false
117
- #
118
- # @return Response containing consent profile
119
- # 43.4
120
- def verify_consent_by_access_token(access_token, event, is_custom)
121
- if isNullOrWhiteSpace(access_token)
122
- raise LoginRadius::Error.new, getValidationMessage('access_token')
123
- end
124
- if isNullOrWhiteSpace(event)
125
- raise LoginRadius::Error.new, getValidationMessage('event')
126
- end
127
-
128
- query_parameters = {}
129
- query_parameters['access_token'] = access_token
130
- query_parameters['apiKey'] = @api_key
131
- query_parameters['event'] = event
132
- query_parameters['isCustom'] = is_custom
133
-
134
- resource_path = 'identity/v2/auth/consent/verify'
135
- get_request(resource_path, query_parameters, nil)
136
- end
137
-
138
- # This API is to update consents using access token.
139
- #
140
- # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
141
- # @param consent_update_model - Model class containg list of multiple consent
142
- #
143
- # @return Response containing consent profile
144
- # 43.5
145
- def update_consent_profile_by_access_token(access_token, consent_update_model)
146
- if isNullOrWhiteSpace(access_token)
147
- raise LoginRadius::Error.new, getValidationMessage('access_token')
148
- end
149
- if consent_update_model.blank?
150
- raise LoginRadius::Error.new, getValidationMessage('consent_update_model')
151
- end
152
-
153
- query_parameters = {}
154
- query_parameters['access_token'] = access_token
155
- query_parameters['apiKey'] = @api_key
156
-
157
- resource_path = 'identity/v2/auth/consent'
158
- put_request(resource_path, query_parameters, consent_update_model)
159
- end
160
- end
161
- 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
+ # ConsentManagementApi module
9
+ class ConsentManagementApi
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 get the Consent logs of the user.
29
+ #
30
+ # @param uid - UID, the unified identifier for each user account
31
+ #
32
+ # @return Response containing consent logs
33
+ # 18.37
34
+ def get_consent_logs_by_uid(uid)
35
+ if isNullOrWhiteSpace(uid)
36
+ raise LoginRadius::Error.new, getValidationMessage('uid')
37
+ end
38
+
39
+ query_parameters = {}
40
+ query_parameters['apiKey'] = @api_key
41
+ query_parameters['apiSecret'] = @api_secret
42
+
43
+ resource_path = 'identity/v2/manage/account/' + uid + '/consent/logs'
44
+ get_request(resource_path, query_parameters, {})
45
+ end
46
+
47
+ # This API is to submit consent form using consent token.
48
+ #
49
+ # @param consent_token - The consent token received after login error 1226
50
+ # @param consent_submit_model - Model class containing list of multiple consent
51
+ #
52
+ # @return Response containing User Profile Data and access token
53
+ # 43.1
54
+ def submit_consent_by_consent_token(consent_token, consent_submit_model)
55
+ if isNullOrWhiteSpace(consent_token)
56
+ raise LoginRadius::Error.new, getValidationMessage('consent_token')
57
+ end
58
+ if consent_submit_model.blank?
59
+ raise LoginRadius::Error.new, getValidationMessage('consent_submit_model')
60
+ end
61
+
62
+ query_parameters = {}
63
+ query_parameters['apiKey'] = @api_key
64
+ query_parameters['consentToken'] = consent_token
65
+
66
+ resource_path = 'identity/v2/auth/consent'
67
+ post_request(resource_path, query_parameters, consent_submit_model)
68
+ end
69
+
70
+ # This API is used to fetch consent logs.
71
+ #
72
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
73
+ #
74
+ # @return Response containing consent logs
75
+ # 43.2
76
+ def get_consent_logs(access_token)
77
+ if isNullOrWhiteSpace(access_token)
78
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
79
+ end
80
+
81
+ query_parameters = {}
82
+ query_parameters['access_token'] = access_token
83
+ query_parameters['apiKey'] = @api_key
84
+
85
+ resource_path = 'identity/v2/auth/consent/logs'
86
+ get_request(resource_path, query_parameters, {})
87
+ end
88
+
89
+ # API to provide a way to end user to submit a consent form for particular event type.
90
+ #
91
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
92
+ # @param consent_submit_model - Model class containing list of multiple consent
93
+ #
94
+ # @return Response containing Definition for Complete profile data
95
+ # 43.3
96
+ def submit_consent_by_access_token(access_token, consent_submit_model)
97
+ if isNullOrWhiteSpace(access_token)
98
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
99
+ end
100
+ if consent_submit_model.blank?
101
+ raise LoginRadius::Error.new, getValidationMessage('consent_submit_model')
102
+ end
103
+
104
+ query_parameters = {}
105
+ query_parameters['access_token'] = access_token
106
+ query_parameters['apiKey'] = @api_key
107
+
108
+ resource_path = 'identity/v2/auth/consent/profile'
109
+ post_request(resource_path, query_parameters, consent_submit_model)
110
+ end
111
+
112
+ # This API is used to check if consent is submitted for a particular event or not.
113
+ #
114
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
115
+ # @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
116
+ # @param is_custom - true/false
117
+ #
118
+ # @return Response containing consent profile
119
+ # 43.4
120
+ def verify_consent_by_access_token(access_token, event, is_custom)
121
+ if isNullOrWhiteSpace(access_token)
122
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
123
+ end
124
+ if isNullOrWhiteSpace(event)
125
+ raise LoginRadius::Error.new, getValidationMessage('event')
126
+ end
127
+
128
+ query_parameters = {}
129
+ query_parameters['access_token'] = access_token
130
+ query_parameters['apiKey'] = @api_key
131
+ query_parameters['event'] = event
132
+ query_parameters['isCustom'] = is_custom
133
+
134
+ resource_path = 'identity/v2/auth/consent/verify'
135
+ get_request(resource_path, query_parameters, {})
136
+ end
137
+
138
+ # This API is to update consents using access token.
139
+ #
140
+ # @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
141
+ # @param consent_update_model - Model class containg list of multiple consent
142
+ #
143
+ # @return Response containing consent profile
144
+ # 43.5
145
+ def update_consent_profile_by_access_token(access_token, consent_update_model)
146
+ if isNullOrWhiteSpace(access_token)
147
+ raise LoginRadius::Error.new, getValidationMessage('access_token')
148
+ end
149
+ if consent_update_model.blank?
150
+ raise LoginRadius::Error.new, getValidationMessage('consent_update_model')
151
+ end
152
+
153
+ query_parameters = {}
154
+ query_parameters['access_token'] = access_token
155
+ query_parameters['apiKey'] = @api_key
156
+
157
+ resource_path = 'identity/v2/auth/consent'
158
+ put_request(resource_path, query_parameters, consent_update_model)
159
+ end
160
+ end
161
+ end