login_radius 2.0.0 → 3.0.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.
@@ -0,0 +1,191 @@
1
+ module LoginRadius
2
+ module Two_FA_Api
3
+
4
+
5
+
6
+ # ------------------------------------------------------------- Get API --------------------------------------------------------------------#
7
+
8
+
9
+ def validateGoogleAuthCode_2FA(secondfactorauthenticationtoken,googleauthenticatorcode)
10
+ return getRequest("identity/v2/auth/login/2fa/verification",{:apikey=> appkey,:secondfactorauthenticationtoken=> secondfactorauthenticationtoken,:googleauthenticatorcode=> googleauthenticatorcode},"api");
11
+ rescue LoginRadiusRaas::Exception => e
12
+ false
13
+ end
14
+
15
+
16
+ def validateOtp_2FA(secondfactorauthenticationtoken,otp,smstemplate2fa)
17
+ return getRequest("identity/v2/auth/login/2fa/verification",{:apikey=> appkey,:secondfactorauthenticationtoken=> secondfactorauthenticationtoken,:otp=> otp,:smstemplate2fa=> smstemplate2fa},"api");
18
+ rescue LoginRadiusRaas::Exception => e
19
+ false
20
+ end
21
+
22
+
23
+ def validateAccessToken_2FA(access_token,smstemplate2fa)
24
+ return getRequest("identity/v2/auth/account/2fa",{:apikey=> appkey,:access_token=> access_token,:smstemplate2fa=> smstemplate2fa},"api");
25
+ rescue LoginRadiusRaas::Exception => e
26
+ false
27
+ end
28
+
29
+
30
+ def validateBackupCode_2FA(secondfactorauthenticationtoken,backupcode)
31
+ return getRequest("identity/v2/auth/login/2fa/backupcode",{:apikey=> appkey,:secondfactorauthenticationtoken=> secondfactorauthenticationtoken,:backupcode=> backupcode},"api");
32
+ rescue LoginRadiusRaas::Exception => e
33
+ false
34
+ end
35
+
36
+
37
+ def getBackupCode_2FA(access_token)
38
+ return getRequest("identity/v2/auth/login/2fa/backupcode",{:apikey=> appkey,:access_token=> access_token},"api");
39
+ rescue LoginRadiusRaas::Exception => e
40
+ false
41
+ end
42
+
43
+
44
+ def resetBackupCode_2FA(access_token)
45
+ return getRequest("identity/v2/auth/account/2fa/backupcode/reset",{:apikey=> appkey,:access_token=> access_token},"api");
46
+ rescue LoginRadiusRaas::Exception => e
47
+ false
48
+ end
49
+
50
+ def getBackupCodeByUid_2FA(uid)
51
+ return getRequest("identity/v2/manage/account/2fa/backupcode",{:apikey=> appkey,:apisecret=>appsecret,:uid=> uid},"api");
52
+ rescue LoginRadiusRaas::Exception => e
53
+ false
54
+ end
55
+
56
+
57
+ def resetBackupCodeByUid_2FA(uid)
58
+ return getRequest("identity/v2/manage/account/2fa/backupcode/reset",{:apikey=> appkey,:apisecret=>appsecret,:uid=> uid},"api");
59
+ rescue LoginRadiusRaas::Exception => e
60
+ false
61
+ end
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+ # ------------------------------------------------------------- Post API --------------------------------------------------------------------#
71
+
72
+
73
+ def emailLogin_2FA(email,password,loginurl,verificationurl,emailtemplate,smstemplate2fa)
74
+ param = {
75
+ :apikey=> appkey,
76
+ :loginurl=> loginurl,
77
+ :verificationurl => verificationurl,
78
+ :emailtemplate=> emailtemplate,
79
+ :smstemplate2fa => smstemplate2fa
80
+ }
81
+ payload = {
82
+ :email=> email,
83
+ :password => password
84
+ }
85
+ return postRequest("identity/v2/auth/login/2fa",param,payload,nil,"api");
86
+ rescue LoginRadiusRaas::Exception => e
87
+ false
88
+ end
89
+
90
+
91
+
92
+
93
+ def usernameLogin_2FA(username,password,loginurl,verificationurl,emailtemplate,smstemplate2fa)
94
+ param = {
95
+ :apikey=> appkey,
96
+ :loginurl=> loginurl,
97
+ :verificationurl => verificationurl,
98
+ :emailtemplate=> emailtemplate,
99
+ :smstemplate2fa => smstemplate2fa
100
+ }
101
+ payload = {
102
+ :username=> username,
103
+ :password => password
104
+ }
105
+ return postRequest("identity/v2/auth/login/2fa",param,payload,nil,"api");
106
+ rescue LoginRadiusRaas::Exception => e
107
+ false
108
+ end
109
+
110
+
111
+
112
+ def phoneLogin_2FA(phone,password,loginurl,verificationurl,emailtemplate,smstemplate2fa)
113
+ param = {
114
+ :apikey=> appkey,
115
+ :loginurl=> loginurl,
116
+ :verificationurl => verificationurl,
117
+ :emailtemplate=> emailtemplate,
118
+ :smstemplate2fa => smstemplate2fa
119
+ }
120
+ payload = {
121
+ :phone=> phone,
122
+ :password => password
123
+ }
124
+ return postRequest("identity/v2/auth/login/2fa",param,payload,nil,"api");
125
+ rescue LoginRadiusRaas::Exception => e
126
+ false
127
+ end
128
+
129
+
130
+
131
+
132
+ # ------------------------------------------------------------- Put API --------------------------------------------------------------------#
133
+
134
+
135
+
136
+ def updatePhoneNumber_2FA(phoneno2fa,secondfactorauthenticationtoken,smstemplate2fa)
137
+ payload = {
138
+ :phoneno2fa=> phoneno2fa
139
+ }
140
+ return putRequest("identity/v2/auth/phone",{:apikey=> appkey,:secondfactorauthenticationtoken=> secondfactorauthenticationtoken,:smstemplate2fa=> smstemplate2fa},payload,"api");
141
+ rescue LoginRadiusRaas::Exception => e
142
+ false
143
+ end
144
+
145
+
146
+ def updatePhoneNumberByToken_2FA(phoneno2fa,access_token,smstemplate2fa)
147
+ payload = {
148
+ :phoneno2fa=> phoneno2fa
149
+ }
150
+ return putRequest("identity/v2/auth/phone",{:apikey=> appkey,:access_token=> access_token,:smstemplate2fa=> smstemplate2fa},payload,"api");
151
+ rescue LoginRadiusRaas::Exception => e
152
+ false
153
+ end
154
+
155
+
156
+
157
+
158
+ # ------------------------------------------------------------- Delete API --------------------------------------------------------------------#
159
+
160
+
161
+
162
+ def resetGoogleAuthenticatorByToken_2FA(access_token,payload)
163
+ return deleteRequest("identity/v2/auth/account/2fa/authenticator",{:apikey=> appkey,:access_token=> access_token},payload);
164
+ rescue LoginRadiusRaas::Exception => e
165
+ false
166
+ end
167
+
168
+
169
+ def resetSmsAuthenticatorByToken_2FA(access_token,payload)
170
+ return deleteRequest("identity/v2/auth/account/2fa/authenticator",{:apikey=> appkey,:access_token=> access_token},payload);
171
+ rescue LoginRadiusRaas::Exception => e
172
+ false
173
+ end
174
+
175
+
176
+ def resetGoogleAuthenticatorByUid_2FA(uid,payload)
177
+ return deleteRequest("identity/v2/manage/account/2fa/authenticator",{:apikey=> appkey,:apisecret=>appsecret,:uid=> uid},payload);
178
+ rescue LoginRadiusRaas::Exception => e
179
+ false
180
+ end
181
+
182
+ def resetSmsAuthenticatorByUid_2FA(uid,payload)
183
+ return deleteRequest("identity/v2/manage/account/2fa/authenticator",{:apikey=> appkey,:apisecret=>appsecret,:uid=> uid},payload);
184
+ rescue LoginRadiusRaas::Exception => e
185
+ false
186
+ end
187
+
188
+
189
+
190
+ end
191
+ end
@@ -1,3 +1,3 @@
1
- module LoginRadiusRaas
2
- VERSION = "2.0.0"
1
+ module LoginRadius
2
+ VERSION = "3.0.0"
3
3
  end
