login_radius 10.0.0 → 11.0.0.pre.beta
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acd6cf80130b14a3d894315b99df6fc615854072353930e855d0254364344ab4
|
4
|
+
data.tar.gz: 81d9b55b614d46bd47bec007beb125c43f19643e87b0b51b73787da41a85773f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bc4d7aefa61fe26caeef7783aa2caf62d70ad69b894f40a7ed6faf504f430e3c99ddb1f2861a7735d936b42d067263182cbc2e6e72dff21b6ccb0810708baf8
|
7
|
+
data.tar.gz: e1cd22687f8039a0d04be244b5cb2bd4336c12116e0be4834ed6a6e49b3317e15a3f07d68ab9bf1b9e72f0189202b3a476b1b1042f467f303628f4e7ba2764eb
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Install the SDK by adding LoginRadius to your application's `Gemfile`.
|
4
4
|
|
5
5
|
```
|
6
|
-
gem 'login_radius', '
|
6
|
+
gem 'login_radius', '~> 11.0.0-beta'
|
7
7
|
```
|
8
8
|
|
9
9
|
Then, run `$ bundle`. A copy of the SDK can also be found on our [Github](https://github.com/LoginRadius/ruby-on-rails-gem/tree/master).
|
@@ -702,19 +702,23 @@ module LoginRadius
|
|
702
702
|
put_request(resource_path, query_parameters, body_parameters)
|
703
703
|
end
|
704
704
|
|
705
|
-
# This API is used to
|
705
|
+
# This API is used to unlink up a social provider account with the specified account based on the access token and the social providers user access token. The unlinked account will automatically get removed from your database.
|
706
706
|
#
|
707
707
|
# @param access_token - Access_Token
|
708
|
-
# @param
|
708
|
+
# @param provider - Name of the provider
|
709
|
+
# @param provider_id - Unique ID of the linked account
|
709
710
|
#
|
710
|
-
# @return Response containing Definition of
|
711
|
-
# 12.
|
712
|
-
def
|
711
|
+
# @return Response containing Definition of Delete Request
|
712
|
+
# 12.2
|
713
|
+
def unlink_social_identities(access_token, provider, provider_id)
|
713
714
|
if isNullOrWhiteSpace(access_token)
|
714
715
|
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
715
716
|
end
|
716
|
-
if isNullOrWhiteSpace(
|
717
|
-
raise LoginRadius::Error.new, getValidationMessage('
|
717
|
+
if isNullOrWhiteSpace(provider)
|
718
|
+
raise LoginRadius::Error.new, getValidationMessage('provider')
|
719
|
+
end
|
720
|
+
if isNullOrWhiteSpace(provider_id)
|
721
|
+
raise LoginRadius::Error.new, getValidationMessage('provider_id')
|
718
722
|
end
|
719
723
|
|
720
724
|
query_parameters = {}
|
@@ -722,29 +726,26 @@ module LoginRadius
|
|
722
726
|
query_parameters['apiKey'] = @api_key
|
723
727
|
|
724
728
|
body_parameters = {}
|
725
|
-
body_parameters['
|
729
|
+
body_parameters['provider'] = provider
|
730
|
+
body_parameters['providerId'] = provider_id
|
726
731
|
|
727
732
|
resource_path = 'identity/v2/auth/socialidentity'
|
728
|
-
|
733
|
+
delete_request(resource_path, query_parameters, body_parameters)
|
729
734
|
end
|
730
735
|
|
731
|
-
# This API is used to
|
736
|
+
# This API is used to link up a social provider account with an existing LoginRadius account on the basis of access token and the social providers user access token.
|
732
737
|
#
|
733
|
-
# @param access_token -
|
734
|
-
# @param
|
735
|
-
# @param provider_id - Unique ID of the linked account
|
738
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
739
|
+
# @param candidate_token - Access token of the account to be linked
|
736
740
|
#
|
737
|
-
# @return Response containing Definition of
|
738
|
-
# 12.
|
739
|
-
def
|
741
|
+
# @return Response containing Definition of Complete Validation data
|
742
|
+
# 12.4
|
743
|
+
def link_social_identities(access_token, candidate_token)
|
740
744
|
if isNullOrWhiteSpace(access_token)
|
741
745
|
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
742
746
|
end
|
743
|
-
if isNullOrWhiteSpace(
|
744
|
-
raise LoginRadius::Error.new, getValidationMessage('
|
745
|
-
end
|
746
|
-
if isNullOrWhiteSpace(provider_id)
|
747
|
-
raise LoginRadius::Error.new, getValidationMessage('provider_id')
|
747
|
+
if isNullOrWhiteSpace(candidate_token)
|
748
|
+
raise LoginRadius::Error.new, getValidationMessage('candidate_token')
|
748
749
|
end
|
749
750
|
|
750
751
|
query_parameters = {}
|
@@ -752,34 +753,36 @@ module LoginRadius
|
|
752
753
|
query_parameters['apiKey'] = @api_key
|
753
754
|
|
754
755
|
body_parameters = {}
|
755
|
-
body_parameters['
|
756
|
-
body_parameters['providerId'] = provider_id
|
756
|
+
body_parameters['candidateToken'] = candidate_token
|
757
757
|
|
758
758
|
resource_path = 'identity/v2/auth/socialidentity'
|
759
|
-
|
759
|
+
post_request(resource_path, query_parameters, body_parameters)
|
760
760
|
end
|
761
761
|
|
762
|
-
# This API is
|
762
|
+
# This API is used to link up a social provider account with an existing LoginRadius account on the basis of ping and the social providers user access token.
|
763
763
|
#
|
764
764
|
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
765
|
-
# @param
|
765
|
+
# @param client_guid - Unique ID generated by client
|
766
766
|
#
|
767
|
-
# @return Response containing Definition
|
768
|
-
# 12.
|
769
|
-
def
|
767
|
+
# @return Response containing Definition of Complete Validation data
|
768
|
+
# 12.5
|
769
|
+
def link_social_identities_by_ping(access_token, client_guid)
|
770
770
|
if isNullOrWhiteSpace(access_token)
|
771
771
|
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
772
772
|
end
|
773
|
+
if isNullOrWhiteSpace(client_guid)
|
774
|
+
raise LoginRadius::Error.new, getValidationMessage('client_guid')
|
775
|
+
end
|
773
776
|
|
774
777
|
query_parameters = {}
|
775
778
|
query_parameters['access_token'] = access_token
|
776
779
|
query_parameters['apiKey'] = @api_key
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
+
|
781
|
+
body_parameters = {}
|
782
|
+
body_parameters['clientGuid'] = client_guid
|
780
783
|
|
781
784
|
resource_path = 'identity/v2/auth/socialidentity'
|
782
|
-
|
785
|
+
post_request(resource_path, query_parameters, body_parameters)
|
783
786
|
end
|
784
787
|
|
785
788
|
# This API is used to set or change UserName by access token.
|
@@ -28,10 +28,11 @@ module LoginRadius
|
|
28
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
29
|
#
|
30
30
|
# @param fb__access__token - Facebook Access Token
|
31
|
+
# @param social_app_name - Name of Social provider APP
|
31
32
|
#
|
32
33
|
# @return Response containing Definition of Complete Token data
|
33
34
|
# 20.3
|
34
|
-
def get_access_token_by_facebook_access_token(fb__access__token)
|
35
|
+
def get_access_token_by_facebook_access_token(fb__access__token, social_app_name = '')
|
35
36
|
if isNullOrWhiteSpace(fb__access__token)
|
36
37
|
raise LoginRadius::Error.new, getValidationMessage('fb__access__token')
|
37
38
|
end
|
@@ -39,6 +40,9 @@ module LoginRadius
|
|
39
40
|
query_parameters = {}
|
40
41
|
query_parameters['fb_Access_Token'] = fb__access__token
|
41
42
|
query_parameters['key'] = @api_key
|
43
|
+
unless isNullOrWhiteSpace(social_app_name)
|
44
|
+
query_parameters['socialAppName'] = social_app_name
|
45
|
+
end
|
42
46
|
|
43
47
|
resource_path = 'api/v2/access_token/facebook'
|
44
48
|
get_request(resource_path, query_parameters, nil)
|
@@ -48,10 +52,11 @@ module LoginRadius
|
|
48
52
|
#
|
49
53
|
# @param tw__access__token - Twitter Access Token
|
50
54
|
# @param tw__token__secret - Twitter Token Secret
|
55
|
+
# @param social_app_name - Name of Social provider APP
|
51
56
|
#
|
52
57
|
# @return Response containing Definition of Complete Token data
|
53
58
|
# 20.4
|
54
|
-
def get_access_token_by_twitter_access_token(tw__access__token, tw__token__secret)
|
59
|
+
def get_access_token_by_twitter_access_token(tw__access__token, tw__token__secret, social_app_name = '')
|
55
60
|
if isNullOrWhiteSpace(tw__access__token)
|
56
61
|
raise LoginRadius::Error.new, getValidationMessage('tw__access__token')
|
57
62
|
end
|
@@ -63,6 +68,9 @@ module LoginRadius
|
|
63
68
|
query_parameters['key'] = @api_key
|
64
69
|
query_parameters['tw_Access_Token'] = tw__access__token
|
65
70
|
query_parameters['tw_Token_Secret'] = tw__token__secret
|
71
|
+
unless isNullOrWhiteSpace(social_app_name)
|
72
|
+
query_parameters['socialAppName'] = social_app_name
|
73
|
+
end
|
66
74
|
|
67
75
|
resource_path = 'api/v2/access_token/twitter'
|
68
76
|
get_request(resource_path, query_parameters, nil)
|
@@ -73,10 +81,11 @@ module LoginRadius
|
|
73
81
|
# @param google__access__token - Google Access Token
|
74
82
|
# @param client_id - Google Client ID
|
75
83
|
# @param refresh_token - LoginRadius refresh token
|
84
|
+
# @param social_app_name - Name of Social provider APP
|
76
85
|
#
|
77
86
|
# @return Response containing Definition of Complete Token data
|
78
87
|
# 20.5
|
79
|
-
def get_access_token_by_google_access_token(google__access__token, client_id = '', refresh_token = '')
|
88
|
+
def get_access_token_by_google_access_token(google__access__token, client_id = '', refresh_token = '', social_app_name = '')
|
80
89
|
if isNullOrWhiteSpace(google__access__token)
|
81
90
|
raise LoginRadius::Error.new, getValidationMessage('google__access__token')
|
82
91
|
end
|
@@ -90,6 +99,9 @@ module LoginRadius
|
|
90
99
|
unless isNullOrWhiteSpace(refresh_token)
|
91
100
|
query_parameters['refresh_token'] = refresh_token
|
92
101
|
end
|
102
|
+
unless isNullOrWhiteSpace(social_app_name)
|
103
|
+
query_parameters['socialAppName'] = social_app_name
|
104
|
+
end
|
93
105
|
|
94
106
|
resource_path = 'api/v2/access_token/google'
|
95
107
|
get_request(resource_path, query_parameters, nil)
|
@@ -117,10 +129,11 @@ module LoginRadius
|
|
117
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.
|
118
130
|
#
|
119
131
|
# @param ln__access__token - Linkedin Access Token
|
132
|
+
# @param social_app_name - Name of Social provider APP
|
120
133
|
#
|
121
134
|
# @return Response containing Definition of Complete Token data
|
122
135
|
# 20.7
|
123
|
-
def get_access_token_by_linkedin_access_token(ln__access__token)
|
136
|
+
def get_access_token_by_linkedin_access_token(ln__access__token, social_app_name = '')
|
124
137
|
if isNullOrWhiteSpace(ln__access__token)
|
125
138
|
raise LoginRadius::Error.new, getValidationMessage('ln__access__token')
|
126
139
|
end
|
@@ -128,6 +141,9 @@ module LoginRadius
|
|
128
141
|
query_parameters = {}
|
129
142
|
query_parameters['key'] = @api_key
|
130
143
|
query_parameters['ln_Access_Token'] = ln__access__token
|
144
|
+
unless isNullOrWhiteSpace(social_app_name)
|
145
|
+
query_parameters['socialAppName'] = social_app_name
|
146
|
+
end
|
131
147
|
|
132
148
|
resource_path = 'api/v2/access_token/linkedin'
|
133
149
|
get_request(resource_path, query_parameters, nil)
|
@@ -152,6 +168,48 @@ module LoginRadius
|
|
152
168
|
get_request(resource_path, query_parameters, nil)
|
153
169
|
end
|
154
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, nil)
|
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, nil)
|
211
|
+
end
|
212
|
+
|
155
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.
|
156
214
|
#
|
157
215
|
# @param vk_access_token - Vkontakte Access Token
|
@@ -174,10 +232,11 @@ module LoginRadius
|
|
174
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.
|
175
233
|
#
|
176
234
|
# @param google_authcode - Google AuthCode
|
235
|
+
# @param social_app_name - Name of Social provider APP
|
177
236
|
#
|
178
237
|
# @return Response containing Definition of Complete Token data
|
179
238
|
# 20.16
|
180
|
-
def get_access_token_by_google_auth_code(google_authcode)
|
239
|
+
def get_access_token_by_google_auth_code(google_authcode, social_app_name = '')
|
181
240
|
if isNullOrWhiteSpace(google_authcode)
|
182
241
|
raise LoginRadius::Error.new, getValidationMessage('google_authcode')
|
183
242
|
end
|
@@ -185,6 +244,9 @@ module LoginRadius
|
|
185
244
|
query_parameters = {}
|
186
245
|
query_parameters['apiKey'] = @api_key
|
187
246
|
query_parameters['google_authcode'] = google_authcode
|
247
|
+
unless isNullOrWhiteSpace(social_app_name)
|
248
|
+
query_parameters['socialAppName'] = social_app_name
|
249
|
+
end
|
188
250
|
|
189
251
|
resource_path = 'api/v2/access_token/google'
|
190
252
|
get_request(resource_path, query_parameters, nil)
|
@@ -48,10 +48,11 @@ module LoginRadius
|
|
48
48
|
#
|
49
49
|
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
50
50
|
# @param expires_in - Allows you to specify a desired expiration time in minutes for the newly issued access token.
|
51
|
+
# @param is_web - Is web or not.
|
51
52
|
#
|
52
53
|
# @return Response containing Definition of Complete Token data
|
53
54
|
# 20.2
|
54
|
-
def refresh_access_token(access_token, expires_in)
|
55
|
+
def refresh_access_token(access_token, expires_in, is_web = false)
|
55
56
|
if isNullOrWhiteSpace(access_token)
|
56
57
|
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
57
58
|
end
|
@@ -62,6 +63,9 @@ module LoginRadius
|
|
62
63
|
unless expires_in == false
|
63
64
|
query_parameters['expiresIn'] = expires_in
|
64
65
|
end
|
66
|
+
unless is_web == false
|
67
|
+
query_parameters['isWeb'] = is_web
|
68
|
+
end
|
65
69
|
|
66
70
|
resource_path = 'api/v2/access_token/refresh'
|
67
71
|
get_request(resource_path, query_parameters, nil)
|
data/lib/login_radius/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: login_radius
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 11.0.0.pre.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LoginRadius
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -87,9 +87,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
87
87
|
version: '0'
|
88
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
89
|
requirements:
|
90
|
-
- - "
|
90
|
+
- - ">"
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version:
|
92
|
+
version: 1.3.1
|
93
93
|
requirements: []
|
94
94
|
rubygems_version: 3.0.3
|
95
95
|
signing_key:
|