Skip to content

Commit 4d4ba08

Browse files
Version 10.0.0
1 parent f296282 commit 4d4ba08

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3130
-877
lines changed

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
lib-cov
2+
*.seed
3+
*.log
4+
*.csv
5+
*.dat
6+
*.out
7+
*.pid
8+
*.gz
9+
10+
pids
11+
logs
12+
results
13+
14+
npm-debug.log
15+
prepros.cfg
16+
.DS_Store
17+
.idea/
18+
19+
/nbproject/private/
20+
nbproject/project.properties
21+
nbproject/project.xml
22+
/sdk-node-js-customer-identity/nbproject/private/
23+
__pycache__/
24+
*.py[cod]
25+
*$py.class
26+
27+
.installed.cfg
28+
bin
29+
develop-eggs
30+
dist
31+
downloads
32+
eggs
33+
parts
34+
src/*.egg-info
35+
lib64

CHANGELOG.md

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,81 @@
11
# LoginRadius Python SDK Change Log
22

3-
# Version 10.0.0-beta
3+
# Version 10.0.0
4+
Release on **September 30,2019**
5+
46
## Enhancements
5-
This beta version release includes major changes with several improvements and optimizations :
7+
This full version release includes major breaking changes with several improvements and optimizations :
8+
9+
- Enhanced the coding standards of SDK to follow industry programming styles and best practices.
10+
- Enhanced security standards of SDK.
11+
- Reduced code between the business layer and persistence layer for optimization of SDK performance.
12+
- Added internal parameter validations in the API function.
13+
- ApiKey and ApiSecret usage redundancy removed.
14+
- All LoginRadius related features need to be defined once only and SDK will handle them automatically.
15+
- Improved the naming conventions of API functions for better readability.
16+
- Better Exception Handling for LoginRadius API Response in SDK.
17+
- Revamped complete SDK and restructured it with latest API function names and parameters.
18+
- Added detailed description to API functions and parameters for better understanding.
19+
- Updated the demo according to latest SDK changes.
20+
- Implemented API Region Feature.
21+
- Added PIN Authentication feature APIs.
22+
- Added Consent Management feature APIs.
23+
- Added Local SOTT generation
24+
25+
26+
## Added new multiple APIs for better user experience
27+
28+
- Update Phone ID by UID
29+
- Upsert Email
30+
- Role Context profile
31+
- MFA Resend OTP
32+
- User Registration By Captcha
33+
- Get Access Token via Linkedin Token
34+
- Get Access Token By Foursquare Access Token
35+
- Get Active Session By Account Id
36+
- Get Active Session By Profile Id
37+
- Delete User Profiles By Email
38+
- Verify Multifactor OTP Authentication
39+
- Verify Multifactor Password Authentication
40+
- Verify Multifactor PIN Authentication
41+
- Update UID
42+
- MFA Re-authentication by PIN
43+
- PIN Login
44+
- Forgot PIN By Email
45+
- Forgot PIN By UserName
46+
- Reset PIN By ResetToken
47+
- Reset PIN By SecurityAnswer And Email
48+
- Reset PIN By SecurityAnswer And Username
49+
- Reset PIN By SecurityAnswer And Phone
50+
- Forgot PIN By Phone
51+
- Change PIN By Token
52+
- Reset PIN by Phone and OTP
53+
- Reset PIN by Email and OTP
54+
- Reset PIN by Username and OTP
55+
- Set PIN By PinAuthToken
56+
- Invalidate PIN Session Token
57+
- Submit Consent By ConsentToken
58+
- Get Consent Logs
59+
- Submit Consent By AccessToken
60+
- Verify Consent By AccessToken
61+
- Update Consent Profile By AccessToken
62+
- Get Consent Logs By Uid
63+
- Album With Cursor
64+
- Audio With Cursor
65+
- Check In With Cursor
66+
- Event With Cursor
67+
- Following With Cursor
68+
- Group With Cursor
69+
- Like With Cursor
70+
71+
72+
## Removed APIs:
73+
74+
- GetCompanies API
75+
- Getstatus API
76+
77+
# Version 10.0.0-beta
78+
## This beta version release includes major changes with several improvements and optimizations :
679
- Enhanced the coding standards of SDK to follow industry programming styles and best practices.
780
- Enhanced security standards of SDK.
881
- Reduced code between the business layer and persistence layer for optimization of SDK performance.

Demo/LoginRadius/api/__init__.py

Whitespace-only changes.

Demo/LoginRadius/api/account/__init__.py

Whitespace-only changes.

Demo/LoginRadius/api/account/account_api.py

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -- coding: utf-8 --
2-
# Created by LoginRadius Development Team
2+
# Created by LoginRadius Development Team
33
# Copyright 2019 LoginRadius Inc. All rights reserved.
44
#
55

@@ -315,7 +315,7 @@ def invalidate_account_email_verification(self, uid, email_template='', verifica
315315
return self._lr_object.execute("PUT", resource_path, query_parameters, None)
316316

317317
def get_forgot_password_token(self, email, email_template=None, reset_password_url=None,
318-
send_email=False):
318+
send_email=None):
319319
"""This API Returns a Forgot Password Token it can also be used to send a Forgot Password email to the customer. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' in the body.
320320
321321
Args:
@@ -544,3 +544,50 @@ def get_account_identities_by_email(self, email, fields=''):
544544

545545
resource_path = "identity/v2/manage/account/identities"
546546
return self._lr_object.execute("GET", resource_path, query_parameters, None)
547+
548+
def account_delete_by_email(self, email):
549+
"""This API is used to delete all user profiles associated with an Email.
550+
551+
Args:
552+
email: Email of the user
553+
554+
Returns:
555+
Response containing Definition of Delete Request
556+
18.36
557+
"""
558+
559+
if(self._lr_object.is_null_or_whitespace(email)):
560+
raise Exception(self._lr_object.get_validation_message("email"))
561+
562+
query_parameters = {}
563+
query_parameters["apiKey"] = self._lr_object.get_api_key()
564+
query_parameters["apiSecret"] = self._lr_object.get_api_secret()
565+
query_parameters["email"] = email
566+
567+
resource_path = "identity/v2/manage/account"
568+
return self._lr_object.execute("DELETE", resource_path, query_parameters, None)
569+
570+
def account_update_uid(self, update_uid_model, uid):
571+
"""This API is used to update a user's Uid. It will update all profiles, custom objects and consent management logs associated with the Uid.
572+
573+
Args:
574+
update_uid_model: Payload containing Update UID
575+
uid: UID, the unified identifier for each user account
576+
577+
Returns:
578+
Response containing Definition of Complete Validation data
579+
18.41
580+
"""
581+
if(update_uid_model is None):
582+
raise Exception(self._lr_object.get_validation_message("update_uid_model"))
583+
584+
if(self._lr_object.is_null_or_whitespace(uid)):
585+
raise Exception(self._lr_object.get_validation_message("uid"))
586+
587+
query_parameters = {}
588+
query_parameters["apiKey"] = self._lr_object.get_api_key()
589+
query_parameters["apiSecret"] = self._lr_object.get_api_secret()
590+
query_parameters["uid"] = uid
591+
592+
resource_path = "identity/v2/manage/account/uid"
593+
return self._lr_object.execute("PUT", resource_path, query_parameters, update_uid_model)

Demo/LoginRadius/api/account/role_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -- coding: utf-8 --
2-
# Created by LoginRadius Development Team
2+
# Created by LoginRadius Development Team
33
# Copyright 2019 LoginRadius Inc. All rights reserved.
44
#
55

Demo/LoginRadius/api/account/sott_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -- coding: utf-8 --
2-
# Created by LoginRadius Development Team
2+
# Created by LoginRadius Development Team
33
# Copyright 2019 LoginRadius Inc. All rights reserved.
44
#
55

Demo/LoginRadius/api/advanced/__init__.py

Whitespace-only changes.

Demo/LoginRadius/api/advanced/configuration_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -- coding: utf-8 --
2-
# Created by LoginRadius Development Team
2+
# Created by LoginRadius Development Team
33
# Copyright 2019 LoginRadius Inc. All rights reserved.
44
#
55

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# -- coding: utf-8 --
2+
# Created by LoginRadius Development Team
3+
# Copyright 2019 LoginRadius Inc. All rights reserved.
4+
#
5+
6+
7+
class ConsentManagementApi:
8+
9+
def __init__(self, lr_object):
10+
"""
11+
:param lr_object: this is the reference to the parent LoginRadius object.
12+
"""
13+
self._lr_object = lr_object
14+
15+
def get_consent_logs_by_uid(self, uid):
16+
"""This API is used to get the Consent logs of the user.
17+
18+
Args:
19+
uid: UID, the unified identifier for each user account
20+
21+
Returns:
22+
Response containing consent logs
23+
18.37
24+
"""
25+
26+
if(self._lr_object.is_null_or_whitespace(uid)):
27+
raise Exception(self._lr_object.get_validation_message("uid"))
28+
29+
query_parameters = {}
30+
query_parameters["apiKey"] = self._lr_object.get_api_key()
31+
query_parameters["apiSecret"] = self._lr_object.get_api_secret()
32+
33+
resource_path = "identity/v2/manage/account/" + uid + "/consent/logs"
34+
return self._lr_object.execute("GET", resource_path, query_parameters, None)
35+
36+
def submit_consent_by_consent_token(self, consent_token, consent_submit_model):
37+
"""This API is to submit consent form using consent token.
38+
39+
Args:
40+
consent_token: The consent token received after login error 1226
41+
consent_submit_model: Model class containing list of multiple consent
42+
43+
Returns:
44+
Response containing User Profile Data and access token
45+
43.1
46+
"""
47+
48+
if(self._lr_object.is_null_or_whitespace(consent_token)):
49+
raise Exception(self._lr_object.get_validation_message("consent_token"))
50+
if(consent_submit_model is None):
51+
raise Exception(self._lr_object.get_validation_message("consent_submit_model"))
52+
53+
query_parameters = {}
54+
query_parameters["apiKey"] = self._lr_object.get_api_key()
55+
query_parameters["consentToken"] = consent_token
56+
57+
resource_path = "identity/v2/auth/consent"
58+
return self._lr_object.execute("POST", resource_path, query_parameters, consent_submit_model)
59+
60+
def get_consent_logs(self, access_token):
61+
"""This API is used to fetch consent logs.
62+
63+
Args:
64+
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
65+
66+
Returns:
67+
Response containing consent logs
68+
43.2
69+
"""
70+
71+
if(self._lr_object.is_null_or_whitespace(access_token)):
72+
raise Exception(self._lr_object.get_validation_message("access_token"))
73+
74+
query_parameters = {}
75+
query_parameters["access_token"] = access_token
76+
query_parameters["apiKey"] = self._lr_object.get_api_key()
77+
78+
resource_path = "identity/v2/auth/consent/logs"
79+
return self._lr_object.execute("GET", resource_path, query_parameters, None)
80+
81+
def submit_consent_by_access_token(self, access_token, consent_submit_model):
82+
"""API to provide a way to end user to submit a consent form for particular event type.
83+
84+
Args:
85+
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
86+
consent_submit_model: Model class containing list of multiple consent
87+
88+
Returns:
89+
Response containing Definition for Complete profile data
90+
43.3
91+
"""
92+
93+
if(self._lr_object.is_null_or_whitespace(access_token)):
94+
raise Exception(self._lr_object.get_validation_message("access_token"))
95+
if(consent_submit_model is None):
96+
raise Exception(self._lr_object.get_validation_message("consent_submit_model"))
97+
98+
query_parameters = {}
99+
query_parameters["access_token"] = access_token
100+
query_parameters["apiKey"] = self._lr_object.get_api_key()
101+
102+
resource_path = "identity/v2/auth/consent/profile"
103+
return self._lr_object.execute("POST", resource_path, query_parameters, consent_submit_model)
104+
105+
def verify_consent_by_access_token(self, access_token, event, is_custom):
106+
"""This API is used to check if consent is submitted for a particular event or not.
107+
108+
Args:
109+
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
110+
event: Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject
111+
is_custom: true/false
112+
113+
Returns:
114+
Response containing consent profile
115+
43.4
116+
"""
117+
118+
if(self._lr_object.is_null_or_whitespace(access_token)):
119+
raise Exception(self._lr_object.get_validation_message("access_token"))
120+
121+
if(self._lr_object.is_null_or_whitespace(event)):
122+
raise Exception(self._lr_object.get_validation_message("event"))
123+
124+
query_parameters = {}
125+
query_parameters["access_token"] = access_token
126+
query_parameters["apiKey"] = self._lr_object.get_api_key()
127+
query_parameters["event"] = event
128+
query_parameters["isCustom"] = is_custom
129+
130+
resource_path = "identity/v2/auth/consent/verify"
131+
return self._lr_object.execute("GET", resource_path, query_parameters, None)
132+
133+
def update_consent_profile_by_access_token(self, access_token, consent_update_model):
134+
"""This API is to update consents using access token.
135+
136+
Args:
137+
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
138+
consent_update_model: Model class containg list of multiple consent
139+
140+
Returns:
141+
Response containing consent profile
142+
43.5
143+
"""
144+
145+
if(self._lr_object.is_null_or_whitespace(access_token)):
146+
raise Exception(self._lr_object.get_validation_message("access_token"))
147+
if(consent_update_model is None):
148+
raise Exception(self._lr_object.get_validation_message("consent_update_model"))
149+
150+
query_parameters = {}
151+
query_parameters["access_token"] = access_token
152+
query_parameters["apiKey"] = self._lr_object.get_api_key()
153+
154+
resource_path = "identity/v2/auth/consent"
155+
return self._lr_object.execute("PUT", resource_path, query_parameters, consent_update_model)

0 commit comments

Comments
 (0)