data/lib/login_radius.rb CHANGED
@@ -1,13 +1,15 @@
1
1
  require "login_radius/version"
2
- require "login_radius/user_api"
3
- require "login_radius/account_api"
4
- require "login_radius/basic_api"
5
- require "login_radius/custom_object_api"
2
+ require "login_radius/authentication_api"
3
+ require "login_radius/advanced_api"
4
+ require "login_radius/social_api"
5
+ require "login_radius/management_api"
6
+ require "login_radius/two_fa_api"
6
7
  require "login_radius/exception"
7
- require "login_radius/raas_api"
8
+ require "login_radius/rest_request"
8
9
  require "string"
9
10
  require "hash"
10
11
 
11
- module LoginRadiusRaas
12
+
13
+ module LoginRadius
12
14
 
13
15
  end
metadata CHANGED
@@ -1,18 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: login_radius
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - LoginRadius
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-12 00:00:00.000000000 Z
11
+ date: 2018-04-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Ruby wrapper for User Registration API
13
+ description: Ruby wrapper for LoginRadius API
14
14
  email:
15
- - hello@loginradius.com
15
+ - developers@loginradius.com
16
16
  executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
@@ -21,12 +21,13 @@ files:
21
21
  - README.md
22
22
  - lib/hash.rb
23
23
  - lib/login_radius.rb
24
- - lib/login_radius/account_api.rb
25
- - lib/login_radius/basic_api.rb
26
- - lib/login_radius/custom_object_api.rb
24
+ - lib/login_radius/advanced_api.rb
25
+ - lib/login_radius/authentication_api.rb
27
26
  - lib/login_radius/exception.rb
