login_radius 10.0.0 → 11.2.2

Sign up to get free protection for your applications and to get access to all the features.
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 -986
  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 -193
  22. data/lib/login_radius/api/social/social_api.rb +784 -802
  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,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
@@ -1,193 +1,255 @@
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
- # NativeSocialApi module
9
- class NativeSocialApi
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
- # The API is used to get LoginRadius access token by sending Facebook's access token. It will be valid for the specific duration of time specified in the response.
29
- #
30
- # @param fb__access__token - Facebook Access Token
31
- #
32
- # @return Response containing Definition of Complete Token data
33
- # 20.3
34
- def get_access_token_by_facebook_access_token(fb__access__token)
35
- if isNullOrWhiteSpace(fb__access__token)
36
- raise LoginRadius::Error.new, getValidationMessage('fb__access__token')
37
- end
38
-
39
- query_parameters = {}
40
- query_parameters['fb_Access_Token'] = fb__access__token
41
- query_parameters['key'] = @api_key
42
-
43
- resource_path = 'api/v2/access_token/facebook'
44
- get_request(resource_path, query_parameters, nil)
45
- end
46
-
47
- # The API is used to get LoginRadius access token by sending Twitter's access token. It will be valid for the specific duration of time specified in the response.
48
- #
49
- # @param tw__access__token - Twitter Access Token
50
- # @param tw__token__secret - Twitter Token Secret
51
- #
52
- # @return Response containing Definition of Complete Token data
53
- # 20.4
54
- def get_access_token_by_twitter_access_token(tw__access__token, tw__token__secret)
55
- if isNullOrWhiteSpace(tw__access__token)
56
- raise LoginRadius::Error.new, getValidationMessage('tw__access__token')
57
- end
58
- if isNullOrWhiteSpace(tw__token__secret)
59
- raise LoginRadius::Error.new, getValidationMessage('tw__token__secret')
60
- end
61
-
62
- query_parameters = {}
63
- query_parameters['key'] = @api_key
64
- query_parameters['tw_Access_Token'] = tw__access__token
65
- query_parameters['tw_Token_Secret'] = tw__token__secret
66
-
67
- resource_path = 'api/v2/access_token/twitter'
68
- get_request(resource_path, query_parameters, nil)
69
- end
70
-
71
- # The API is used to get LoginRadius access token by sending Google's access token. It will be valid for the specific duration of time specified in the response.
72
- #
73
- # @param google__access__token - Google Access Token
74
- # @param client_id - Google Client ID
75
- # @param refresh_token - LoginRadius refresh token
76
- #
77
- # @return Response containing Definition of Complete Token data
78
- # 20.5
79
- def get_access_token_by_google_access_token(google__access__token, client_id = '', refresh_token = '')
80
- if isNullOrWhiteSpace(google__access__token)
81
- raise LoginRadius::Error.new, getValidationMessage('google__access__token')
82
- end
83
-
84
- query_parameters = {}
85
- query_parameters['google_Access_Token'] = google__access__token
86
- query_parameters['key'] = @api_key
87
- unless isNullOrWhiteSpace(client_id)
88
- query_parameters['client_id'] = client_id
89
- end
90
- unless isNullOrWhiteSpace(refresh_token)
91
- query_parameters['refresh_token'] = refresh_token
92
- end
93
-
94
- resource_path = 'api/v2/access_token/google'
95
- get_request(resource_path, query_parameters, nil)
96
- end
97
-
98
- # This API is used to Get LoginRadius Access Token using google jwt id token for google native mobile login/registration.
99
- #
100
- # @param id__token - Google JWT id_token
101
- #
102
- # @return Response containing Definition of Complete Token data
103
- # 20.6
104
- def get_access_token_by_google_j_w_t_access_token(id__token)
105
- if isNullOrWhiteSpace(id__token)
106
- raise LoginRadius::Error.new, getValidationMessage('id__token')
107
- end
108
-
109
- query_parameters = {}
110
- query_parameters['id_Token'] = id__token
111
- query_parameters['key'] = @api_key
112
-
113
- resource_path = 'api/v2/access_token/googlejwt'
114
- get_request(resource_path, query_parameters, nil)
115
- end
116
-
117
- # The API is used to get LoginRadius access token by sending Linkedin's access token. It will be valid for the specific duration of time specified in the response.
118
- #
119
- # @param ln__access__token - Linkedin Access Token
120
- #
121
- # @return Response containing Definition of Complete Token data
122
- # 20.7
123
- def get_access_token_by_linkedin_access_token(ln__access__token)
124
- if isNullOrWhiteSpace(ln__access__token)
125
- raise LoginRadius::Error.new, getValidationMessage('ln__access__token')
126
- end
127
-
128
- query_parameters = {}
129
- query_parameters['key'] = @api_key
130
- query_parameters['ln_Access_Token'] = ln__access__token
131
-
132
- resource_path = 'api/v2/access_token/linkedin'
133
- get_request(resource_path, query_parameters, nil)
134
- end
135
-
136
- # The API is used to get LoginRadius access token by sending Foursquare's access token. It will be valid for the specific duration of time specified in the response.
137
- #
138
- # @param fs__access__token - Foursquare Access Token
139
- #
140
- # @return Response containing Definition of Complete Token data
141
- # 20.8
142
- def get_access_token_by_foursquare_access_token(fs__access__token)
143
- if isNullOrWhiteSpace(fs__access__token)
144
- raise LoginRadius::Error.new, getValidationMessage('fs__access__token')
145
- end
146
-
147
- query_parameters = {}
148
- query_parameters['fs_Access_Token'] = fs__access__token
149
- query_parameters['key'] = @api_key
150
-
151
- resource_path = 'api/v2/access_token/foursquare'
152
- get_request(resource_path, query_parameters, nil)
153
- end
154
-
155
- # The API is used to get LoginRadius access token by sending Vkontakte's access token. It will be valid for the specific duration of time specified in the response.
156
- #
157
- # @param vk_access_token - Vkontakte Access Token
158
- #
159
- # @return Response containing Definition of Complete Token data
160
- # 20.15
161
- def get_access_token_by_vkontakte_access_token(vk_access_token)
162
- if isNullOrWhiteSpace(vk_access_token)
163
- raise LoginRadius::Error.new, getValidationMessage('vk_access_token')
164
- end
165
-
166
- query_parameters = {}
167
- query_parameters['key'] = @api_key
168
- query_parameters['vk_access_token'] = vk_access_token
169
-
170
- resource_path = 'api/v2/access_token/vkontakte'
171
- get_request(resource_path, query_parameters, nil)
172
- end
173
-
174
- # The API is used to get LoginRadius access token by sending Google's AuthCode. It will be valid for the specific duration of time specified in the response.
175
- #
176
- # @param google_authcode - Google AuthCode
177
- #
178
- # @return Response containing Definition of Complete Token data
179
- # 20.16
180
- def get_access_token_by_google_auth_code(google_authcode)
181
- if isNullOrWhiteSpace(google_authcode)
182
- raise LoginRadius::Error.new, getValidationMessage('google_authcode')
183
- end
184
-
185
- query_parameters = {}
186
- query_parameters['apiKey'] = @api_key
187
- query_parameters['google_authcode'] = google_authcode
188
-
189
- resource_path = 'api/v2/access_token/google'
190
- get_request(resource_path, query_parameters, nil)
191
- end
192
- end
193
- 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
+ # NativeSocialApi module
9
+ class NativeSocialApi
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
+ # The API is used to get LoginRadius access token by sending Facebook's access token. It will be valid for the specific duration of time specified in the response.
29
+ #
30
+ # @param fb__access__token - Facebook Access Token
31
+ # @param social_app_name - Name of Social provider APP
32
+ #
33
+ # @return Response containing Definition of Complete Token data
34
+ # 20.3
35
+ def get_access_token_by_facebook_access_token(fb__access__token, social_app_name = '')
36
+ if isNullOrWhiteSpace(fb__access__token)
37
+ raise LoginRadius::Error.new, getValidationMessage('fb__access__token')
38
+ end
39
+
40
+ query_parameters = {}
41
+ query_parameters['fb_Access_Token'] = fb__access__token
42
+ query_parameters['key'] = @api_key
43
+ unless isNullOrWhiteSpace(social_app_name)
44
+ query_parameters['socialAppName'] = social_app_name
45
+ end
46
+
47
+ resource_path = 'api/v2/access_token/facebook'
48
+ get_request(resource_path, query_parameters, {})
49
+ end
50
+
51
+ # The API is used to get LoginRadius access token by sending Twitter's access token. It will be valid for the specific duration of time specified in the response.
52
+ #
53
+ # @param tw__access__token - Twitter Access Token
54
+ # @param tw__token__secret - Twitter Token Secret
55
+ # @param social_app_name - Name of Social provider APP
56
+ #
57
+ # @return Response containing Definition of Complete Token data
58
+ # 20.4
59
+ def get_access_token_by_twitter_access_token(tw__access__token, tw__token__secret, social_app_name = '')
60
+ if isNullOrWhiteSpace(tw__access__token)
61
+ raise LoginRadius::Error.new, getValidationMessage('tw__access__token')
62
+ end
63
+ if isNullOrWhiteSpace(tw__token__secret)
64
+ raise LoginRadius::Error.new, getValidationMessage('tw__token__secret')
65
+ end
66
+
67
+ query_parameters = {}
68
+ query_parameters['key'] = @api_key
69
+ query_parameters['tw_Access_Token'] = tw__access__token
70
+ query_parameters['tw_Token_Secret'] = tw__token__secret
71
+ unless isNullOrWhiteSpace(social_app_name)
72
+ query_parameters['socialAppName'] = social_app_name
73
+ end
74
+
75
+ resource_path = 'api/v2/access_token/twitter'
76
+ get_request(resource_path, query_parameters, {})
77
+ end
78
+
79
+ # The API is used to get LoginRadius access token by sending Google's access token. It will be valid for the specific duration of time specified in the response.
80
+ #
81
+ # @param google__access__token - Google Access Token
82
+ # @param client_id - Google Client ID
83
+ # @param refresh_token - LoginRadius refresh token
84
+ # @param social_app_name - Name of Social provider APP
85
+ #
86
+ # @return Response containing Definition of Complete Token data
87
+ # 20.5
88
+ def get_access_token_by_google_access_token(google__access__token, client_id = '', refresh_token = '', social_app_name = '')
89
+ if isNullOrWhiteSpace(google__access__token)
90
+ raise LoginRadius::Error.new, getValidationMessage('google__access__token')
91
+ end
92
+
93
+ query_parameters = {}
94
+ query_parameters['google_Access_Token'] = google__access__token
95
+ query_parameters['key'] = @api_key
96
+ unless isNullOrWhiteSpace(client_id)
97
+ query_parameters['client_id'] = client_id
98
+ end
99
+ unless isNullOrWhiteSpace(refresh_token)
100
+ query_parameters['refresh_token'] = refresh_token
101
+ end
102
+ unless isNullOrWhiteSpace(social_app_name)
103
+ query_parameters['socialAppName'] = social_app_name
104
+ end
105
+
106
+ resource_path = 'api/v2/access_token/google'
107
+ get_request(resource_path, query_parameters, {})
108
+ end
109
+
110
+ # This API is used to Get LoginRadius Access Token using google jwt id token for google native mobile login/registration.
111
+ #
112
+ # @param id__token - Google JWT id_token
113
+ #
114
+ # @return Response containing Definition of Complete Token data
115
+ # 20.6
116
+ def get_access_token_by_google_j_w_t_access_token(id__token)
117
+ if isNullOrWhiteSpace(id__token)
118
+ raise LoginRadius::Error.new, getValidationMessage('id__token')
119
+ end
120
+
121
+ query_parameters = {}
122
+ query_parameters['id_Token'] = id__token
123
+ query_parameters['key'] = @api_key
124
+
125
+ resource_path = 'api/v2/access_token/googlejwt'
126
+ get_request(resource_path, query_parameters, {})
127
+ end
128
+
129
+ # The API is used to get LoginRadius access token by sending Linkedin's access token. It will be valid for the specific duration of time specified in the response.
130
+ #
131
+ # @param ln__access__token - Linkedin Access Token
132
+ # @param social_app_name - Name of Social provider APP
133
+ #
134
+ # @return Response containing Definition of Complete Token data
135
+ # 20.7
136
+ def get_access_token_by_linkedin_access_token(ln__access__token, social_app_name = '')
137
+ if isNullOrWhiteSpace(ln__access__token)
138
+ raise LoginRadius::Error.new, getValidationMessage('ln__access__token')
139
+ end
140
+
141
+ query_parameters = {}
142
+ query_parameters['key'] = @api_key
143
+ query_parameters['ln_Access_Token'] = ln__access__token
144
+ unless isNullOrWhiteSpace(social_app_name)
145
+ query_parameters['socialAppName'] = social_app_name
146
+ end
147
+
148
+ resource_path = 'api/v2/access_token/linkedin'
149
+ get_request(resource_path, query_parameters, {})
150
+ end
151
+
152
+ # The API is used to get LoginRadius access token by sending Foursquare's access token. It will be valid for the specific duration of time specified in the response.
153
+ #
154
+ # @param fs__access__token - Foursquare Access Token
155
+ #
156
+ # @return Response containing Definition of Complete Token data
157
+ # 20.8
158
+ def get_access_token_by_foursquare_access_token(fs__access__token)
159
+ if isNullOrWhiteSpace(fs__access__token)
160
+ raise LoginRadius::Error.new, getValidationMessage('fs__access__token')
161
+ end
162
+
163
+ query_parameters = {}
164
+ query_parameters['fs_Access_Token'] = fs__access__token
165
+ query_parameters['key'] = @api_key
166
+
167
+ resource_path = 'api/v2/access_token/foursquare'
168
+ get_request(resource_path, query_parameters, {})
169
+ end
170
+
171
+ # The API is used to get LoginRadius access token by sending a valid Apple ID OAuth Code. It will be valid for the specific duration of time specified in the response.
172
+ #
173
+ # @param code - Apple Code
174
+ # @param social_app_name - Name of Social provider APP
175
+ #
176
+ # @return Response containing Definition of Complete Token data
177
+ # 20.12
178
+ def get_access_token_by_apple_id_code(code, social_app_name = '')
179
+ if isNullOrWhiteSpace(code)
180
+ raise LoginRadius::Error.new, getValidationMessage('code')
181
+ end
182
+
183
+ query_parameters = {}
184
+ query_parameters['code'] = code
185
+ query_parameters['key'] = @api_key
186
+ unless isNullOrWhiteSpace(social_app_name)
187
+ query_parameters['socialAppName'] = social_app_name
188
+ end
189
+
190
+ resource_path = 'api/v2/access_token/apple'
191
+ get_request(resource_path, query_parameters, {})
192
+ end
193
+
194
+ # This API is used to retrieve a LoginRadius access token by passing in a valid WeChat OAuth Code.
195
+ #
196
+ # @param code - WeChat Code
197
+ #
198
+ # @return Response containing Definition of Complete Token data
199
+ # 20.13
200
+ def get_access_token_by_we_chat_code(code)
201
+ if isNullOrWhiteSpace(code)
202
+ raise LoginRadius::Error.new, getValidationMessage('code')
203
+ end
204
+
205
+ query_parameters = {}
206
+ query_parameters['code'] = code
207
+ query_parameters['key'] = @api_key
208
+
209
+ resource_path = 'api/v2/access_token/wechat'
210
+ get_request(resource_path, query_parameters, {})
211
+ end
212
+
213
+ # The API is used to get LoginRadius access token by sending Vkontakte's access token. It will be valid for the specific duration of time specified in the response.
214
+ #
215
+ # @param vk_access_token - Vkontakte Access Token
216
+ #
217
+ # @return Response containing Definition of Complete Token data
218
+ # 20.15
219
+ def get_access_token_by_vkontakte_access_token(vk_access_token)
220
+ if isNullOrWhiteSpace(vk_access_token)
221
+ raise LoginRadius::Error.new, getValidationMessage('vk_access_token')
222
+ end
223
+
224
+ query_parameters = {}
225
+ query_parameters['key'] = @api_key
226
+ query_parameters['vk_access_token'] = vk_access_token
227
+
228
+ resource_path = 'api/v2/access_token/vkontakte'
229
+ get_request(resource_path, query_parameters, {})
230
+ end
231
+
232
+ # The API is used to get LoginRadius access token by sending Google's AuthCode. It will be valid for the specific duration of time specified in the response.
233
+ #
234
+ # @param google_authcode - Google AuthCode
235
+ # @param social_app_name - Name of Social provider APP
236
+ #
237
+ # @return Response containing Definition of Complete Token data
238
+ # 20.16
239
+ def get_access_token_by_google_auth_code(google_authcode, social_app_name = '')
240
+ if isNullOrWhiteSpace(google_authcode)
241
+ raise LoginRadius::Error.new, getValidationMessage('google_authcode')
242
+ end
243
+
244
+ query_parameters = {}
245
+ query_parameters['apiKey'] = @api_key
246
+ query_parameters['google_authcode'] = google_authcode
247
+ unless isNullOrWhiteSpace(social_app_name)
248
+ query_parameters['socialAppName'] = social_app_name
249
+ end
250
+
251
+ resource_path = 'api/v2/access_token/google'
252
+ get_request(resource_path, query_parameters, {})
253
+ end
254
+ end
255
+ end