28
- - lib/login_radius/raas_api.rb
29
- - lib/login_radius/user_api.rb
27
+ - lib/login_radius/management_api.rb
28
+ - lib/login_radius/rest_request.rb
29
+ - lib/login_radius/social_api.rb
30
+ - lib/login_radius/two_fa_api.rb
30
31
  - lib/login_radius/version.rb
31
32
  - lib/string.rb
32
33
  homepage: https://www.loginradius.com
@@ -49,9 +50,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
50
  version: '0'
50
51
  requirements: []
51
52
  rubyforge_project:
52
- rubygems_version: 2.2.2
53
+ rubygems_version: 2.6.13
53
54
  signing_key:
54
55
  specification_version: 4
55
- summary: Is a ruby wrapper for User Registration API
56
+ summary: Is a ruby wrapper for LoginRadius API
56
57
  test_files: []
57
- has_rdoc:
@@ -1,130 +0,0 @@
1
- module LoginRadiusRaas
2
- module AccountApi
3
- #
4
- # This API is used to link a user account with a specified providers user account.
5
- #
6
- # params = {
7
- # :accountid => uid,
8
- # :provider => Provider Name,
9
- # :providerid => Social ID
10
- # }
11
- #
12
- # return {“isPosted”: “true”}
13
- #
14
- def account_link!(params)
15
- api_client("raas/v1/account/link", {}, params);
16
- end
17
-
18
- def account_link(params={})
19
- account_link!(params)
20
- rescue LoginRadiusRaas::Exception => e
21
- false
22
- end
23
-
24
- #
25
- # This API is used to unlink a user account with a specified providers user account.
26
- #
27
- # params = {
28
- # :accountid => uid,
29
- # :provider => Provider Name,
30
- # :providerid => Social ID
31
- # }
32
- #
33
- # return {“isPosted”: “true”}
34
- #
35
- def account_unlink!(params)
36
- api_client("raas/v1/account/unlink", {}, params);
37
- end
38
-
39
- def account_unlink(params={})
40
- account_unlink!(params)
41
- rescue LoginRadiusRaas::Exception => e
42
- false
43
- end
44
- #
45
- # This API is used to delete a user account
46
- #
47
- # accountid => uid;
48
- #
49
- # return {“isPosted”: “true”}
50
- #
51
- def account_delete!(accountid)
52
- api_client("raas/v1/account/delete", {:accountid=>accountid});
53
- end
54
-
55
- def account_delete(accountid)
56
- account_delete!(accountid)
57
- rescue LoginRadiusRaas::Exception => e
58
- false
59
- end
60
- #
61
- # This API is used to changed username for a user account
62
- #
63
- # accountid = uid
64
- # currentusername = currentusername
65
- # newusername = newusername
66
- #
67
- # return {“isPosted”: “true”}
68
- #
69
- def account_change_username!(uid,currentusername,newusername)
70
- api_client("raas/v1/account/changeusername", {:accountid=>uid},{:currentusername=>currentusername,:newusername=>newusername}, 'json');
71
- end
72
-
73
- def account_change_username(uid,currentusername,newusername)
74
- account_change_username!(uid,currentusername,newusername)
75
- rescue LoginRadiusRaas::Exception => e
76
- false
77
- end
78
- #
79
- # This API is used to set username for a user account
80
- #
81
- # accountid = uid
82
- # username = username
83
- #
84
- # return {“isPosted”: “true”}
85
- #
86
- def account_set_username!(uid,username)
87
- api_client("raas/v1/account/setusername", {:accountid=>uid},{:newusername=>username}, 'json');
88
- end
89
-
90
- def account_set_username(uid,username)
91
- account_set_username!(uid,username)
92
- rescue LoginRadiusRaas::Exception => e
93
- false
94
- end
95
- #
96
- # This API is used to check username for a user account
97
- #
98
- # username = username
99
- #
100
- # return {“isExist”: “true”}
101
- #
102
- def account_check_username!(username)
103
- api_client("raas/client/auth/checkusername",{:username=>username});
104
- end
105
-
106
- def account_check_username(username)
107
- account_check_username!(username)
108
- rescue LoginRadiusRaas::Exception => e
109
- false
110
- end
111
-
112
-
113
- #
114
- # This API is used to retrieve all of the profile data from each of the linked social provider accounts associated with the account. For ex: A user has linked facebook and google account then this api will retrieve both profile data.
115
- #
116
- # uid = xxxxxxxxxx;
117
- #
118
- # return Array of user profile
119
- #
120
- def account_get_profiles_by_uid!(uid)
121
- api_client("raas/v1/account", {:accountid=>uid});
122
- end
123
-
124
- def account_get_profiles_by_uid(uid)
125
- account_get_profiles_by_uid!(uid)
126
- rescue LoginRadiusRaas::Exception => e
127
- false
128
- end
129
- end
130
- end