diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..19a461b --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +npm-debug.log +prepros.cfg +.DS_Store +.idea/ + +/nbproject/private/ +nbproject/project.properties +nbproject/project.xml +/sdk-node-js-customer-identity/nbproject/private/ +__pycache__/ +*.py[cod] +*$py.class + +.installed.cfg +bin +develop-eggs +dist +downloads +eggs +parts +src/*.egg-info +lib64 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index fd46034..46b03a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,81 @@ # LoginRadius Python SDK Change Log -# Version 10.0.0-beta +# Version 10.0.0 +Release on **September 30,2019** + ## Enhancements -This beta version release includes major changes with several improvements and optimizations : +This full version release includes major breaking changes with several improvements and optimizations : + + - Enhanced the coding standards of SDK to follow industry programming styles and best practices. + - Enhanced security standards of SDK. + - Reduced code between the business layer and persistence layer for optimization of SDK performance. + - Added internal parameter validations in the API function. + - ApiKey and ApiSecret usage redundancy removed. + - All LoginRadius related features need to be defined once only and SDK will handle them automatically. + - Improved the naming conventions of API functions for better readability. + - Better Exception Handling for LoginRadius API Response in SDK. + - Revamped complete SDK and restructured it with latest API function names and parameters. + - Added detailed description to API functions and parameters for better understanding. + - Updated the demo according to latest SDK changes. + - Implemented API Region Feature. + - Added PIN Authentication feature APIs. + - Added Consent Management feature APIs. + - Added Local SOTT generation + + +## Added new multiple APIs for better user experience + + - Update Phone ID by UID + - Upsert Email + - Role Context profile + - MFA Resend OTP + - User Registration By Captcha + - Get Access Token via Linkedin Token + - Get Access Token By Foursquare Access Token + - Get Active Session By Account Id + - Get Active Session By Profile Id + - Delete User Profiles By Email + - Verify Multifactor OTP Authentication + - Verify Multifactor Password Authentication + - Verify Multifactor PIN Authentication + - Update UID + - MFA Re-authentication by PIN + - PIN Login + - Forgot PIN By Email + - Forgot PIN By UserName + - Reset PIN By ResetToken + - Reset PIN By SecurityAnswer And Email + - Reset PIN By SecurityAnswer And Username + - Reset PIN By SecurityAnswer And Phone + - Forgot PIN By Phone + - Change PIN By Token + - Reset PIN by Phone and OTP + - Reset PIN by Email and OTP + - Reset PIN by Username and OTP + - Set PIN By PinAuthToken + - Invalidate PIN Session Token + - Submit Consent By ConsentToken + - Get Consent Logs + - Submit Consent By AccessToken + - Verify Consent By AccessToken + - Update Consent Profile By AccessToken + - Get Consent Logs By Uid + - Album With Cursor + - Audio With Cursor + - Check In With Cursor + - Event With Cursor + - Following With Cursor + - Group With Cursor + - Like With Cursor + + +## Removed APIs: + + - GetCompanies API + - Getstatus API + +# Version 10.0.0-beta +## This beta version release includes major changes with several improvements and optimizations : - Enhanced the coding standards of SDK to follow industry programming styles and best practices. - Enhanced security standards of SDK. - Reduced code between the business layer and persistence layer for optimization of SDK performance. diff --git a/Demo/LoginRadius/api/__init__.py b/Demo/LoginRadius/api/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Demo/LoginRadius/api/account/__init__.py b/Demo/LoginRadius/api/account/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Demo/LoginRadius/api/account/account_api.py b/Demo/LoginRadius/api/account/account_api.py index 89a5b1f..37051c7 100644 --- a/Demo/LoginRadius/api/account/account_api.py +++ b/Demo/LoginRadius/api/account/account_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # @@ -315,7 +315,7 @@ def invalidate_account_email_verification(self, uid, email_template='', verifica return self._lr_object.execute("PUT", resource_path, query_parameters, None) def get_forgot_password_token(self, email, email_template=None, reset_password_url=None, - send_email=False): + send_email=None): """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. Args: @@ -544,3 +544,50 @@ def get_account_identities_by_email(self, email, fields=''): resource_path = "identity/v2/manage/account/identities" return self._lr_object.execute("GET", resource_path, query_parameters, None) + + def account_delete_by_email(self, email): + """This API is used to delete all user profiles associated with an Email. + + Args: + email: Email of the user + + Returns: + Response containing Definition of Delete Request + 18.36 + """ + + if(self._lr_object.is_null_or_whitespace(email)): + raise Exception(self._lr_object.get_validation_message("email")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["apiSecret"] = self._lr_object.get_api_secret() + query_parameters["email"] = email + + resource_path = "identity/v2/manage/account" + return self._lr_object.execute("DELETE", resource_path, query_parameters, None) + + def account_update_uid(self, update_uid_model, uid): + """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. + + Args: + update_uid_model: Payload containing Update UID + uid: UID, the unified identifier for each user account + + Returns: + Response containing Definition of Complete Validation data + 18.41 + """ + if(update_uid_model is None): + raise Exception(self._lr_object.get_validation_message("update_uid_model")) + + if(self._lr_object.is_null_or_whitespace(uid)): + raise Exception(self._lr_object.get_validation_message("uid")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["apiSecret"] = self._lr_object.get_api_secret() + query_parameters["uid"] = uid + + resource_path = "identity/v2/manage/account/uid" + return self._lr_object.execute("PUT", resource_path, query_parameters, update_uid_model) diff --git a/Demo/LoginRadius/api/account/role_api.py b/Demo/LoginRadius/api/account/role_api.py index 54e4153..28c7c40 100644 --- a/Demo/LoginRadius/api/account/role_api.py +++ b/Demo/LoginRadius/api/account/role_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # diff --git a/Demo/LoginRadius/api/account/sott_api.py b/Demo/LoginRadius/api/account/sott_api.py index 3bc8c4e..13fbbf8 100644 --- a/Demo/LoginRadius/api/account/sott_api.py +++ b/Demo/LoginRadius/api/account/sott_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # diff --git a/Demo/LoginRadius/api/advanced/__init__.py b/Demo/LoginRadius/api/advanced/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Demo/LoginRadius/api/advanced/configuration_api.py b/Demo/LoginRadius/api/advanced/configuration_api.py index 7e827dc..dd35f2d 100644 --- a/Demo/LoginRadius/api/advanced/configuration_api.py +++ b/Demo/LoginRadius/api/advanced/configuration_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # diff --git a/Demo/LoginRadius/api/advanced/consentmanagement_api.py b/Demo/LoginRadius/api/advanced/consentmanagement_api.py new file mode 100644 index 0000000..dfd9fb0 --- /dev/null +++ b/Demo/LoginRadius/api/advanced/consentmanagement_api.py @@ -0,0 +1,155 @@ +# -- coding: utf-8 -- +# Created by LoginRadius Development Team +# Copyright 2019 LoginRadius Inc. All rights reserved. +# + + +class ConsentManagementApi: + + def __init__(self, lr_object): + """ + :param lr_object: this is the reference to the parent LoginRadius object. + """ + self._lr_object = lr_object + + def get_consent_logs_by_uid(self, uid): + """This API is used to get the Consent logs of the user. + + Args: + uid: UID, the unified identifier for each user account + + Returns: + Response containing consent logs + 18.37 + """ + + if(self._lr_object.is_null_or_whitespace(uid)): + raise Exception(self._lr_object.get_validation_message("uid")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["apiSecret"] = self._lr_object.get_api_secret() + + resource_path = "identity/v2/manage/account/" + uid + "/consent/logs" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + + def submit_consent_by_consent_token(self, consent_token, consent_submit_model): + """This API is to submit consent form using consent token. + + Args: + consent_token: The consent token received after login error 1226 + consent_submit_model: Model class containing list of multiple consent + + Returns: + Response containing User Profile Data and access token + 43.1 + """ + + if(self._lr_object.is_null_or_whitespace(consent_token)): + raise Exception(self._lr_object.get_validation_message("consent_token")) + if(consent_submit_model is None): + raise Exception(self._lr_object.get_validation_message("consent_submit_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["consentToken"] = consent_token + + resource_path = "identity/v2/auth/consent" + return self._lr_object.execute("POST", resource_path, query_parameters, consent_submit_model) + + def get_consent_logs(self, access_token): + """This API is used to fetch consent logs. + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + + Returns: + Response containing consent logs + 43.2 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/consent/logs" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + + def submit_consent_by_access_token(self, access_token, consent_submit_model): + """API to provide a way to end user to submit a consent form for particular event type. + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + consent_submit_model: Model class containing list of multiple consent + + Returns: + Response containing Definition for Complete profile data + 43.3 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + if(consent_submit_model is None): + raise Exception(self._lr_object.get_validation_message("consent_submit_model")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/consent/profile" + return self._lr_object.execute("POST", resource_path, query_parameters, consent_submit_model) + + def verify_consent_by_access_token(self, access_token, event, is_custom): + """This API is used to check if consent is submitted for a particular event or not. + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + event: Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject + is_custom: true/false + + Returns: + Response containing consent profile + 43.4 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + if(self._lr_object.is_null_or_whitespace(event)): + raise Exception(self._lr_object.get_validation_message("event")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["event"] = event + query_parameters["isCustom"] = is_custom + + resource_path = "identity/v2/auth/consent/verify" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + + def update_consent_profile_by_access_token(self, access_token, consent_update_model): + """This API is to update consents using access token. + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + consent_update_model: Model class containg list of multiple consent + + Returns: + Response containing consent profile + 43.5 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + if(consent_update_model is None): + raise Exception(self._lr_object.get_validation_message("consent_update_model")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/consent" + return self._lr_object.execute("PUT", resource_path, query_parameters, consent_update_model) diff --git a/Demo/LoginRadius/api/advanced/customobject_api.py b/Demo/LoginRadius/api/advanced/customobject_api.py index 5a81e74..ce07db2 100644 --- a/Demo/LoginRadius/api/advanced/customobject_api.py +++ b/Demo/LoginRadius/api/advanced/customobject_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # @@ -42,7 +42,7 @@ def create_custom_object_by_token(self, access_token, object_name, payload): return self._lr_object.execute("POST", resource_path, query_parameters, payload) def update_custom_object_by_token(self, access_token, object_name, object_record_id, - payload, update_type=''): + payload, update_type=None): """This API is used to update the specified custom object data of the specified account. If the value of updatetype is 'replace' then it will fully replace custom object with the new custom object and if the value of updatetype is 'partialreplace' then it will perform an upsert type operation Args: @@ -194,7 +194,7 @@ def create_custom_object_by_uid(self, object_name, payload, uid): return self._lr_object.execute("POST", resource_path, query_parameters, payload) def update_custom_object_by_uid(self, object_name, object_record_id, payload, - uid, update_type=''): + uid, update_type=None): """This API is used to update the specified custom object data of a specified account. If the value of updatetype is 'replace' then it will fully replace custom object with new custom object and if the value of updatetype is partialreplace then it will perform an upsert type operation. Args: diff --git a/Demo/LoginRadius/api/advanced/customregistrationdata_api.py b/Demo/LoginRadius/api/advanced/customregistrationdata_api.py index c3d3d48..3a0dc22 100644 --- a/Demo/LoginRadius/api/advanced/customregistrationdata_api.py +++ b/Demo/LoginRadius/api/advanced/customregistrationdata_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # diff --git a/Demo/LoginRadius/api/advanced/multifactorauthentication_api.py b/Demo/LoginRadius/api/advanced/multifactorauthentication_api.py index 8b25d51..f630077 100644 --- a/Demo/LoginRadius/api/advanced/multifactorauthentication_api.py +++ b/Demo/LoginRadius/api/advanced/multifactorauthentication_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # @@ -509,129 +509,6 @@ def mfa_resend_otp(self, second_factor_authentication_token, sms_template2_f_a=N resource_path = "identity/v2/auth/login/2fa/resend" return self._lr_object.execute("GET", resource_path, query_parameters, None) - def mfa_re_authenticate(self, access_token, sms_template2_f_a=None): - """This API is used to trigger the Multi-Factor Autentication workflow for the provided access_token - - Args: - access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - sms_template2_f_a: SMS Template Name - - Returns: - Response containing Definition of Complete Multi-Factor Authentication Settings data - 14.3 - """ - - if(self._lr_object.is_null_or_whitespace(access_token)): - raise Exception(self._lr_object.get_validation_message("access_token")) - - query_parameters = {} - query_parameters["access_token"] = access_token - query_parameters["apiKey"] = self._lr_object.get_api_key() - if(not self._lr_object.is_null_or_whitespace(sms_template2_f_a)): - query_parameters["smsTemplate2FA"] = sms_template2_f_a - - resource_path = "identity/v2/auth/account/reauth/2fa" - return self._lr_object.execute("GET", resource_path, query_parameters, None) - - def mfa_re_authenticate_by_otp(self, access_token, reauth_by_otp_model): - """This API is used to re-authenticate via Multi-factor authentication by passing the One Time Password received via SMS - - Args: - access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - reauth_by_otp_model: Model Class containing Definition for MFA Reauthentication by OTP - - Returns: - Complete user Multi-Factor Authentication Token data - 14.4 - """ - - if(self._lr_object.is_null_or_whitespace(access_token)): - raise Exception(self._lr_object.get_validation_message("access_token")) - if(reauth_by_otp_model is None): - raise Exception(self._lr_object.get_validation_message("reauth_by_otp_model")) - - query_parameters = {} - query_parameters["access_token"] = access_token - query_parameters["apiKey"] = self._lr_object.get_api_key() - - resource_path = "identity/v2/auth/account/reauth/2fa/otp" - return self._lr_object.execute("PUT", resource_path, query_parameters, reauth_by_otp_model) - - def mfa_re_authenticate_by_backup_code(self, access_token, reauth_by_backup_code_model): - """This API is used to re-authenticate by set of backup codes via access_token on the site that has Multi-factor authentication enabled in re-authentication for the user that does not have the device - - Args: - access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - reauth_by_backup_code_model: Model Class containing Definition for MFA Reauthentication by Backup code - - Returns: - Complete user Multi-Factor Authentication Token data - 14.5 - """ - - if(self._lr_object.is_null_or_whitespace(access_token)): - raise Exception(self._lr_object.get_validation_message("access_token")) - if(reauth_by_backup_code_model is None): - raise Exception(self._lr_object.get_validation_message("reauth_by_backup_code_model")) - - query_parameters = {} - query_parameters["access_token"] = access_token - query_parameters["apiKey"] = self._lr_object.get_api_key() - - resource_path = "identity/v2/auth/account/reauth/2fa/backupcode" - return self._lr_object.execute("PUT", resource_path, query_parameters, reauth_by_backup_code_model) - - def mfa_re_authenticate_by_google_auth(self, access_token, reauth_by_google_authenticator_code_model): - """This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code - - Args: - access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - reauth_by_google_authenticator_code_model: Model Class containing Definition for MFA Reauthentication by Google Authenticator - - Returns: - Complete user Multi-Factor Authentication Token data - 14.6 - """ - - if(self._lr_object.is_null_or_whitespace(access_token)): - raise Exception(self._lr_object.get_validation_message("access_token")) - if(reauth_by_google_authenticator_code_model is None): - raise Exception(self._lr_object.get_validation_message("reauth_by_google_authenticator_code_model")) - - query_parameters = {} - query_parameters["access_token"] = access_token - query_parameters["apiKey"] = self._lr_object.get_api_key() - - resource_path = "identity/v2/auth/account/reauth/2fa/googleauthenticatorcode" - return self._lr_object.execute("PUT", resource_path, query_parameters, reauth_by_google_authenticator_code_model) - - def mfa_re_authenticate_by_password(self, access_token, password_event_based_auth_model_with_lockout, sms_template2_f_a=None): - """This API is used to re-authenticate via Multi-factor-authentication by passing the password - - Args: - access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - password_event_based_auth_model_with_lockout: Model Class containing Definition of payload for PasswordEventBasedAuthModel with Lockout API - sms_template2_f_a: SMS Template Name - - Returns: - Complete user Multi-Factor Authentication Token data - 14.7 - """ - - if(self._lr_object.is_null_or_whitespace(access_token)): - raise Exception(self._lr_object.get_validation_message("access_token")) - if(password_event_based_auth_model_with_lockout is None): - raise Exception(self._lr_object.get_validation_message("password_event_based_auth_model_with_lockout")) - - query_parameters = {} - query_parameters["access_token"] = access_token - query_parameters["apiKey"] = self._lr_object.get_api_key() - if(not self._lr_object.is_null_or_whitespace(sms_template2_f_a)): - query_parameters["smsTemplate2FA"] = sms_template2_f_a - - resource_path = "identity/v2/auth/account/reauth/password" - return self._lr_object.execute("PUT", resource_path, query_parameters, password_event_based_auth_model_with_lockout) - def mfa_reset_sms_authenticator_by_uid(self, otpauthenticator, uid): """This API resets the SMS Authenticator configurations on a given account via the UID. diff --git a/Demo/LoginRadius/api/advanced/reauthentication_api.py b/Demo/LoginRadius/api/advanced/reauthentication_api.py new file mode 100644 index 0000000..24b8bda --- /dev/null +++ b/Demo/LoginRadius/api/advanced/reauthentication_api.py @@ -0,0 +1,235 @@ +# -- coding: utf-8 -- +# Created by LoginRadius Development Team +# Copyright 2019 LoginRadius Inc. All rights reserved. +# + + +class ReAuthenticationApi: + + def __init__(self, lr_object): + """ + :param lr_object: this is the reference to the parent LoginRadius object. + """ + self._lr_object = lr_object + + def mfa_re_authenticate(self, access_token, sms_template2_f_a=None): + """This API is used to trigger the Multi-Factor Autentication workflow for the provided access_token + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + sms_template2_f_a: SMS Template Name + + Returns: + Response containing Definition of Complete Multi-Factor Authentication Settings data + 14.3 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + if(not self._lr_object.is_null_or_whitespace(sms_template2_f_a)): + query_parameters["smsTemplate2FA"] = sms_template2_f_a + + resource_path = "identity/v2/auth/account/reauth/2fa" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + + def mfa_re_authenticate_by_otp(self, access_token, reauth_by_otp_model): + """This API is used to re-authenticate via Multi-factor authentication by passing the One Time Password received via SMS + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + reauth_by_otp_model: Model Class containing Definition for MFA Reauthentication by OTP + + Returns: + Complete user Multi-Factor Authentication Token data + 14.4 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + if(reauth_by_otp_model is None): + raise Exception(self._lr_object.get_validation_message("reauth_by_otp_model")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/account/reauth/2fa/otp" + return self._lr_object.execute("PUT", resource_path, query_parameters, reauth_by_otp_model) + + def mfa_re_authenticate_by_backup_code(self, access_token, reauth_by_backup_code_model): + """This API is used to re-authenticate by set of backup codes via access_token on the site that has Multi-factor authentication enabled in re-authentication for the user that does not have the device + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + reauth_by_backup_code_model: Model Class containing Definition for MFA Reauthentication by Backup code + + Returns: + Complete user Multi-Factor Authentication Token data + 14.5 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + if(reauth_by_backup_code_model is None): + raise Exception(self._lr_object.get_validation_message("reauth_by_backup_code_model")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/account/reauth/2fa/backupcode" + return self._lr_object.execute("PUT", resource_path, query_parameters, reauth_by_backup_code_model) + + def mfa_re_authenticate_by_google_auth(self, access_token, reauth_by_google_authenticator_code_model): + """This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + reauth_by_google_authenticator_code_model: Model Class containing Definition for MFA Reauthentication by Google Authenticator + + Returns: + Complete user Multi-Factor Authentication Token data + 14.6 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + if(reauth_by_google_authenticator_code_model is None): + raise Exception(self._lr_object.get_validation_message("reauth_by_google_authenticator_code_model")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/account/reauth/2fa/googleauthenticatorcode" + return self._lr_object.execute("PUT", resource_path, query_parameters, reauth_by_google_authenticator_code_model) + + def mfa_re_authenticate_by_password(self, access_token, password_event_based_auth_model_with_lockout, sms_template2_f_a=None): + """This API is used to re-authenticate via Multi-factor-authentication by passing the password + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + password_event_based_auth_model_with_lockout: Model Class containing Definition of payload for PasswordEventBasedAuthModel with Lockout API + sms_template2_f_a: SMS Template Name + + Returns: + Complete user Multi-Factor Authentication Token data + 14.7 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + if(password_event_based_auth_model_with_lockout is None): + raise Exception(self._lr_object.get_validation_message("password_event_based_auth_model_with_lockout")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + if(not self._lr_object.is_null_or_whitespace(sms_template2_f_a)): + query_parameters["smsTemplate2FA"] = sms_template2_f_a + + resource_path = "identity/v2/auth/account/reauth/password" + return self._lr_object.execute("PUT", resource_path, query_parameters, password_event_based_auth_model_with_lockout) + + def verify_multi_factor_otp_reauthentication(self, event_based_multi_factor_token, uid): + """This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by OTP. + + Args: + event_based_multi_factor_token: Model Class containing Definition for SecondFactorValidationToken + uid: UID, the unified identifier for each user account + + Returns: + Response containing Definition of Complete Validation data + 18.38 + """ + if(event_based_multi_factor_token is None): + raise Exception(self._lr_object.get_validation_message("event_based_multi_factor_token")) + + if(self._lr_object.is_null_or_whitespace(uid)): + raise Exception(self._lr_object.get_validation_message("uid")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["apiSecret"] = self._lr_object.get_api_secret() + + resource_path = "identity/v2/manage/account/" + uid + "/reauth/2fa" + return self._lr_object.execute("POST", resource_path, query_parameters, event_based_multi_factor_token) + + def verify_multi_factor_password_reauthentication(self, event_based_multi_factor_token, uid): + """This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by password. + + Args: + event_based_multi_factor_token: Model Class containing Definition for SecondFactorValidationToken + uid: UID, the unified identifier for each user account + + Returns: + Response containing Definition of Complete Validation data + 18.39 + """ + if(event_based_multi_factor_token is None): + raise Exception(self._lr_object.get_validation_message("event_based_multi_factor_token")) + + if(self._lr_object.is_null_or_whitespace(uid)): + raise Exception(self._lr_object.get_validation_message("uid")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["apiSecret"] = self._lr_object.get_api_secret() + + resource_path = "identity/v2/manage/account/" + uid + "/reauth/password" + return self._lr_object.execute("POST", resource_path, query_parameters, event_based_multi_factor_token) + + def verify_multi_factor_pin_reauthentication(self, event_based_multi_factor_token, uid): + """This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by PIN. + + Args: + event_based_multi_factor_token: Model Class containing Definition for SecondFactorValidationToken + uid: UID, the unified identifier for each user account + + Returns: + Response containing Definition of Complete Validation data + 18.40 + """ + if(event_based_multi_factor_token is None): + raise Exception(self._lr_object.get_validation_message("event_based_multi_factor_token")) + + if(self._lr_object.is_null_or_whitespace(uid)): + raise Exception(self._lr_object.get_validation_message("uid")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["apiSecret"] = self._lr_object.get_api_secret() + + resource_path = "identity/v2/manage/account/" + uid + "/reauth/pin" + return self._lr_object.execute("POST", resource_path, query_parameters, event_based_multi_factor_token) + + def verify_pin_authentication(self, access_token, pin_auth_event_based_auth_model_with_lockout, sms_template2_f_a=None): + """This API is used to validate the triggered MFA authentication flow with a password. + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + pin_auth_event_based_auth_model_with_lockout: Model Class containing Definition of payload for PIN + sms_template2_f_a: SMS Template Name + + Returns: + Response containing Definition response of MFA reauthentication + 42.13 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + if(pin_auth_event_based_auth_model_with_lockout is None): + raise Exception(self._lr_object.get_validation_message("pin_auth_event_based_auth_model_with_lockout")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + if(not self._lr_object.is_null_or_whitespace(sms_template2_f_a)): + query_parameters["smsTemplate2FA"] = sms_template2_f_a + + resource_path = "identity/v2/auth/account/reauth/pin" + return self._lr_object.execute("PUT", resource_path, query_parameters, pin_auth_event_based_auth_model_with_lockout) diff --git a/Demo/LoginRadius/api/advanced/webhook_api.py b/Demo/LoginRadius/api/advanced/webhook_api.py index b34ca62..553a969 100644 --- a/Demo/LoginRadius/api/advanced/webhook_api.py +++ b/Demo/LoginRadius/api/advanced/webhook_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # diff --git a/Demo/LoginRadius/api/authentication/__init__.py b/Demo/LoginRadius/api/authentication/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Demo/LoginRadius/api/authentication/authentication_api.py b/Demo/LoginRadius/api/authentication/authentication_api.py index 2483e02..1757eb5 100644 --- a/Demo/LoginRadius/api/authentication/authentication_api.py +++ b/Demo/LoginRadius/api/authentication/authentication_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # @@ -932,46 +932,6 @@ def user_registration_by_email(self, auth_user_registration_model, sott, email_t resource_path = "identity/v2/auth/register" return self._lr_object.execute("POST", resource_path, query_parameters, auth_user_registration_model) - def user_registration_by_phone(self, auth_user_registration_model, sott, fields='', - options='', sms_template=None, verification_url=None, welcome_email_template=None): - """This API registers the new users into your Cloud Storage and triggers the phone verification process. - - Args: - auth_user_registration_model: Model Class containing Definition of payload for Auth User Registration API - sott: LoginRadius Secured One Time Token - fields: The fields parameter filters the API response so that the response only includes a specific set of fields - options: PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow) - sms_template: SMS Template name - verification_url: Email verification url - welcome_email_template: Name of the welcome email template - - Returns: - Response containing Definition of Complete Validation, UserProfile data and Access Token - 17.1.2 - """ - if(auth_user_registration_model is None): - raise Exception(self._lr_object.get_validation_message("auth_user_registration_model")) - - if(self._lr_object.is_null_or_whitespace(sott)): - raise Exception(self._lr_object.get_validation_message("sott")) - - query_parameters = {} - query_parameters["apiKey"] = self._lr_object.get_api_key() - query_parameters["sott"] = sott - if(not self._lr_object.is_null_or_whitespace(fields)): - query_parameters["fields"] = fields - if(not self._lr_object.is_null_or_whitespace(options)): - query_parameters["options"] = options - if(not self._lr_object.is_null_or_whitespace(sms_template)): - query_parameters["smsTemplate"] = sms_template - if(not self._lr_object.is_null_or_whitespace(verification_url)): - query_parameters["verificationUrl"] = verification_url - if(not self._lr_object.is_null_or_whitespace(welcome_email_template)): - query_parameters["welcomeEmailTemplate"] = welcome_email_template - - resource_path = "identity/v2/auth/register" - return self._lr_object.execute("POST", resource_path, query_parameters, auth_user_registration_model) - def user_registration_by_captcha(self, auth_user_registration_model_with_captcha, email_template=None, fields='', options='', sms_template=None, verification_url=None, welcome_email_template=None): """This API creates a user in the database as well as sends a verification email to the user. diff --git a/Demo/LoginRadius/api/authentication/onetouchlogin_api.py b/Demo/LoginRadius/api/authentication/onetouchlogin_api.py index be00562..ca6af53 100644 --- a/Demo/LoginRadius/api/authentication/onetouchlogin_api.py +++ b/Demo/LoginRadius/api/authentication/onetouchlogin_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # diff --git a/Demo/LoginRadius/api/authentication/passwordlesslogin_api.py b/Demo/LoginRadius/api/authentication/passwordlesslogin_api.py index 70e9bd9..cd46d45 100644 --- a/Demo/LoginRadius/api/authentication/passwordlesslogin_api.py +++ b/Demo/LoginRadius/api/authentication/passwordlesslogin_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # diff --git a/Demo/LoginRadius/api/authentication/phoneauthentication_api.py b/Demo/LoginRadius/api/authentication/phoneauthentication_api.py index 6ce862d..b85706a 100644 --- a/Demo/LoginRadius/api/authentication/phoneauthentication_api.py +++ b/Demo/LoginRadius/api/authentication/phoneauthentication_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # @@ -125,7 +125,7 @@ def phone_verification_otp_by_access_token(self, access_token, otp, sms_template """This API is used to consume the verification code sent to verify a user's phone number. Use this call for front-end purposes in cases where the user is already logged in by passing the user's access token. Args: - access_token: Access_Token + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. otp: The Verification Code sms_template: SMS Template name @@ -141,16 +141,14 @@ def phone_verification_otp_by_access_token(self, access_token, otp, sms_template raise Exception(self._lr_object.get_validation_message("otp")) query_parameters = {} + query_parameters["access_token"] = access_token query_parameters["apiKey"] = self._lr_object.get_api_key() query_parameters["otp"] = otp if(not self._lr_object.is_null_or_whitespace(sms_template)): query_parameters["smsTemplate"] = sms_template - body_parameters = {} - body_parameters["access_token"] = access_token - resource_path = "identity/v2/auth/phone/otp" - return self._lr_object.execute("PUT", resource_path, query_parameters, body_parameters) + return self._lr_object.execute("PUT", resource_path, query_parameters, None) def phone_resend_verification_otp(self, phone, sms_template=None): """This API is used to resend a verification OTP to verify a user's Phone Number. The user will receive a verification code that they will need to input @@ -198,12 +196,12 @@ def phone_resend_verification_otp_by_token(self, access_token, phone, sms_templa raise Exception(self._lr_object.get_validation_message("phone")) query_parameters = {} + query_parameters["access_token"] = access_token query_parameters["apiKey"] = self._lr_object.get_api_key() if(not self._lr_object.is_null_or_whitespace(sms_template)): query_parameters["smsTemplate"] = sms_template body_parameters = {} - body_parameters["access_token"] = access_token body_parameters["phone"] = phone resource_path = "identity/v2/auth/phone/otp" @@ -244,7 +242,7 @@ def check_phone_number_availability(self, phone): """This API is used to check the Phone Number exists or not on your site. Args: - phone: LoginRadius API Key + phone: The Registered Phone Number Returns: Response containing Definition Complete ExistResponse data @@ -281,3 +279,43 @@ def remove_phone_id_by_access_token(self, access_token): resource_path = "identity/v2/auth/phone" return self._lr_object.execute("DELETE", resource_path, query_parameters, None) + + def user_registration_by_phone(self, auth_user_registration_model, sott, fields='', + options='', sms_template=None, verification_url=None, welcome_email_template=None): + """This API registers the new users into your Cloud Storage and triggers the phone verification process. + + Args: + auth_user_registration_model: Model Class containing Definition of payload for Auth User Registration API + sott: LoginRadius Secured One Time Token + fields: The fields parameter filters the API response so that the response only includes a specific set of fields + options: PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow) + sms_template: SMS Template name + verification_url: Email verification url + welcome_email_template: Name of the welcome email template + + Returns: + Response containing Definition of Complete Validation, UserProfile data and Access Token + 17.1.2 + """ + if(auth_user_registration_model is None): + raise Exception(self._lr_object.get_validation_message("auth_user_registration_model")) + + if(self._lr_object.is_null_or_whitespace(sott)): + raise Exception(self._lr_object.get_validation_message("sott")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["sott"] = sott + if(not self._lr_object.is_null_or_whitespace(fields)): + query_parameters["fields"] = fields + if(not self._lr_object.is_null_or_whitespace(options)): + query_parameters["options"] = options + if(not self._lr_object.is_null_or_whitespace(sms_template)): + query_parameters["smsTemplate"] = sms_template + if(not self._lr_object.is_null_or_whitespace(verification_url)): + query_parameters["verificationUrl"] = verification_url + if(not self._lr_object.is_null_or_whitespace(welcome_email_template)): + query_parameters["welcomeEmailTemplate"] = welcome_email_template + + resource_path = "identity/v2/auth/register" + return self._lr_object.execute("POST", resource_path, query_parameters, auth_user_registration_model) diff --git a/Demo/LoginRadius/api/authentication/pinauthentication_api.py b/Demo/LoginRadius/api/authentication/pinauthentication_api.py new file mode 100644 index 0000000..5042fd5 --- /dev/null +++ b/Demo/LoginRadius/api/authentication/pinauthentication_api.py @@ -0,0 +1,311 @@ +# -- coding: utf-8 -- +# Created by LoginRadius Development Team +# Copyright 2019 LoginRadius Inc. All rights reserved. +# + + +class PINAuthenticationApi: + + def __init__(self, lr_object): + """ + :param lr_object: this is the reference to the parent LoginRadius object. + """ + self._lr_object = lr_object + + def pin_login(self, login_by_pin_model, session_token): + """This API is used to login a user by pin and session_token. + + Args: + login_by_pin_model: Model Class containing Definition of payload for LoginByPin API + session_token: Session Token of user + + Returns: + Response containing User Profile Data and access token + 9.22 + """ + if(login_by_pin_model is None): + raise Exception(self._lr_object.get_validation_message("login_by_pin_model")) + + if(self._lr_object.is_null_or_whitespace(session_token)): + raise Exception(self._lr_object.get_validation_message("session_token")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["session_token"] = session_token + + resource_path = "identity/v2/auth/login/pin" + return self._lr_object.execute("POST", resource_path, query_parameters, login_by_pin_model) + + def send_forgot_pin_email_by_email(self, forgot_pin_link_by_email_model, email_template=None, reset_pin_url=None): + """This API sends the reset pin email to specified email address. + + Args: + forgot_pin_link_by_email_model: Model Class containing Definition for Forgot Pin Link By Email API + email_template: Email template name + reset_pin_url: Reset PIN Url + + Returns: + Response containing Definition of Complete Validation data + 42.1 + """ + if(forgot_pin_link_by_email_model is None): + raise Exception(self._lr_object.get_validation_message("forgot_pin_link_by_email_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + if(not self._lr_object.is_null_or_whitespace(email_template)): + query_parameters["emailTemplate"] = email_template + if(not self._lr_object.is_null_or_whitespace(reset_pin_url)): + query_parameters["resetPINUrl"] = reset_pin_url + + resource_path = "identity/v2/auth/pin/forgot/email" + return self._lr_object.execute("POST", resource_path, query_parameters, forgot_pin_link_by_email_model) + + def send_forgot_pin_email_by_username(self, forgot_pin_link_by_user_name_model, email_template=None, reset_pin_url=None): + """This API sends the reset pin email using username. + + Args: + forgot_pin_link_by_user_name_model: Model Class containing Definition for Forgot Pin Link By UserName API + email_template: Email template name + reset_pin_url: Reset PIN Url + + Returns: + Response containing Definition of Complete Validation data + 42.2 + """ + if(forgot_pin_link_by_user_name_model is None): + raise Exception(self._lr_object.get_validation_message("forgot_pin_link_by_user_name_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + if(not self._lr_object.is_null_or_whitespace(email_template)): + query_parameters["emailTemplate"] = email_template + if(not self._lr_object.is_null_or_whitespace(reset_pin_url)): + query_parameters["resetPINUrl"] = reset_pin_url + + resource_path = "identity/v2/auth/pin/forgot/username" + return self._lr_object.execute("POST", resource_path, query_parameters, forgot_pin_link_by_user_name_model) + + def reset_pin_by_reset_token(self, reset_pin_by_reset_token): + """This API is used to reset pin using reset token. + + Args: + reset_pin_by_reset_token: Model Class containing Definition of payload for Reset Pin By Reset Token API + + Returns: + Response containing Definition of Complete Validation data + 42.3 + """ + if(reset_pin_by_reset_token is None): + raise Exception(self._lr_object.get_validation_message("reset_pin_by_reset_token")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/pin/reset/token" + return self._lr_object.execute("PUT", resource_path, query_parameters, reset_pin_by_reset_token) + + def reset_pin_by_email_and_security_answer(self, reset_pin_by_security_question_answer_and_email_model): + """This API is used to reset pin using security question answer and email. + + Args: + reset_pin_by_security_question_answer_and_email_model: Model Class containing Definition of payload for Reset Pin By Security Question and Email API + + Returns: + Response containing Definition of Complete Validation data + 42.4 + """ + if(reset_pin_by_security_question_answer_and_email_model is None): + raise Exception(self._lr_object.get_validation_message("reset_pin_by_security_question_answer_and_email_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/pin/reset/securityanswer/email" + return self._lr_object.execute("PUT", resource_path, query_parameters, reset_pin_by_security_question_answer_and_email_model) + + def reset_pin_by_username_and_security_answer(self, reset_pin_by_security_question_answer_and_username_model): + """This API is used to reset pin using security question answer and username. + + Args: + reset_pin_by_security_question_answer_and_username_model: Model Class containing Definition of payload for Reset Pin By Security Question and UserName API + + Returns: + Response containing Definition of Complete Validation data + 42.5 + """ + if(reset_pin_by_security_question_answer_and_username_model is None): + raise Exception(self._lr_object.get_validation_message("reset_pin_by_security_question_answer_and_username_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/pin/reset/securityanswer/username" + return self._lr_object.execute("PUT", resource_path, query_parameters, reset_pin_by_security_question_answer_and_username_model) + + def reset_pin_by_phone_and_security_answer(self, reset_pin_by_security_question_answer_and_phone_model): + """This API is used to reset pin using security question answer and phone. + + Args: + reset_pin_by_security_question_answer_and_phone_model: Model Class containing Definition of payload for Reset Pin By Security Question and Phone API + + Returns: + Response containing Definition of Complete Validation data + 42.6 + """ + if(reset_pin_by_security_question_answer_and_phone_model is None): + raise Exception(self._lr_object.get_validation_message("reset_pin_by_security_question_answer_and_phone_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/pin/reset/securityanswer/phone" + return self._lr_object.execute("PUT", resource_path, query_parameters, reset_pin_by_security_question_answer_and_phone_model) + + def send_forgot_pin_sms_by_phone(self, forgot_pin_otp_by_phone_model, sms_template=None): + """This API sends the OTP to specified phone number + + Args: + forgot_pin_otp_by_phone_model: Model Class containing Definition for Forgot Pin Otp By Phone API + sms_template: + + Returns: + Response Containing Validation Data and SMS Data + 42.7 + """ + if(forgot_pin_otp_by_phone_model is None): + raise Exception(self._lr_object.get_validation_message("forgot_pin_otp_by_phone_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + if(not self._lr_object.is_null_or_whitespace(sms_template)): + query_parameters["smsTemplate"] = sms_template + + resource_path = "identity/v2/auth/pin/forgot/otp" + return self._lr_object.execute("POST", resource_path, query_parameters, forgot_pin_otp_by_phone_model) + + def change_pin_by_access_token(self, access_token, change_pin_model): + """This API is used to change a user's PIN using access token. + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + change_pin_model: Model Class containing Definition for change PIN Property + + Returns: + Response containing Definition of Complete Validation data + 42.8 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + if(change_pin_model is None): + raise Exception(self._lr_object.get_validation_message("change_pin_model")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/pin/change" + return self._lr_object.execute("PUT", resource_path, query_parameters, change_pin_model) + + def reset_pin_by_phone_and_otp(self, reset_pin_by_phone_and_otp_model): + """This API is used to reset pin using phoneId and OTP. + + Args: + reset_pin_by_phone_and_otp_model: Model Class containing Definition of payload for Reset Pin By Phone and Otp API + + Returns: + Response containing Definition of Complete Validation data + 42.9 + """ + if(reset_pin_by_phone_and_otp_model is None): + raise Exception(self._lr_object.get_validation_message("reset_pin_by_phone_and_otp_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/pin/reset/otp/phone" + return self._lr_object.execute("PUT", resource_path, query_parameters, reset_pin_by_phone_and_otp_model) + + def reset_pin_by_email_and_otp(self, reset_pin_by_email_and_otp_model): + """This API is used to reset pin using email and OTP. + + Args: + reset_pin_by_email_and_otp_model: Model Class containing Definition of payload for Reset Pin By Email and Otp API + + Returns: + Response containing Definition of Complete Validation data + 42.10 + """ + if(reset_pin_by_email_and_otp_model is None): + raise Exception(self._lr_object.get_validation_message("reset_pin_by_email_and_otp_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/pin/reset/otp/email" + return self._lr_object.execute("PUT", resource_path, query_parameters, reset_pin_by_email_and_otp_model) + + def reset_pin_by_username_and_otp(self, reset_pin_by_username_and_otp_model): + """This API is used to reset pin using username and OTP. + + Args: + reset_pin_by_username_and_otp_model: Model Class containing Definition of payload for Reset Pin By Username and Otp API + + Returns: + Response containing Definition of Complete Validation data + 42.11 + """ + if(reset_pin_by_username_and_otp_model is None): + raise Exception(self._lr_object.get_validation_message("reset_pin_by_username_and_otp_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/pin/reset/otp/username" + return self._lr_object.execute("PUT", resource_path, query_parameters, reset_pin_by_username_and_otp_model) + + def set_pin_by_pin_auth_token(self, pin_required_model, pin_auth_token): + """This API is used to change a user's PIN using Pin Auth token. + + Args: + pin_required_model: Model Class containing Definition for PIN + pin_auth_token: Pin Auth Token + + Returns: + Response containing User Profile Data and access token + 42.12 + """ + if(pin_required_model is None): + raise Exception(self._lr_object.get_validation_message("pin_required_model")) + + if(self._lr_object.is_null_or_whitespace(pin_auth_token)): + raise Exception(self._lr_object.get_validation_message("pin_auth_token")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["pinAuthToken"] = pin_auth_token + + resource_path = "identity/v2/auth/pin/set/pinauthtoken" + return self._lr_object.execute("POST", resource_path, query_parameters, pin_required_model) + + def in_validate_pin_session_token(self, session_token): + """This API is used to invalidate pin session token. + + Args: + session_token: Session Token of user + + Returns: + Response containing Definition of Complete Validation data + 44.1 + """ + + if(self._lr_object.is_null_or_whitespace(session_token)): + raise Exception(self._lr_object.get_validation_message("session_token")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["session_token"] = session_token + + resource_path = "identity/v2/auth/session_token/invalidate" + return self._lr_object.execute("GET", resource_path, query_parameters, None) diff --git a/Demo/LoginRadius/api/authentication/riskbasedauthentication_api.py b/Demo/LoginRadius/api/authentication/riskbasedauthentication_api.py index f060def..5181f0d 100644 --- a/Demo/LoginRadius/api/authentication/riskbasedauthentication_api.py +++ b/Demo/LoginRadius/api/authentication/riskbasedauthentication_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # diff --git a/Demo/LoginRadius/api/authentication/smartlogin_api.py b/Demo/LoginRadius/api/authentication/smartlogin_api.py index 229ea5d..7bd82a4 100644 --- a/Demo/LoginRadius/api/authentication/smartlogin_api.py +++ b/Demo/LoginRadius/api/authentication/smartlogin_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # diff --git a/Demo/LoginRadius/api/social/__init__.py b/Demo/LoginRadius/api/social/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Demo/LoginRadius/api/social/nativesocial_api.py b/Demo/LoginRadius/api/social/nativesocial_api.py index 268312d..395d05a 100644 --- a/Demo/LoginRadius/api/social/nativesocial_api.py +++ b/Demo/LoginRadius/api/social/nativesocial_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # @@ -13,7 +13,7 @@ def __init__(self, lr_object): self._lr_object = lr_object def get_access_token_by_facebook_access_token(self, fb__access__token): - """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. + """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. Args: fb__access__token: Facebook Access Token @@ -34,7 +34,7 @@ def get_access_token_by_facebook_access_token(self, fb__access__token): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_access_token_by_twitter_access_token(self, tw__access__token, tw__token__secret): - """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. + """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. Args: tw__access__token: Twitter Access Token @@ -60,7 +60,7 @@ def get_access_token_by_twitter_access_token(self, tw__access__token, tw__token_ return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_access_token_by_google_access_token(self, google__access__token, client_id=None, refresh_token=None): - """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. + """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. Args: google__access__token: Google Access Token @@ -108,7 +108,7 @@ def get_access_token_by_google_j_w_t_access_token(self, id__token): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_access_token_by_linkedin_access_token(self, ln__access__token): - """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. + """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. Args: ln__access__token: Linkedin Access Token @@ -129,7 +129,7 @@ def get_access_token_by_linkedin_access_token(self, ln__access__token): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_access_token_by_foursquare_access_token(self, fs__access__token): - """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. + """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. Args: fs__access__token: Foursquare Access Token @@ -150,7 +150,7 @@ def get_access_token_by_foursquare_access_token(self, fs__access__token): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_access_token_by_vkontakte_access_token(self, vk_access_token): - """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. + """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. Args: vk_access_token: Vkontakte Access Token @@ -171,7 +171,7 @@ def get_access_token_by_vkontakte_access_token(self, vk_access_token): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_access_token_by_google_auth_code(self, google_authcode): - """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. + """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. Args: google_authcode: Google AuthCode diff --git a/Demo/LoginRadius/api/social/social_api.py b/Demo/LoginRadius/api/social/social_api.py index 132a692..9b6550c 100644 --- a/Demo/LoginRadius/api/social/social_api.py +++ b/Demo/LoginRadius/api/social/social_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # @@ -109,7 +109,7 @@ def get_active_session(self, token): Returns: Response containing Definition for Complete active sessions - 20.11 + 20.11.1 """ if(self._lr_object.is_null_or_whitespace(token)): @@ -131,7 +131,7 @@ def get_active_session_by_account_id(self, account_id): Returns: Response containing Definition for Complete active sessions - 20.12 + 20.11.2 """ if(self._lr_object.is_null_or_whitespace(account_id)): @@ -153,7 +153,7 @@ def get_active_session_by_profile_id(self, profile_id): Returns: Response containing Definition for Complete active sessions - 20.13 + 20.11.3 """ if(self._lr_object.is_null_or_whitespace(profile_id)): @@ -175,7 +175,7 @@ def get_albums(self, access_token): Returns: Response Containing List of Album Data - 22.1 + 22.2.1 """ if(self._lr_object.is_null_or_whitespace(access_token)): @@ -187,15 +187,40 @@ def get_albums(self, access_token): resource_path = "api/v2/album" return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_albums_with_cursor(self, access_token, next_cursor): + """Supported Providers: Facebook, Google, Live, Vkontakte.

This API returns the photo albums associated with the passed in access tokens Social Profile. + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + next_cursor: Cursor value if not all contacts can be retrieved once. + + Returns: + Response Model containing Albums with next cursor + 22.2.2 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + if(self._lr_object.is_null_or_whitespace(next_cursor)): + raise Exception(self._lr_object.get_validation_message("next_cursor")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["nextCursor"] = next_cursor + + resource_path = "api/v2/album" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_audios(self, access_token): - """The Audio API is used to get audio files data from the user’s social account.

Supported Providers: Live, Vkontakte + """The Audio API is used to get audio files data from the user's social account.

Supported Providers: Live, Vkontakte Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. Returns: Response Containing List of Audio Data - 24.1 + 24.2.1 """ if(self._lr_object.is_null_or_whitespace(access_token)): @@ -207,15 +232,40 @@ def get_audios(self, access_token): resource_path = "api/v2/audio" return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_audios_with_cursor(self, access_token, next_cursor): + """The Audio API is used to get audio files data from the user's social account.

Supported Providers: Live, Vkontakte + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + next_cursor: Cursor value if not all contacts can be retrieved once. + + Returns: + Response Model containing Audio with next cursor + 24.2.2 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + if(self._lr_object.is_null_or_whitespace(next_cursor)): + raise Exception(self._lr_object.get_validation_message("next_cursor")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["nextCursor"] = next_cursor + + resource_path = "api/v2/audio" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_check_ins(self, access_token): - """The Check In API is used to get check Ins data from the user’s social account.

Supported Providers: Facebook, Foursquare, Vkontakte + """The Check In API is used to get check Ins data from the user's social account.

Supported Providers: Facebook, Foursquare, Vkontakte Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. Returns: Response Containing List of CheckIn Data - 25.1 + 25.2.1 """ if(self._lr_object.is_null_or_whitespace(access_token)): @@ -227,8 +277,33 @@ def get_check_ins(self, access_token): resource_path = "api/v2/checkin" return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_check_ins_with_cursor(self, access_token, next_cursor): + """The Check In API is used to get check Ins data from the user's social account.

Supported Providers: Facebook, Foursquare, Vkontakte + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + next_cursor: Cursor value if not all contacts can be retrieved once. + + Returns: + Response Model containing Checkins with next cursor + 25.2.2 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + if(self._lr_object.is_null_or_whitespace(next_cursor)): + raise Exception(self._lr_object.get_validation_message("next_cursor")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["nextCursor"] = next_cursor + + resource_path = "api/v2/checkin" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_contacts(self, access_token, next_cursor=''): - """The Contact API is used to get contacts/friends/connections data from the user’s social account.This is one of the APIs that makes up the LoginRadius Friend Invite System. The data will normalized into LoginRadius’ standard data format. This API requires setting permissions in your LoginRadius Dashboard.

Note: Facebook restricts access to the list of friends that is returned. When using the Contacts API with Facebook you will only receive friends that have accepted some permissions with your app.

Supported Providers: Facebook, Foursquare, Google, LinkedIn, Live, Twitter, Vkontakte, Yahoo + """The Contact API is used to get contacts/friends/connections data from the user's social account.This is one of the APIs that makes up the LoginRadius Friend Invite System. The data will normalized into LoginRadius' standard data format. This API requires setting permissions in your LoginRadius Dashboard.

Note: Facebook restricts access to the list of friends that is returned. When using the Contacts API with Facebook you will only receive friends that have accepted some permissions with your app.

Supported Providers: Facebook, Foursquare, Google, LinkedIn, Live, Twitter, Vkontakte, Yahoo Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -251,34 +326,59 @@ def get_contacts(self, access_token, next_cursor=''): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_events(self, access_token): - """The Event API is used to get the event data from the user’s social account.

Supported Providers: Facebook, Live + """The Event API is used to get the event data from the user's social account.

Supported Providers: Facebook, Live Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. Returns: Response Containing List of Events Data - 28.1 + 28.2.1 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + query_parameters = {} + query_parameters["access_token"] = access_token + + resource_path = "api/v2/event" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + + def get_events_with_cursor(self, access_token, next_cursor): + """The Event API is used to get the event data from the user's social account.

Supported Providers: Facebook, Live + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + next_cursor: Cursor value if not all contacts can be retrieved once. + + Returns: + Response Model containing Events with next cursor + 28.2.2 """ if(self._lr_object.is_null_or_whitespace(access_token)): raise Exception(self._lr_object.get_validation_message("access_token")) + if(self._lr_object.is_null_or_whitespace(next_cursor)): + raise Exception(self._lr_object.get_validation_message("next_cursor")) + query_parameters = {} query_parameters["access_token"] = access_token + query_parameters["nextCursor"] = next_cursor resource_path = "api/v2/event" return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_followings(self, access_token): - """Get the following user list from the user’s social account.

Supported Providers: Twitter + """Get the following user list from the user's social account.

Supported Providers: Twitter Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. Returns: Response Containing List of Contacts Data - 29.1 + 29.2.1 """ if(self._lr_object.is_null_or_whitespace(access_token)): @@ -290,15 +390,40 @@ def get_followings(self, access_token): resource_path = "api/v2/following" return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_followings_with_cursor(self, access_token, next_cursor): + """Get the following user list from the user's social account.

Supported Providers: Twitter + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + next_cursor: Cursor value if not all contacts can be retrieved once. + + Returns: + Response containing Definition of Contact Data with Cursor + 29.2.2 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + if(self._lr_object.is_null_or_whitespace(next_cursor)): + raise Exception(self._lr_object.get_validation_message("next_cursor")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["nextCursor"] = next_cursor + + resource_path = "api/v2/following" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_groups(self, access_token): - """The Group API is used to get group data from the user’s social account.

Supported Providers: Facebook, Vkontakte + """The Group API is used to get group data from the user's social account.

Supported Providers: Facebook, Vkontakte Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. Returns: Response Containing List of Groups Data - 30.1 + 30.2.1 """ if(self._lr_object.is_null_or_whitespace(access_token)): @@ -310,15 +435,40 @@ def get_groups(self, access_token): resource_path = "api/v2/group" return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_groups_with_cursor(self, access_token, next_cursor): + """The Group API is used to get group data from the user's social account.

Supported Providers: Facebook, Vkontakte + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + next_cursor: Cursor value if not all contacts can be retrieved once. + + Returns: + Response Model containing Groups with next cursor + 30.2.2 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + if(self._lr_object.is_null_or_whitespace(next_cursor)): + raise Exception(self._lr_object.get_validation_message("next_cursor")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["nextCursor"] = next_cursor + + resource_path = "api/v2/group" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_likes(self, access_token): - """The Like API is used to get likes data from the user’s social account.

Supported Providers: Facebook + """The Like API is used to get likes data from the user's social account.

Supported Providers: Facebook Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. Returns: Response Containing List of Likes Data - 31.1 + 31.2.1 """ if(self._lr_object.is_null_or_whitespace(access_token)): @@ -330,8 +480,33 @@ def get_likes(self, access_token): resource_path = "api/v2/like" return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_likes_with_cursor(self, access_token, next_cursor): + """The Like API is used to get likes data from the user's social account.

Supported Providers: Facebook + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + next_cursor: Cursor value if not all contacts can be retrieved once. + + Returns: + Response Model containing Likes with next cursor + 31.2.2 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + if(self._lr_object.is_null_or_whitespace(next_cursor)): + raise Exception(self._lr_object.get_validation_message("next_cursor")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["nextCursor"] = next_cursor + + resource_path = "api/v2/like" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_mentions(self, access_token): - """The Mention API is used to get mentions data from the user’s social account.

Supported Providers: Twitter + """The Mention API is used to get mentions data from the user's social account.

Supported Providers: Twitter Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -352,7 +527,7 @@ def get_mentions(self, access_token): def post_message(self, access_token, message, subject, to): - """Post Message API is used to post messages to the user’s contacts.

Supported Providers: Twitter, LinkedIn

The Message API is used to post messages to the user’s contacts. This is one of the APIs that makes up the LoginRadius Friend Invite System. After using the Contact API, you can send messages to the retrieved contacts. This API requires setting permissions in your LoginRadius Dashboard.

GET & POST Message API work the same way except the API method is different + """Post Message API is used to post messages to the user's contacts.

Supported Providers: Twitter, LinkedIn

The Message API is used to post messages to the user?s contacts. This is one of the APIs that makes up the LoginRadius Friend Invite System. After using the Contact API, you can send messages to the retrieved contacts. This API requires setting permissions in your LoginRadius Dashboard.

GET & POST Message API work the same way except the API method is different Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -387,7 +562,7 @@ def post_message(self, access_token, message, subject, return self._lr_object.execute("POST", resource_path, query_parameters, None) def get_page(self, access_token, page_name): - """The Page API is used to get the page data from the user’s social account.

Supported Providers: Facebook, LinkedIn + """The Page API is used to get the page data from the user's social account.

Supported Providers: Facebook, LinkedIn Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -412,7 +587,7 @@ def get_page(self, access_token, page_name): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_photos(self, access_token, album_id): - """The Photo API is used to get photo data from the user’s social account.

Supported Providers: Facebook, Foursquare, Google, Live, Vkontakte + """The Photo API is used to get photo data from the user's social account.

Supported Providers: Facebook, Foursquare, Google, Live, Vkontakte Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -437,7 +612,7 @@ def get_photos(self, access_token, album_id): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_posts(self, access_token): - """The Post API is used to get post message data from the user’s social account.

Supported Providers: Facebook + """The Post API is used to get post message data from the user's social account.

Supported Providers: Facebook Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -459,7 +634,7 @@ def get_posts(self, access_token): def status_posting(self, access_token, caption, description, imageurl, status, title, url, shorturl='0'): - """The Status API is used to update the status on the user’s wall.

Supported Providers: Facebook, Twitter, LinkedIn + """The Status API is used to update the status on the user's wall.

Supported Providers: Facebook, Twitter, LinkedIn Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -511,28 +686,8 @@ def status_posting(self, access_token, caption, description, resource_path = "api/v2/status" return self._lr_object.execute("POST", resource_path, query_parameters, None) - def get_status(self, access_token): - """The Status API is used to get the status messages from the user’s social account. - - Args: - access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - - Returns: - Response Containing List of Status Data - 37.3 - """ - - if(self._lr_object.is_null_or_whitespace(access_token)): - raise Exception(self._lr_object.get_validation_message("access_token")) - - query_parameters = {} - query_parameters["access_token"] = access_token - - resource_path = "api/v2/status" - return self._lr_object.execute("GET", resource_path, query_parameters, None) - def trackable_status_posting(self, access_token, status_model): - """The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.

The Trackable Status API is used to update the status on the user’s wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications.

POST Input Parameter Format: application/x-www-form-urlencoded + """The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.

The Trackable Status API is used to update the status on the user's wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications.

POST Input Parameter Format: application/x-www-form-urlencoded Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -556,7 +711,7 @@ def trackable_status_posting(self, access_token, status_model): def get_trackable_status_stats(self, access_token, caption, description, imageurl, status, title, url): - """The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.

The Trackable Status API is used to update the status on the user’s wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications. + """The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.

The Trackable Status API is used to update the status on the user's wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications. Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -627,7 +782,7 @@ def trackable_status_fetching(self, post_id): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_social_user_profile(self, access_token, fields=''): - """The User Profile API is used to get social profile data from the user’s social account after authentication.

Supported Providers: All + """The User Profile API is used to get social profile data from the user's social account after authentication.

Supported Providers: All Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -650,7 +805,7 @@ def get_social_user_profile(self, access_token, fields=''): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_refreshed_social_user_profile(self, access_token, fields=''): - """The User Profile API is used to get the latest updated social profile data from the user’s social account after authentication. The social profile will be retrieved via oAuth and OpenID protocols. The data is normalized into LoginRadius’ standard data format. This API should be called using the access token retrieved from the refresh access token API. + """The User Profile API is used to get the latest updated social profile data from the user's social account after authentication. The social profile will be retrieved via oAuth and OpenID protocols. The data is normalized into LoginRadius' standard data format. This API should be called using the access token retrieved from the refresh access token API. Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -673,7 +828,7 @@ def get_refreshed_social_user_profile(self, access_token, fields=''): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_videos(self, access_token, next_cursor): - """The Video API is used to get video files data from the user’s social account.

Supported Providers: Facebook, Google, Live, Vkontakte + """The Video API is used to get video files data from the user's social account.

Supported Providers: Facebook, Google, Live, Vkontakte Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. diff --git a/README.md b/README.md index 0ea8e18..cfa865f 100755 --- a/README.md +++ b/README.md @@ -15,18 +15,13 @@ This will work with 2.0 API specifications. LoginRadius is an Identity Management Platform that simplifies user registration while securing data. LoginRadius Platform simplifies and secures your user registration process, increases conversion with Social Login that combines 30 major social platforms, and offers a full solution with Traditional User Registration. You can gather a wealth of user profile data from Social Login or Traditional User Registration. -Python Library -===== +## Documentation ------- >Disclaimer:
This library is meant to help you with a quick implementation of the LoginRadius platform and also to serve as a reference point for the LoginRadius API. Keep in mind that it is an open source library, which means you are free to download and customize the library functions based on your specific application needs. -## Installation - -SDK library and demo are available on [GitHub](https://github.com/LoginRadius/python-sdk). - ### Prerequisites You will need at least Python - 2.7 or greater. LoginRadius module utilizes the [namedtuple](https://docs.python.org/2/library/collections.html#collections.namedtuple) from the collections library and the [import_module](https://docs.python.org/2/library/importlib.html) from importlib. @@ -34,13 +29,13 @@ You will need at least Python - 2.7 or greater. LoginRadius module utilizes the Using pip ``` - pip install loginradius-v2==10.0.0-beta + pip install loginradius-v2==10.0.0 ``` or with easy_install ``` - easy_install loginradius-v2==10.0.0-beta + easy_install loginradius-v2==10.0.0 ``` ### Install From Source @@ -94,8 +89,6 @@ To enable API request signing, set the value of 'API_REQUEST_SIGNING' to True LR.API_REQUEST_SIGNING = True ``` -APIs - ### Authentication API @@ -119,7 +112,6 @@ List of APIs in this Section:
* POST : [Auth Login by Username](#LoginByUserName-post-)
* POST : [Auth Forgot Password](#ForgotPassword-post-)
* POST : [Auth User Registration by Email](#UserRegistrationByEmail-post-)
-* POST : [Phone User Registration by SMS](#UserRegistrationByPhone-post-)
* POST : [Auth User Registration By Captcha](#UserRegistrationByCaptcha-post-)
* GET : [Get Security Questions By Email](#GetSecurityQuestionsByEmail-get-)
* GET : [Get Security Questions By UserName](#GetSecurityQuestionsByUserName-get-)
@@ -156,11 +148,11 @@ user_profile_update_model = { } #Required email_template = "" #Optional fields = "" #Optional -null_support = True #Optional +null_support = "True" #Optional sms_template = "" #Optional verification_url = "" #Optional -loginradius.authentication.update_profile_by_access_token(access_token, user_profile_update_model, email_template, fields, null_support, sms_template, verification_url) +result = loginradius.authentication.update_profile_by_access_token(access_token, user_profile_update_model, email_template, fields, null_support, sms_template, verification_url) ``` @@ -176,7 +168,7 @@ unlock_profile_model = { "g-recaptcha-response" : "" } #Required -loginradius.authentication.unlock_account_by_token(access_token, unlock_profile_model) +result = loginradius.authentication.unlock_account_by_token(access_token, unlock_profile_model) ``` @@ -195,7 +187,7 @@ fields = "" #Optional url = "" #Optional welcome_email_template = "" #Optional -loginradius.authentication.verify_email_by_otp(email_verification_by_otp_model, fields, url, welcome_email_template) +result = loginradius.authentication.verify_email_by_otp(email_verification_by_otp_model, fields, url, welcome_email_template) ``` @@ -212,7 +204,7 @@ reset_password_by_security_answer_and_email_model = { "securityAnswer" : {"QuestionID":"Answer"} } #Required -loginradius.authentication.reset_password_by_security_answer_and_email(reset_password_by_security_answer_and_email_model) +result = loginradius.authentication.reset_password_by_security_answer_and_email(reset_password_by_security_answer_and_email_model) ``` @@ -229,7 +221,7 @@ reset_password_by_security_answer_and_phone_model = { "securityAnswer" : {"QuestionID":"Answer"} } #Required -loginradius.authentication.reset_password_by_security_answer_and_phone(reset_password_by_security_answer_and_phone_model) +result = loginradius.authentication.reset_password_by_security_answer_and_phone(reset_password_by_security_answer_and_phone_model) ``` @@ -246,7 +238,7 @@ reset_password_by_security_answer_and_user_name_model = { "userName" : "" } #Required -loginradius.authentication.reset_password_by_security_answer_and_user_name(reset_password_by_security_answer_and_user_name_model) +result = loginradius.authentication.reset_password_by_security_answer_and_user_name(reset_password_by_security_answer_and_user_name_model) ``` @@ -262,7 +254,7 @@ reset_password_by_reset_token_model = { "resetToken" : "" } #Required -loginradius.authentication.reset_password_by_reset_token(reset_password_by_reset_token_model) +result = loginradius.authentication.reset_password_by_reset_token(reset_password_by_reset_token_model) ``` @@ -279,7 +271,7 @@ reset_password_by_email_and_otp_model = { "password" : "" } #Required -loginradius.authentication.reset_password_by_email_otp(reset_password_by_email_and_otp_model) +result = loginradius.authentication.reset_password_by_email_otp(reset_password_by_email_and_otp_model) ``` @@ -296,7 +288,7 @@ reset_password_by_user_name_model = { "userName" : "" } #Required -loginradius.authentication.reset_password_by_otp_and_user_name(reset_password_by_user_name_model) +result = loginradius.authentication.reset_password_by_otp_and_user_name(reset_password_by_user_name_model) ``` @@ -311,7 +303,7 @@ access_token = "" #Required new_password = "" #Required old_password = "" #Required -loginradius.authentication.change_password(access_token, new_password, old_password) +result = loginradius.authentication.change_password(access_token, new_password, old_password) ``` @@ -325,7 +317,7 @@ loginradius.authentication.change_password(access_token, new_password, old_passw access_token = "" #Required candidate_token = "" #Required -loginradius.authentication.link_social_identities(access_token, candidate_token) +result = loginradius.authentication.link_social_identities(access_token, candidate_token) ``` @@ -339,7 +331,7 @@ loginradius.authentication.link_social_identities(access_token, candidate_token) access_token = "" #Required username = "" #Required -loginradius.authentication.set_or_change_user_name(access_token, username) +result = loginradius.authentication.set_or_change_user_name(access_token, username) ``` @@ -354,7 +346,7 @@ email = "" #Required email_template = "" #Optional verification_url = "" #Optional -loginradius.authentication.auth_resend_email_verification(email, email_template, verification_url) +result = loginradius.authentication.auth_resend_email_verification(email, email_template, verification_url) ``` @@ -371,7 +363,7 @@ type = "" #Required email_template = "" #Optional verification_url = "" #Optional -loginradius.authentication.add_email(access_token, email, type, email_template, verification_url) +result = loginradius.authentication.add_email(access_token, email, type, email_template, verification_url) ``` @@ -391,7 +383,7 @@ fields = "" #Optional login_url = "" #Optional verification_url = "" #Optional -loginradius.authentication.login_by_email(email_authentication_model, email_template, fields, login_url, verification_url) +result = loginradius.authentication.login_by_email(email_authentication_model, email_template, fields, login_url, verification_url) ``` @@ -411,7 +403,7 @@ fields = "" #Optional login_url = "" #Optional verification_url = "" #Optional -loginradius.authentication.login_by_user_name(user_name_authentication_model, email_template, fields, login_url, verification_url) +result = loginradius.authentication.login_by_user_name(user_name_authentication_model, email_template, fields, login_url, verification_url) ``` @@ -426,7 +418,7 @@ email = "" #Required reset_password_url = "" #Required email_template = "" #Optional -loginradius.authentication.forgot_password(email, reset_password_url, email_template) +result = loginradius.authentication.forgot_password(email, reset_password_url, email_template) ``` @@ -453,31 +445,7 @@ options = "" #Optional verification_url = "" #Optional welcome_email_template = "" #Optional -loginradius.authentication.user_registration_by_email(auth_user_registration_model, sott, email_template, fields, options, verification_url, welcome_email_template) - ``` - - - - -
Phone User Registration by SMS (POST)
- This API registers the new users into your Cloud Storage and triggers the phone verification process. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-user-registration-by-sms) - - ``` - -auth_user_registration_model = { -"firstName" : "", -"lastName" : "", -"password" : "", -"phoneId" : "" -} #Required -sott = "" #Required -fields = "" #Optional -options = "" #Optional -sms_template = "" #Optional -verification_url = "" #Optional -welcome_email_template = "" #Optional - -loginradius.authentication.user_registration_by_phone(auth_user_registration_model, sott, fields, options, sms_template, verification_url, welcome_email_template) +result = loginradius.authentication.user_registration_by_email(auth_user_registration_model, sott, email_template, fields, options, verification_url, welcome_email_template) ``` @@ -505,7 +473,7 @@ sms_template = "" #Optional verification_url = "" #Optional welcome_email_template = "" #Optional -loginradius.authentication.user_registration_by_captcha(auth_user_registration_model_with_captcha, email_template, fields, options, sms_template, verification_url, welcome_email_template) +result = loginradius.authentication.user_registration_by_captcha(auth_user_registration_model_with_captcha, email_template, fields, options, sms_template, verification_url, welcome_email_template) ``` @@ -518,7 +486,7 @@ loginradius.authentication.user_registration_by_captcha(auth_user_registration_m email = "" #Required -loginradius.authentication.get_security_questions_by_email(email) +result = loginradius.authentication.get_security_questions_by_email(email) ``` @@ -531,7 +499,7 @@ loginradius.authentication.get_security_questions_by_email(email) user_name = "" #Required -loginradius.authentication.get_security_questions_by_user_name(user_name) +result = loginradius.authentication.get_security_questions_by_user_name(user_name) ``` @@ -544,7 +512,7 @@ loginradius.authentication.get_security_questions_by_user_name(user_name) phone = "" #Required -loginradius.authentication.get_security_questions_by_phone(phone) +result = loginradius.authentication.get_security_questions_by_phone(phone) ``` @@ -557,7 +525,7 @@ loginradius.authentication.get_security_questions_by_phone(phone) access_token = "" #Required -loginradius.authentication.get_security_questions_by_access_token(access_token) +result = loginradius.authentication.get_security_questions_by_access_token(access_token) ``` @@ -570,7 +538,7 @@ loginradius.authentication.get_security_questions_by_access_token(access_token) access_token = "" #Required -loginradius.authentication.auth_validate_access_token(access_token) +result = loginradius.authentication.auth_validate_access_token(access_token) ``` @@ -582,9 +550,9 @@ loginradius.authentication.auth_validate_access_token(access_token) ``` access_token = "" #Required -prevent_refresh = True #Optional +prevent_refresh = "True" #Optional -loginradius.authentication.auth_in_validate_access_token(access_token, prevent_refresh) +result = loginradius.authentication.auth_in_validate_access_token(access_token, prevent_refresh) ``` @@ -597,7 +565,7 @@ loginradius.authentication.auth_in_validate_access_token(access_token, prevent_r access_token = "" #Required -loginradius.authentication.get_access_token_info(access_token) +result = loginradius.authentication.get_access_token_info(access_token) ``` @@ -611,7 +579,7 @@ loginradius.authentication.get_access_token_info(access_token) access_token = "" #Required fields = "" #Optional -loginradius.authentication.get_profile_by_access_token(access_token, fields) +result = loginradius.authentication.get_profile_by_access_token(access_token, fields) ``` @@ -625,7 +593,7 @@ loginradius.authentication.get_profile_by_access_token(access_token, fields) access_token = "" #Required welcome_email_template = "" #Optional -loginradius.authentication.send_welcome_email(access_token, welcome_email_template) +result = loginradius.authentication.send_welcome_email(access_token, welcome_email_template) ``` @@ -638,7 +606,7 @@ loginradius.authentication.send_welcome_email(access_token, welcome_email_templa deletetoken = "" #Required -loginradius.authentication.delete_account_by_delete_token(deletetoken) +result = loginradius.authentication.delete_account_by_delete_token(deletetoken) ``` @@ -651,7 +619,7 @@ loginradius.authentication.delete_account_by_delete_token(deletetoken) email = "" #Required -loginradius.authentication.check_email_availability(email) +result = loginradius.authentication.check_email_availability(email) ``` @@ -667,7 +635,7 @@ fields = "" #Optional url = "" #Optional welcome_email_template = "" #Optional -loginradius.authentication.verify_email(verification_token, fields, url, welcome_email_template) +result = loginradius.authentication.verify_email(verification_token, fields, url, welcome_email_template) ``` @@ -681,7 +649,7 @@ loginradius.authentication.verify_email(verification_token, fields, url, welcome access_token = "" #Required fields = "" #Optional -loginradius.authentication.get_social_identity(access_token, fields) +result = loginradius.authentication.get_social_identity(access_token, fields) ``` @@ -694,7 +662,7 @@ loginradius.authentication.get_social_identity(access_token, fields) username = "" #Required -loginradius.authentication.check_user_name_availability(username) +result = loginradius.authentication.check_user_name_availability(username) ``` @@ -708,7 +676,7 @@ loginradius.authentication.check_user_name_availability(username) access_token = "" #Required fields = "" #Optional -loginradius.authentication.accept_privacy_policy(access_token, fields) +result = loginradius.authentication.accept_privacy_policy(access_token, fields) ``` @@ -721,7 +689,7 @@ loginradius.authentication.accept_privacy_policy(access_token, fields) access_token = "" #Required -loginradius.authentication.get_privacy_policy_history_by_access_token(access_token) +result = loginradius.authentication.get_privacy_policy_history_by_access_token(access_token) ``` @@ -736,7 +704,7 @@ access_token = "" #Required delete_url = "" #Optional email_template = "" #Optional -loginradius.authentication.delete_account_with_email_confirmation(access_token, delete_url, email_template) +result = loginradius.authentication.delete_account_with_email_confirmation(access_token, delete_url, email_template) ``` @@ -750,7 +718,7 @@ loginradius.authentication.delete_account_with_email_confirmation(access_token, access_token = "" #Required email = "" #Required -loginradius.authentication.remove_email(access_token, email) +result = loginradius.authentication.remove_email(access_token, email) ``` @@ -765,7 +733,7 @@ access_token = "" #Required provider = "" #Required provider_id = "" #Required -loginradius.authentication.unlink_social_identities(access_token, provider, provider_id) +result = loginradius.authentication.unlink_social_identities(access_token, provider, provider_id) ``` @@ -784,6 +752,7 @@ List of APIs in this Section:
* PUT : [Account Invalidate Verification Email](#InvalidateAccountEmailVerification-put-)
* PUT : [Reset phone ID verification](#ResetPhoneIDVerificationByUid-put-)
* PUT : [Upsert Email](#UpsertEmail-put-)
+* PUT : [Update UID](#AccountUpdateUid-put-)
* POST : [Account Create](#CreateAccount-post-)
* POST : [Forgot Password token](#GetForgotPasswordToken-post-)
* POST : [Email Verification token](#GetEmailVerificationToken-post-)
@@ -799,12 +768,13 @@ List of APIs in this Section:
* GET : [Account Identities by Email](#GetAccountIdentitiesByEmail-get-)
* DELETE : [Account Delete](#DeleteAccountByUid-delete-)
* DELETE : [Account Remove Email](#RemoveEmail-delete-)
+* DELETE : [Delete User Profiles By Email](#AccountDeleteByEmail-delete-)
Account Update (PUT)
- This API is used to update the information of existing accounts in your Cloud Storage. See our Advanced API Usage section Here for more capabilities. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-update) + This API is used to update the information of existing accounts in your Cloud Storage. See our Advanced API Usage section Here for more capabilities. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-update) ``` @@ -814,9 +784,9 @@ account_user_profile_update_model = { } #Required uid = "" #Required fields = "" #Optional -null_support = True #Optional +null_support = "True" #Optional -loginradius.account.update_account_by_uid(account_user_profile_update_model, uid, fields, null_support) +result = loginradius.account.update_account_by_uid(account_user_profile_update_model, uid, fields, null_support) ``` @@ -831,7 +801,7 @@ phone = "" #Required uid = "" #Required fields = "" #Optional -loginradius.account.update_phone_id_by_uid(phone, uid, fields) +result = loginradius.account.update_phone_id_by_uid(phone, uid, fields) ``` @@ -845,7 +815,7 @@ loginradius.account.update_phone_id_by_uid(phone, uid, fields) password = "" #Required uid = "" #Required -loginradius.account.set_account_password_by_uid(password, uid) +result = loginradius.account.set_account_password_by_uid(password, uid) ``` @@ -860,7 +830,7 @@ uid = "" #Required email_template = "" #Optional verification_url = "" #Optional -loginradius.account.invalidate_account_email_verification(uid, email_template, verification_url) +result = loginradius.account.invalidate_account_email_verification(uid, email_template, verification_url) ``` @@ -874,7 +844,7 @@ loginradius.account.invalidate_account_email_verification(uid, email_template, v uid = "" #Required sms_template = "" #Optional -loginradius.account.reset_phone_id_verification_by_uid(uid, sms_template) +result = loginradius.account.reset_phone_id_verification_by_uid(uid, sms_template) ``` @@ -894,7 +864,23 @@ upsert_email_model = { uid = "" #Required fields = "" #Optional -loginradius.account.upsert_email(upsert_email_model, uid, fields) +result = loginradius.account.upsert_email(upsert_email_model, uid, fields) + ``` + + + + +
Update UID (PUT)
+ 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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-update/) + + ``` + +update_uid_model = { +"newUid" : "" +} #Required +uid = "" #Required + +result = loginradius.account.account_update_uid(update_uid_model, uid) ``` @@ -916,7 +902,7 @@ account_create_model = { } #Required fields = "" #Optional -loginradius.account.create_account(account_create_model, fields) +result = loginradius.account.create_account(account_create_model, fields) ``` @@ -930,9 +916,9 @@ loginradius.account.create_account(account_create_model, fields) email = "" #Required email_template = "" #Optional reset_password_url = "" #Optional -send_email = True #Optional +send_email = "True" #Optional -loginradius.account.get_forgot_password_token(email, email_template, reset_password_url, send_email) +result = loginradius.account.get_forgot_password_token(email, email_template, reset_password_url, send_email) ``` @@ -945,7 +931,7 @@ loginradius.account.get_forgot_password_token(email, email_template, reset_passw email = "" #Required -loginradius.account.get_email_verification_token(email) +result = loginradius.account.get_email_verification_token(email) ``` @@ -958,7 +944,7 @@ loginradius.account.get_email_verification_token(email) uid = "" #Required -loginradius.account.get_privacy_policy_history_by_uid(uid) +result = loginradius.account.get_privacy_policy_history_by_uid(uid) ``` @@ -972,7 +958,7 @@ loginradius.account.get_privacy_policy_history_by_uid(uid) email = "" #Required fields = "" #Optional -loginradius.account.get_account_profile_by_email(email, fields) +result = loginradius.account.get_account_profile_by_email(email, fields) ``` @@ -986,7 +972,7 @@ loginradius.account.get_account_profile_by_email(email, fields) user_name = "" #Required fields = "" #Optional -loginradius.account.get_account_profile_by_user_name(user_name, fields) +result = loginradius.account.get_account_profile_by_user_name(user_name, fields) ``` @@ -1000,7 +986,7 @@ loginradius.account.get_account_profile_by_user_name(user_name, fields) phone = "" #Required fields = "" #Optional -loginradius.account.get_account_profile_by_phone(phone, fields) +result = loginradius.account.get_account_profile_by_phone(phone, fields) ``` @@ -1014,7 +1000,7 @@ loginradius.account.get_account_profile_by_phone(phone, fields) uid = "" #Required fields = "" #Optional -loginradius.account.get_account_profile_by_uid(uid, fields) +result = loginradius.account.get_account_profile_by_uid(uid, fields) ``` @@ -1027,7 +1013,7 @@ loginradius.account.get_account_profile_by_uid(uid, fields) uid = "" #Required -loginradius.account.get_account_password_hash_by_uid(uid) +result = loginradius.account.get_account_password_hash_by_uid(uid) ``` @@ -1040,7 +1026,7 @@ loginradius.account.get_account_password_hash_by_uid(uid) uid = "" #Required -loginradius.account.get_access_token_by_uid(uid) +result = loginradius.account.get_access_token_by_uid(uid) ``` @@ -1053,7 +1039,7 @@ loginradius.account.get_access_token_by_uid(uid) refresh_token = "" #Required -loginradius.account.refresh_access_token_by_refresh_token(refresh_token) +result = loginradius.account.refresh_access_token_by_refresh_token(refresh_token) ``` @@ -1066,7 +1052,7 @@ loginradius.account.refresh_access_token_by_refresh_token(refresh_token) refresh_token = "" #Required -loginradius.account.revoke_refresh_token(refresh_token) +result = loginradius.account.revoke_refresh_token(refresh_token) ``` @@ -1080,7 +1066,7 @@ loginradius.account.revoke_refresh_token(refresh_token) email = "" #Required fields = "" #Optional -loginradius.account.get_account_identities_by_email(email, fields) +result = loginradius.account.get_account_identities_by_email(email, fields) ``` @@ -1093,7 +1079,7 @@ loginradius.account.get_account_identities_by_email(email, fields) uid = "" #Required -loginradius.account.delete_account_by_uid(uid) +result = loginradius.account.delete_account_by_uid(uid) ``` @@ -1108,7 +1094,20 @@ email = "" #Required uid = "" #Required fields = "" #Optional -loginradius.account.remove_email(email, uid, fields) +result = loginradius.account.remove_email(email, uid, fields) + ``` + + + + +
Delete User Profiles By Email (DELETE)
+ This API is used to delete all user profiles associated with an Email. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-email-delete/) + + ``` + +email = "" #Required + +result = loginradius.account.account_delete_by_email(email) ``` @@ -1116,7 +1115,7 @@ loginradius.account.remove_email(email, uid, fields) -### Social API +### Social API List of APIs in this Section:
@@ -1132,18 +1131,24 @@ List of APIs in this Section:
* GET : [Get Active Session By Account Id](#GetActiveSessionByAccountID-get-)
* GET : [Get Active Session By Profile Id](#GetActiveSessionByProfileID-get-)
* GET : [Album](#GetAlbums-get-)
+* GET : [Get Albums with cursor](#GetAlbumsWithCursor-get-)
* GET : [Audio](#GetAudios-get-)
+* GET : [Get Audio With Cursor](#GetAudiosWithCursor-get-)
* GET : [Check In](#GetCheckIns-get-)
+* GET : [Get CheckIns With Cursor](#GetCheckInsWithCursor-get-)
* GET : [Contact](#GetContacts-get-)
* GET : [Event](#GetEvents-get-)
+* GET : [Get Events With Cursor](#GetEventsWithCursor-get-)
* GET : [Following](#GetFollowings-get-)
+* GET : [Get Followings With Cursor](#GetFollowingsWithCursor-get-)
* GET : [Group](#GetGroups-get-)
+* GET : [Get Groups With Cursor](#GetGroupsWithCursor-get-)
* GET : [Like](#GetLikes-get-)
+* GET : [Get Likes With Cursor](#GetLikesWithCursor-get-)
* GET : [Mention](#GetMentions-get-)
* GET : [Page](#GetPage-get-)
* GET : [Photo](#GetPhotos-get-)
* GET : [Get Post](#GetPosts-get-)
-* GET : [Get Status](#GetStatus-get-)
* GET : [Get Trackable Status Stats](#GetTrackableStatusStats-get-)
* GET : [Trackable Status Fetching](#TrackableStatusFetching-get-)
* GET : [User Profile](#GetSocialUserProfile-get-)
@@ -1154,7 +1159,7 @@ List of APIs in this Section:
Post Message API (POST)
- Post Message API is used to post messages to the user’s contacts.

Supported Providers: Twitter, LinkedIn

The Message API is used to post messages to the user’s contacts. This is one of the APIs that makes up the LoginRadius Friend Invite System. After using the Contact API, you can send messages to the retrieved contacts. This API requires setting permissions in your LoginRadius Dashboard.

GET & POST Message API work the same way except the API method is different [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/post-message-api) + Post Message API is used to post messages to the user's contacts.

Supported Providers: Twitter, LinkedIn

The Message API is used to post messages to the user?s contacts. This is one of the APIs that makes up the LoginRadius Friend Invite System. After using the Contact API, you can send messages to the retrieved contacts. This API requires setting permissions in your LoginRadius Dashboard.

GET & POST Message API work the same way except the API method is different [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/post-message-api) ``` @@ -1163,14 +1168,14 @@ message = "" #Required subject = "" #Required to = "" #Required -loginradius.social.post_message(access_token, message, subject, to) +result = loginradius.social.post_message(access_token, message, subject, to) ```
Status Posting (POST)
- The Status API is used to update the status on the user’s wall.

Supported Providers: Facebook, Twitter, LinkedIn [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/status-posting/) + The Status API is used to update the status on the user's wall.

Supported Providers: Facebook, Twitter, LinkedIn [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/status-posting/) ``` @@ -1183,14 +1188,14 @@ title = "" #Required url = "<url>" #Required shorturl = "<shorturl>" #Optional -loginradius.social.status_posting(access_token, caption, description, imageurl, status, title, url, shorturl) +result = loginradius.social.status_posting(access_token, caption, description, imageurl, status, title, url, shorturl) ``` <h6 id="TrackableStatusPosting-post-"> Trackable Status Posting (POST)</h6> - The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> The Trackable Status API is used to update the status on the user’s wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications.<br><br> POST Input Parameter Format: application/x-www-form-urlencoded [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/trackable-status-posting/) + The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> The Trackable Status API is used to update the status on the user's wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications.<br><br> POST Input Parameter Format: application/x-www-form-urlencoded [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/trackable-status-posting/) ``` @@ -1204,7 +1209,7 @@ status_model = { "url" : "<url>" } #Required -loginradius.social.trackable_status_posting(access_token, status_model) +result = loginradius.social.trackable_status_posting(access_token, status_model) ``` @@ -1217,7 +1222,7 @@ loginradius.social.trackable_status_posting(access_token, status_model) token = "<token>" #Required -loginradius.social.exchange_access_token(token) +result = loginradius.social.exchange_access_token(token) ``` @@ -1231,7 +1236,7 @@ loginradius.social.exchange_access_token(token) access_token = "<access_token>" #Required expires_in = 0 #Optional -loginradius.social.refresh_access_token(access_token, expires_in) +result = loginradius.social.refresh_access_token(access_token, expires_in) ``` @@ -1244,7 +1249,7 @@ loginradius.social.refresh_access_token(access_token, expires_in) access_token = "<access_token>" #Required -loginradius.social.validate_access_token(access_token) +result = loginradius.social.validate_access_token(access_token) ``` @@ -1257,7 +1262,7 @@ loginradius.social.validate_access_token(access_token) access_token = "<access_token>" #Required -loginradius.social.in_validate_access_token(access_token) +result = loginradius.social.in_validate_access_token(access_token) ``` @@ -1270,7 +1275,7 @@ loginradius.social.in_validate_access_token(access_token) token = "<token>" #Required -loginradius.social.get_active_session(token) +result = loginradius.social.get_active_session(token) ``` @@ -1283,7 +1288,7 @@ loginradius.social.get_active_session(token) account_id = "<account_id>" #Required -loginradius.social.get_active_session_by_account_id(account_id) +result = loginradius.social.get_active_session_by_account_id(account_id) ``` @@ -1296,7 +1301,7 @@ loginradius.social.get_active_session_by_account_id(account_id) profile_id = "<profile_id>" #Required -loginradius.social.get_active_session_by_profile_id(profile_id) +result = loginradius.social.get_active_session_by_profile_id(profile_id) ``` @@ -1309,173 +1314,258 @@ loginradius.social.get_active_session_by_profile_id(profile_id) access_token = "<access_token>" #Required -loginradius.social.get_albums(access_token) +result = loginradius.social.get_albums(access_token) + ``` + + + + +<h6 id="GetAlbumsWithCursor-get-"> Get Albums with cursor (GET)</h6> + <b>Supported Providers:</b> Facebook, Google, Live, Vkontakte.<br><br> This API returns the photo albums associated with the passed in access tokens Social Profile. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/album/) + + ``` + +access_token = "<access_token>" #Required +next_cursor = "<next_cursor>" #Required + +result = loginradius.social.get_albums_with_cursor(access_token, next_cursor) ``` <h6 id="GetAudios-get-"> Audio (GET)</h6> - The Audio API is used to get audio files data from the user’s social account.<br><br><b>Supported Providers:</b> Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/audio) + The Audio API is used to get audio files data from the user's social account.<br><br><b>Supported Providers:</b> Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/audio) ``` access_token = "<access_token>" #Required -loginradius.social.get_audios(access_token) +result = loginradius.social.get_audios(access_token) + ``` + + + + +<h6 id="GetAudiosWithCursor-get-"> Get Audio With Cursor (GET)</h6> + The Audio API is used to get audio files data from the user's social account.<br><br><b>Supported Providers:</b> Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/audio) + + ``` + +access_token = "<access_token>" #Required +next_cursor = "<next_cursor>" #Required + +result = loginradius.social.get_audios_with_cursor(access_token, next_cursor) ``` <h6 id="GetCheckIns-get-"> Check In (GET)</h6> - The Check In API is used to get check Ins data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/check-in) + The Check In API is used to get check Ins data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/check-in) ``` access_token = "<access_token>" #Required -loginradius.social.get_check_ins(access_token) +result = loginradius.social.get_check_ins(access_token) + ``` + + + + +<h6 id="GetCheckInsWithCursor-get-"> Get CheckIns With Cursor (GET)</h6> + The Check In API is used to get check Ins data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/check-in) + + ``` + +access_token = "<access_token>" #Required +next_cursor = "<next_cursor>" #Required + +result = loginradius.social.get_check_ins_with_cursor(access_token, next_cursor) ``` <h6 id="GetContacts-get-"> Contact (GET)</h6> - The Contact API is used to get contacts/friends/connections data from the user’s social account.This is one of the APIs that makes up the LoginRadius Friend Invite System. The data will normalized into LoginRadius’ standard data format. This API requires setting permissions in your LoginRadius Dashboard. <br><br><b>Note:</b> Facebook restricts access to the list of friends that is returned. When using the Contacts API with Facebook you will only receive friends that have accepted some permissions with your app. <br><br><b>Supported Providers:</b> Facebook, Foursquare, Google, LinkedIn, Live, Twitter, Vkontakte, Yahoo [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/contact) + The Contact API is used to get contacts/friends/connections data from the user's social account.This is one of the APIs that makes up the LoginRadius Friend Invite System. The data will normalized into LoginRadius' standard data format. This API requires setting permissions in your LoginRadius Dashboard. <br><br><b>Note:</b> Facebook restricts access to the list of friends that is returned. When using the Contacts API with Facebook you will only receive friends that have accepted some permissions with your app. <br><br><b>Supported Providers:</b> Facebook, Foursquare, Google, LinkedIn, Live, Twitter, Vkontakte, Yahoo [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/contact) ``` access_token = "<access_token>" #Required next_cursor = "<next_cursor>" #Optional -loginradius.social.get_contacts(access_token, next_cursor) +result = loginradius.social.get_contacts(access_token, next_cursor) ``` <h6 id="GetEvents-get-"> Event (GET)</h6> - The Event API is used to get the event data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Live [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/event) + The Event API is used to get the event data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Live [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/event) ``` access_token = "<access_token>" #Required -loginradius.social.get_events(access_token) +result = loginradius.social.get_events(access_token) + ``` + + + + +<h6 id="GetEventsWithCursor-get-"> Get Events With Cursor (GET)</h6> + The Event API is used to get the event data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Live [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/event) + + ``` + +access_token = "<access_token>" #Required +next_cursor = "<next_cursor>" #Required + +result = loginradius.social.get_events_with_cursor(access_token, next_cursor) ``` <h6 id="GetFollowings-get-"> Following (GET)</h6> - Get the following user list from the user’s social account.<br><br><b>Supported Providers:</b> Twitter [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/following) + Get the following user list from the user's social account.<br><br><b>Supported Providers:</b> Twitter [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/following) ``` access_token = "<access_token>" #Required -loginradius.social.get_followings(access_token) +result = loginradius.social.get_followings(access_token) + ``` + + + + +<h6 id="GetFollowingsWithCursor-get-"> Get Followings With Cursor (GET)</h6> + Get the following user list from the user's social account.<br><br><b>Supported Providers:</b> Twitter [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/following) + + ``` + +access_token = "<access_token>" #Required +next_cursor = "<next_cursor>" #Required + +result = loginradius.social.get_followings_with_cursor(access_token, next_cursor) ``` <h6 id="GetGroups-get-"> Group (GET)</h6> - The Group API is used to get group data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/group) + The Group API is used to get group data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/group) ``` access_token = "<access_token>" #Required -loginradius.social.get_groups(access_token) +result = loginradius.social.get_groups(access_token) ``` -<h6 id="GetLikes-get-"> Like (GET)</h6> - The Like API is used to get likes data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/like) +<h6 id="GetGroupsWithCursor-get-"> Get Groups With Cursor (GET)</h6> + The Group API is used to get group data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/group) ``` -access_token = "<access_token>" #Required +access_token = "<access_token>" #Required +next_cursor = "<next_cursor>" #Required -loginradius.social.get_likes(access_token) +result = loginradius.social.get_groups_with_cursor(access_token, next_cursor) ``` -<h6 id="GetMentions-get-"> Mention (GET)</h6> - The Mention API is used to get mentions data from the user’s social account.<br><br><b>Supported Providers:</b> Twitter [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/mention) +<h6 id="GetLikes-get-"> Like (GET)</h6> + The Like API is used to get likes data from the user's social account.<br><br><b>Supported Providers:</b> Facebook [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/like) ``` access_token = "<access_token>" #Required -loginradius.social.get_mentions(access_token) +result = loginradius.social.get_likes(access_token) ``` -<h6 id="GetPage-get-"> Page (GET)</h6> - The Page API is used to get the page data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, LinkedIn [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/page) +<h6 id="GetLikesWithCursor-get-"> Get Likes With Cursor (GET)</h6> + The Like API is used to get likes data from the user's social account.<br><br><b>Supported Providers:</b> Facebook [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/like) ``` access_token = "<access_token>" #Required -page_name = "<page_name>" #Required +next_cursor = "<next_cursor>" #Required -loginradius.social.get_page(access_token, page_name) +result = loginradius.social.get_likes_with_cursor(access_token, next_cursor) ``` -<h6 id="GetPhotos-get-"> Photo (GET)</h6> - The Photo API is used to get photo data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Google, Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/photo) +<h6 id="GetMentions-get-"> Mention (GET)</h6> + The Mention API is used to get mentions data from the user's social account.<br><br><b>Supported Providers:</b> Twitter [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/mention) + + ``` + +access_token = "<access_token>" #Required + +result = loginradius.social.get_mentions(access_token) + ``` + + + + +<h6 id="GetPage-get-"> Page (GET)</h6> + The Page API is used to get the page data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, LinkedIn [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/page) ``` access_token = "<access_token>" #Required -album_id = "<album_id>" #Required +page_name = "<page_name>" #Required -loginradius.social.get_photos(access_token, album_id) +result = loginradius.social.get_page(access_token, page_name) ``` -<h6 id="GetPosts-get-"> Get Post (GET)</h6> - The Post API is used to get post message data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/post) +<h6 id="GetPhotos-get-"> Photo (GET)</h6> + The Photo API is used to get photo data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Google, Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/photo) ``` -access_token = "<access_token>" #Required +access_token = "<access_token>" #Required +album_id = "<album_id>" #Required -loginradius.social.get_posts(access_token) +result = loginradius.social.get_photos(access_token, album_id) ``` -<h6 id="GetStatus-get-"> Get Status (GET)</h6> - The Status API is used to get the status messages from the user’s social account. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/status-fetching) +<h6 id="GetPosts-get-"> Get Post (GET)</h6> + The Post API is used to get post message data from the user's social account.<br><br><b>Supported Providers:</b> Facebook [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/post) ``` access_token = "<access_token>" #Required -loginradius.social.get_status(access_token) +result = loginradius.social.get_posts(access_token) ``` <h6 id="GetTrackableStatusStats-get-"> Get Trackable Status Stats (GET)</h6> - The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> The Trackable Status API is used to update the status on the user’s wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/get-trackable-status-stats/) + The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> The Trackable Status API is used to update the status on the user's wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/get-trackable-status-stats/) ``` @@ -1487,7 +1577,7 @@ status = "<status>" #Required title = "<title>" #Required url = "<url>" #Required -loginradius.social.get_trackable_status_stats(access_token, caption, description, imageurl, status, title, url) +result = loginradius.social.get_trackable_status_stats(access_token, caption, description, imageurl, status, title, url) ``` @@ -1500,49 +1590,49 @@ loginradius.social.get_trackable_status_stats(access_token, caption, description post_id = "<post_id>" #Required -loginradius.social.trackable_status_fetching(post_id) +result = loginradius.social.trackable_status_fetching(post_id) ``` <h6 id="GetSocialUserProfile-get-"> User Profile (GET)</h6> - The User Profile API is used to get social profile data from the user’s social account after authentication.<br><br><b>Supported Providers:</b> All [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/user-profile) + The User Profile API is used to get social profile data from the user's social account after authentication.<br><br><b>Supported Providers:</b> All [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/user-profile) ``` access_token = "<access_token>" #Required fields = "<fields>" #Optional -loginradius.social.get_social_user_profile(access_token, fields) +result = loginradius.social.get_social_user_profile(access_token, fields) ``` <h6 id="GetRefreshedSocialUserProfile-get-"> Refresh User Profile (GET)</h6> - The User Profile API is used to get the latest updated social profile data from the user’s social account after authentication. The social profile will be retrieved via oAuth and OpenID protocols. The data is normalized into LoginRadius’ standard data format. This API should be called using the access token retrieved from the refresh access token API. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/refresh-user-profile) + The User Profile API is used to get the latest updated social profile data from the user's social account after authentication. The social profile will be retrieved via oAuth and OpenID protocols. The data is normalized into LoginRadius' standard data format. This API should be called using the access token retrieved from the refresh access token API. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/refresh-user-profile) ``` access_token = "<access_token>" #Required fields = "<fields>" #Optional -loginradius.social.get_refreshed_social_user_profile(access_token, fields) +result = loginradius.social.get_refreshed_social_user_profile(access_token, fields) ``` <h6 id="GetVideos-get-"> Video (GET)</h6> - The Video API is used to get video files data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Google, Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/video) + The Video API is used to get video files data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Google, Live, Vkontakte [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/video) ``` access_token = "<access_token>" #Required next_cursor = "<next_cursor>" #Required -loginradius.social.get_videos(access_token, next_cursor) +result = loginradius.social.get_videos(access_token, next_cursor) ``` @@ -1550,7 +1640,7 @@ loginradius.social.get_videos(access_token, next_cursor) -### Custom Object API +### CustomObject API List of APIs in this Section:<br> @@ -1580,7 +1670,7 @@ object_record_id = "<object_record_id>" #Required object = { "customdata1": "Store my customdata1 value"} #Required update_type = "<update_type>" #Optional -loginradius.custom_object.update_custom_object_by_token(access_token, object_name, object_record_id, object, update_type) +result = loginradius.custom_object.update_custom_object_by_token(access_token, object_name, object_record_id, object, update_type) ``` @@ -1597,7 +1687,7 @@ object = { "customdata1": "Store my customdata1 value"} #Required uid = "<uid>" #Required update_type = "<update_type>" #Optional -loginradius.custom_object.update_custom_object_by_uid(object_name, object_record_id, object, uid, update_type) +result = loginradius.custom_object.update_custom_object_by_uid(object_name, object_record_id, object, uid, update_type) ``` @@ -1612,7 +1702,7 @@ access_token = "<access_token>" #Required object_name = "<object_name>" #Required object = { "customdata1": "Store my customdata1 value"} #Required -loginradius.custom_object.create_custom_object_by_token(access_token, object_name, object) +result = loginradius.custom_object.create_custom_object_by_token(access_token, object_name, object) ``` @@ -1627,7 +1717,7 @@ object_name = "<object_name>" #Required object = { "customdata1": "Store my customdata1 value"} #Required uid = "<uid>" #Required -loginradius.custom_object.create_custom_object_by_uid(object_name, object, uid) +result = loginradius.custom_object.create_custom_object_by_uid(object_name, object, uid) ``` @@ -1641,7 +1731,7 @@ loginradius.custom_object.create_custom_object_by_uid(object_name, object, uid) access_token = "<access_token>" #Required object_name = "<object_name>" #Required -loginradius.custom_object.get_custom_object_by_token(access_token, object_name) +result = loginradius.custom_object.get_custom_object_by_token(access_token, object_name) ``` @@ -1656,7 +1746,7 @@ access_token = "<access_token>" #Required object_name = "<object_name>" #Required object_record_id = "<object_record_id>" #Required -loginradius.custom_object.get_custom_object_by_record_id_and_token(access_token, object_name, object_record_id) +result = loginradius.custom_object.get_custom_object_by_record_id_and_token(access_token, object_name, object_record_id) ``` @@ -1670,7 +1760,7 @@ loginradius.custom_object.get_custom_object_by_record_id_and_token(access_token, object_name = "<object_name>" #Required uid = "<uid>" #Required -loginradius.custom_object.get_custom_object_by_uid(object_name, uid) +result = loginradius.custom_object.get_custom_object_by_uid(object_name, uid) ``` @@ -1685,7 +1775,7 @@ object_name = "<object_name>" #Required object_record_id = "<object_record_id>" #Required uid = "<uid>" #Required -loginradius.custom_object.get_custom_object_by_record_id(object_name, object_record_id, uid) +result = loginradius.custom_object.get_custom_object_by_record_id(object_name, object_record_id, uid) ``` @@ -1700,7 +1790,7 @@ access_token = "<access_token>" #Required object_name = "<object_name>" #Required object_record_id = "<object_record_id>" #Required -loginradius.custom_object.delete_custom_object_by_token(access_token, object_name, object_record_id) +result = loginradius.custom_object.delete_custom_object_by_token(access_token, object_name, object_record_id) ``` @@ -1715,7 +1805,7 @@ object_name = "<object_name>" #Required object_record_id = "<object_record_id>" #Required uid = "<uid>" #Required -loginradius.custom_object.delete_custom_object_by_record_id(object_name, object_record_id, uid) +result = loginradius.custom_object.delete_custom_object_by_record_id(object_name, object_record_id, uid) ``` @@ -1723,7 +1813,7 @@ loginradius.custom_object.delete_custom_object_by_record_id(object_name, object_ -### Phone Authentication API +### PhoneAuthentication API List of APIs in this Section:<br> @@ -1736,6 +1826,7 @@ List of APIs in this Section:<br> * POST : [Phone Forgot Password by OTP](#ForgotPasswordByPhoneOTP-post-)<br> * POST : [Phone Resend Verification OTP](#PhoneResendVerificationOTP-post-)<br> * POST : [Phone Resend Verification OTP By Token](#PhoneResendVerificationOTPByToken-post-)<br> +* POST : [Phone User Registration by SMS](#UserRegistrationByPhone-post-)<br> * GET : [Phone Number Availability](#CheckPhoneNumberAvailability-get-)<br> * DELETE : [Remove Phone ID by Access Token](#RemovePhoneIDByAccessToken-delete-)<br> @@ -1753,7 +1844,7 @@ reset_password_by_otp_model = { "phone" : "<phone>" } #Required -loginradius.phone_authentication.reset_password_by_phone_otp(reset_password_by_otp_model) +result = loginradius.phone_authentication.reset_password_by_phone_otp(reset_password_by_otp_model) ``` @@ -1769,7 +1860,7 @@ phone = "<phone>" #Required fields = "<fields>" #Optional sms_template = "<sms_template>" #Optional -loginradius.phone_authentication.phone_verification_by_otp(otp, phone, fields, sms_template) +result = loginradius.phone_authentication.phone_verification_by_otp(otp, phone, fields, sms_template) ``` @@ -1784,7 +1875,7 @@ access_token = "<access_token>" #Required otp = "<otp>" #Required sms_template = "<sms_template>" #Optional -loginradius.phone_authentication.phone_verification_otp_by_access_token(access_token, otp, sms_template) +result = loginradius.phone_authentication.phone_verification_otp_by_access_token(access_token, otp, sms_template) ``` @@ -1799,7 +1890,7 @@ access_token = "<access_token>" #Required phone = "<phone>" #Required sms_template = "<sms_template>" #Optional -loginradius.phone_authentication.update_phone_number(access_token, phone, sms_template) +result = loginradius.phone_authentication.update_phone_number(access_token, phone, sms_template) ``` @@ -1818,7 +1909,7 @@ fields = "<fields>" #Optional login_url = "<login_url>" #Optional sms_template = "<sms_template>" #Optional -loginradius.phone_authentication.login_by_phone(phone_authentication_model, fields, login_url, sms_template) +result = loginradius.phone_authentication.login_by_phone(phone_authentication_model, fields, login_url, sms_template) ``` @@ -1832,7 +1923,7 @@ loginradius.phone_authentication.login_by_phone(phone_authentication_model, fiel phone = "<phone>" #Required sms_template = "<sms_template>" #Optional -loginradius.phone_authentication.forgot_password_by_phone_otp(phone, sms_template) +result = loginradius.phone_authentication.forgot_password_by_phone_otp(phone, sms_template) ``` @@ -1846,7 +1937,7 @@ loginradius.phone_authentication.forgot_password_by_phone_otp(phone, sms_templat phone = "<phone>" #Required sms_template = "<sms_template>" #Optional -loginradius.phone_authentication.phone_resend_verification_otp(phone, sms_template) +result = loginradius.phone_authentication.phone_resend_verification_otp(phone, sms_template) ``` @@ -1861,7 +1952,31 @@ access_token = "<access_token>" #Required phone = "<phone>" #Required sms_template = "<sms_template>" #Optional -loginradius.phone_authentication.phone_resend_verification_otp_by_token(access_token, phone, sms_template) +result = loginradius.phone_authentication.phone_resend_verification_otp_by_token(access_token, phone, sms_template) + ``` + + + + +<h6 id="UserRegistrationByPhone-post-"> Phone User Registration by SMS (POST)</h6> + This API registers the new users into your Cloud Storage and triggers the phone verification process. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-user-registration-by-sms) + + ``` + +auth_user_registration_model = { +"firstName" : "<firstName>", +"lastName" : "<lastName>", +"password" : "<password>", +"phoneId" : "<phoneId>" +} #Required +sott = "<sott>" #Required +fields = "<fields>" #Optional +options = "<options>" #Optional +sms_template = "<sms_template>" #Optional +verification_url = "<verification_url>" #Optional +welcome_email_template = "<welcome_email_template>" #Optional + +result = loginradius.phone_authentication.user_registration_by_phone(auth_user_registration_model, sott, fields, options, sms_template, verification_url, welcome_email_template) ``` @@ -1874,7 +1989,7 @@ loginradius.phone_authentication.phone_resend_verification_otp_by_token(access_t phone = "<phone>" #Required -loginradius.phone_authentication.check_phone_number_availability(phone) +result = loginradius.phone_authentication.check_phone_number_availability(phone) ``` @@ -1887,7 +2002,7 @@ loginradius.phone_authentication.check_phone_number_availability(phone) access_token = "<access_token>" #Required -loginradius.phone_authentication.remove_phone_id_by_access_token(access_token) +result = loginradius.phone_authentication.remove_phone_id_by_access_token(access_token) ``` @@ -1895,7 +2010,7 @@ loginradius.phone_authentication.remove_phone_id_by_access_token(access_token) -### Multi Factor Authentication API +### MultiFactorAuthentication API List of APIs in this Section:<br> @@ -1907,10 +2022,6 @@ List of APIs in this Section:<br> * PUT : [MFA Validate Google Auth Code](#MFAValidateGoogleAuthCode-put-)<br> * PUT : [MFA Validate Backup code](#MFAValidateBackupCode-put-)<br> * PUT : [MFA Update Phone Number](#MFAUpdatePhoneNumber-put-)<br> -* PUT : [Validate MFA by OTP](#MFAReAuthenticateByOTP-put-)<br> -* PUT : [Validate MFA by Backup Code](#MFAReAuthenticateByBackupCode-put-)<br> -* PUT : [Validate MFA by Google Authenticator Code](#MFAReAuthenticateByGoogleAuth-put-)<br> -* PUT : [Validate MFA by Password](#MFAReAuthenticateByPassword-put-)<br> * POST : [MFA Email Login](#MFALoginByEmail-post-)<br> * POST : [MFA UserName Login](#MFALoginByUserName-post-)<br> * POST : [MFA Phone Login](#MFALoginByPhone-post-)<br> @@ -1918,7 +2029,6 @@ List of APIs in this Section:<br> * GET : [MFA Backup Code by Access Token](#MFABackupCodeByAccessToken-get-)<br> * GET : [Reset Backup Code by Access Token](#MFAResetBackupCodeByAccessToken-get-)<br> * GET : [MFA Resend Otp](#MFAResendOTP-get-)<br> -* GET : [Multi Factor Re-Authenticate](#MFAReAuthenticate-get-)<br> * GET : [MFA Backup Code by UID](#MFABackupCodeByUid-get-)<br> * GET : [MFA Reset Backup Code by UID](#MFAResetBackupCodeByUid-get-)<br> * DELETE : [MFA Reset Google Authenticator by Token](#MFAResetGoogleAuthByToken-delete-)<br> @@ -1940,7 +2050,7 @@ multi_factor_auth_model_with_lockout = { } #Required fields = "<fields>" #Optional -loginradius.mfa.mfa_update_setting(access_token, multi_factor_auth_model_with_lockout, fields) +result = loginradius.mfa.mfa_update_setting(access_token, multi_factor_auth_model_with_lockout, fields) ``` @@ -1958,7 +2068,7 @@ multi_factor_auth_model_by_google_authenticator_code = { fields = "<fields>" #Optional sms_template = "<sms_template>" #Optional -loginradius.mfa.mfa_update_by_access_token(access_token, multi_factor_auth_model_by_google_authenticator_code, fields, sms_template) +result = loginradius.mfa.mfa_update_by_access_token(access_token, multi_factor_auth_model_by_google_authenticator_code, fields, sms_template) ``` @@ -1973,7 +2083,7 @@ access_token = "<access_token>" #Required phone_no2_f_a = "<phone_no2_f_a>" #Required sms_template2_f_a = "<sms_template2_f_a>" #Optional -loginradius.mfa.mfa_update_phone_number_by_token(access_token, phone_no2_f_a, sms_template2_f_a) +result = loginradius.mfa.mfa_update_phone_number_by_token(access_token, phone_no2_f_a, sms_template2_f_a) ``` @@ -1991,7 +2101,7 @@ second_factor_authentication_token = "<second_factor_authentication_token>" #Req fields = "<fields>" #Optional sms_template2_f_a = "<sms_template2_f_a>" #Optional -loginradius.mfa.mfa_validate_otp_by_phone(multi_factor_auth_model_with_lockout, second_factor_authentication_token, fields, sms_template2_f_a) +result = loginradius.mfa.mfa_validate_otp_by_phone(multi_factor_auth_model_with_lockout, second_factor_authentication_token, fields, sms_template2_f_a) ``` @@ -2007,7 +2117,7 @@ second_factor_authentication_token = "<second_factor_authentication_token>" #Req fields = "<fields>" #Optional sms_template2_f_a = "<sms_template2_f_a>" #Optional -loginradius.mfa.mfa_validate_google_auth_code(google_authenticator_code, second_factor_authentication_token, fields, sms_template2_f_a) +result = loginradius.mfa.mfa_validate_google_auth_code(google_authenticator_code, second_factor_authentication_token, fields, sms_template2_f_a) ``` @@ -2024,7 +2134,7 @@ multi_factor_auth_model_by_backup_code = { second_factor_authentication_token = "<second_factor_authentication_token>" #Required fields = "<fields>" #Optional -loginradius.mfa.mfa_validate_backup_code(multi_factor_auth_model_by_backup_code, second_factor_authentication_token, fields) +result = loginradius.mfa.mfa_validate_backup_code(multi_factor_auth_model_by_backup_code, second_factor_authentication_token, fields) ``` @@ -2039,72 +2149,7 @@ phone_no2_f_a = "<phone_no2_f_a>" #Required second_factor_authentication_token = "<second_factor_authentication_token>" #Required sms_template2_f_a = "<sms_template2_f_a>" #Optional -loginradius.mfa.mfa_update_phone_number(phone_no2_f_a, second_factor_authentication_token, sms_template2_f_a) - ``` - - - - -<h6 id="MFAReAuthenticateByOTP-put-"> Validate MFA by OTP (PUT)</h6> - This API is used to re-authenticate via Multi-factor authentication by passing the One Time Password received via SMS [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-by-otp) - - ``` - -access_token = "<access_token>" #Required -reauth_by_otp_model = { -"otp" : "<otp>" -} #Required - -loginradius.mfa.mfa_re_authenticate_by_otp(access_token, reauth_by_otp_model) - ``` - - - - -<h6 id="MFAReAuthenticateByBackupCode-put-"> Validate MFA by Backup Code (PUT)</h6> - This API is used to re-authenticate by set of backup codes via access_token on the site that has Multi-factor authentication enabled in re-authentication for the user that does not have the device [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-by-backup-code) - - ``` - -access_token = "<access_token>" #Required -reauth_by_backup_code_model = { -"backupCode" : "<backupCode>" -} #Required - -loginradius.mfa.mfa_re_authenticate_by_backup_code(access_token, reauth_by_backup_code_model) - ``` - - - - -<h6 id="MFAReAuthenticateByGoogleAuth-put-"> Validate MFA by Google Authenticator Code (PUT)</h6> - This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-by-google-authenticator-code) - - ``` - -access_token = "<access_token>" #Required -reauth_by_google_authenticator_code_model = { -"googleAuthenticatorCode" : "<googleAuthenticatorCode>" -} #Required - -loginradius.mfa.mfa_re_authenticate_by_google_auth(access_token, reauth_by_google_authenticator_code_model) - ``` - - - - -<h6 id="MFAReAuthenticateByPassword-put-"> Validate MFA by Password (PUT)</h6> - This API is used to re-authenticate via Multi-factor-authentication by passing the password [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-by-password) - - ``` - -access_token = "<access_token>" #Required -password_event_based_auth_model_with_lockout = { -"password" : "<password>" -} #Required -sms_template2_f_a = "<sms_template2_f_a>" #Optional - -loginradius.mfa.mfa_re_authenticate_by_password(access_token, password_event_based_auth_model_with_lockout, sms_template2_f_a) +result = loginradius.mfa.mfa_update_phone_number(phone_no2_f_a, second_factor_authentication_token, sms_template2_f_a) ``` @@ -2124,7 +2169,7 @@ sms_template = "<sms_template>" #Optional sms_template2_f_a = "<sms_template2_f_a>" #Optional verification_url = "<verification_url>" #Optional -loginradius.mfa.mfa_login_by_email(email, password, email_template, fields, login_url, sms_template, sms_template2_f_a, verification_url) +result = loginradius.mfa.mfa_login_by_email(email, password, email_template, fields, login_url, sms_template, sms_template2_f_a, verification_url) ``` @@ -2144,7 +2189,7 @@ sms_template = "<sms_template>" #Optional sms_template2_f_a = "<sms_template2_f_a>" #Optional verification_url = "<verification_url>" #Optional -loginradius.mfa.mfa_login_by_user_name(password, username, email_template, fields, login_url, sms_template, sms_template2_f_a, verification_url) +result = loginradius.mfa.mfa_login_by_user_name(password, username, email_template, fields, login_url, sms_template, sms_template2_f_a, verification_url) ``` @@ -2164,7 +2209,7 @@ sms_template = "<sms_template>" #Optional sms_template2_f_a = "<sms_template2_f_a>" #Optional verification_url = "<verification_url>" #Optional -loginradius.mfa.mfa_login_by_phone(password, phone, email_template, fields, login_url, sms_template, sms_template2_f_a, verification_url) +result = loginradius.mfa.mfa_login_by_phone(password, phone, email_template, fields, login_url, sms_template, sms_template2_f_a, verification_url) ``` @@ -2178,7 +2223,7 @@ loginradius.mfa.mfa_login_by_phone(password, phone, email_template, fields, logi access_token = "<access_token>" #Required sms_template2_f_a = "<sms_template2_f_a>" #Optional -loginradius.mfa.mfa_configure_by_access_token(access_token, sms_template2_f_a) +result = loginradius.mfa.mfa_configure_by_access_token(access_token, sms_template2_f_a) ``` @@ -2191,7 +2236,7 @@ loginradius.mfa.mfa_configure_by_access_token(access_token, sms_template2_f_a) access_token = "<access_token>" #Required -loginradius.mfa.mfa_backup_code_by_access_token(access_token) +result = loginradius.mfa.mfa_backup_code_by_access_token(access_token) ``` @@ -2204,7 +2249,7 @@ loginradius.mfa.mfa_backup_code_by_access_token(access_token) access_token = "<access_token>" #Required -loginradius.mfa.mfa_reset_backup_code_by_access_token(access_token) +result = loginradius.mfa.mfa_reset_backup_code_by_access_token(access_token) ``` @@ -2218,21 +2263,7 @@ loginradius.mfa.mfa_reset_backup_code_by_access_token(access_token) second_factor_authentication_token = "<second_factor_authentication_token>" #Required sms_template2_f_a = "<sms_template2_f_a>" #Optional -loginradius.mfa.mfa_resend_otp(second_factor_authentication_token, sms_template2_f_a) - ``` - - - - -<h6 id="MFAReAuthenticate-get-"> Multi Factor Re-Authenticate (GET)</h6> - This API is used to trigger the Multi-Factor Autentication workflow for the provided access_token [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-trigger/) - - ``` - -access_token = "<access_token>" #Required -sms_template2_f_a = "<sms_template2_f_a>" #Optional - -loginradius.mfa.mfa_re_authenticate(access_token, sms_template2_f_a) +result = loginradius.mfa.mfa_resend_otp(second_factor_authentication_token, sms_template2_f_a) ``` @@ -2245,7 +2276,7 @@ loginradius.mfa.mfa_re_authenticate(access_token, sms_template2_f_a) uid = "<uid>" #Required -loginradius.mfa.mfa_backup_code_by_uid(uid) +result = loginradius.mfa.mfa_backup_code_by_uid(uid) ``` @@ -2258,7 +2289,7 @@ loginradius.mfa.mfa_backup_code_by_uid(uid) uid = "<uid>" #Required -loginradius.mfa.mfa_reset_backup_code_by_uid(uid) +result = loginradius.mfa.mfa_reset_backup_code_by_uid(uid) ``` @@ -2270,9 +2301,9 @@ loginradius.mfa.mfa_reset_backup_code_by_uid(uid) ``` access_token = "<access_token>" #Required -googleauthenticator = True #Required +googleauthenticator = "True" #Required -loginradius.mfa.mfa_reset_google_auth_by_token(access_token, googleauthenticator) +result = loginradius.mfa.mfa_reset_google_auth_by_token(access_token, googleauthenticator) ``` @@ -2284,9 +2315,9 @@ loginradius.mfa.mfa_reset_google_auth_by_token(access_token, googleauthenticator ``` access_token = "<access_token>" #Required -otpauthenticator = True #Required +otpauthenticator = "True" #Required -loginradius.mfa.mfa_reset_sms_auth_by_token(access_token, otpauthenticator) +result = loginradius.mfa.mfa_reset_sms_auth_by_token(access_token, otpauthenticator) ``` @@ -2297,10 +2328,10 @@ loginradius.mfa.mfa_reset_sms_auth_by_token(access_token, otpauthenticator) ``` -otpauthenticator = True #Required +otpauthenticator = "True" #Required uid = "<uid>" #Required -loginradius.mfa.mfa_reset_sms_authenticator_by_uid(otpauthenticator, uid) +result = loginradius.mfa.mfa_reset_sms_authenticator_by_uid(otpauthenticator, uid) ``` @@ -2311,10 +2342,10 @@ loginradius.mfa.mfa_reset_sms_authenticator_by_uid(otpauthenticator, uid) ``` -googleauthenticator = True #Required +googleauthenticator = "True" #Required uid = "<uid>" #Required -loginradius.mfa.mfa_reset_google_authenticator_by_uid(googleauthenticator, uid) +result = loginradius.mfa.mfa_reset_google_authenticator_by_uid(googleauthenticator, uid) ``` @@ -2322,35 +2353,577 @@ loginradius.mfa.mfa_reset_google_authenticator_by_uid(googleauthenticator, uid) -### Smart Login API +### PINAuthentication API List of APIs in this Section:<br> -* GET : [Smart Login Verify Token](#SmartLoginTokenVerification-get-)<br> -* GET : [Smart Login By Email](#SmartLoginByEmail-get-)<br> -* GET : [Smart Login By Username](#SmartLoginByUserName-get-)<br> -* GET : [Smart Login Ping](#SmartLoginPing-get-)<br> +* PUT : [Reset PIN By ResetToken](#ResetPINByResetToken-put-)<br> +* PUT : [Reset PIN By SecurityAnswer And Email](#ResetPINByEmailAndSecurityAnswer-put-)<br> +* PUT : [Reset PIN By SecurityAnswer And Username](#ResetPINByUsernameAndSecurityAnswer-put-)<br> +* PUT : [Reset PIN By SecurityAnswer And Phone](#ResetPINByPhoneAndSecurityAnswer-put-)<br> +* PUT : [Change PIN By Token](#ChangePINByAccessToken-put-)<br> +* PUT : [Reset PIN by Phone and OTP](#ResetPINByPhoneAndOtp-put-)<br> +* PUT : [Reset PIN by Email and OTP](#ResetPINByEmailAndOtp-put-)<br> +* PUT : [Reset PIN by Username and OTP](#ResetPINByUsernameAndOtp-put-)<br> +* POST : [PIN Login](#PINLogin-post-)<br> +* POST : [Forgot PIN By Email](#SendForgotPINEmailByEmail-post-)<br> +* POST : [Forgot PIN By UserName](#SendForgotPINEmailByUsername-post-)<br> +* POST : [Forgot PIN By Phone](#SendForgotPINSMSByPhone-post-)<br> +* POST : [Set PIN By PinAuthToken](#SetPINByPinAuthToken-post-)<br> +* GET : [Invalidate PIN Session Token](#InValidatePinSessionToken-get-)<br> -<h6 id="SmartLoginTokenVerification-get-"> Smart Login Verify Token (GET)</h6> - This API verifies the provided token for Smart Login [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-verify-token/) +<h6 id="ResetPINByResetToken-put-"> Reset PIN By ResetToken (PUT)</h6> + This API is used to reset pin using reset token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-resettoken/) ``` - -verification_token = "<verification_token>" #Required -welcome_email_template = "<welcome_email_template>" #Optional + +reset_pin_by_reset_token = { +"pin" : "<pin>", +"resetToken" : "<resetToken>" +} #Required -loginradius.smart_login.smart_login_token_verification(verification_token, welcome_email_template) +result = loginradius.pin_authentication.reset_pin_by_reset_token(reset_pin_by_reset_token) ``` -<h6 id="SmartLoginByEmail-get-"> Smart Login By Email (GET)</h6> - This API sends a Smart Login link to the user's Email Id. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-by-email) +<h6 id="ResetPINByEmailAndSecurityAnswer-put-"> Reset PIN By SecurityAnswer And Email (PUT)</h6> + This API is used to reset pin using security question answer and email. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-securityanswer-and-email/) + + ``` + +reset_pin_by_security_question_answer_and_email_model = { +"email" : "<email>", +"pin" : "<pin>", +"securityAnswer" : {"QuestionID":"Answer"} +} #Required + +result = loginradius.pin_authentication.reset_pin_by_email_and_security_answer(reset_pin_by_security_question_answer_and_email_model) + ``` + + + + +<h6 id="ResetPINByUsernameAndSecurityAnswer-put-"> Reset PIN By SecurityAnswer And Username (PUT)</h6> + This API is used to reset pin using security question answer and username. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-securityanswer-and-username/) + + ``` + +reset_pin_by_security_question_answer_and_username_model = { +"pin" : "<pin>", +"securityAnswer" : {"QuestionID":"Answer"}, +"username" : "<username>" +} #Required + +result = loginradius.pin_authentication.reset_pin_by_username_and_security_answer(reset_pin_by_security_question_answer_and_username_model) + ``` + + + + +<h6 id="ResetPINByPhoneAndSecurityAnswer-put-"> Reset PIN By SecurityAnswer And Phone (PUT)</h6> + This API is used to reset pin using security question answer and phone. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-securityanswer-and-phone/) + + ``` + +reset_pin_by_security_question_answer_and_phone_model = { +"phone" : "<phone>", +"pin" : "<pin>", +"securityAnswer" : {"QuestionID":"Answer"} +} #Required + +result = loginradius.pin_authentication.reset_pin_by_phone_and_security_answer(reset_pin_by_security_question_answer_and_phone_model) + ``` + + + + +<h6 id="ChangePINByAccessToken-put-"> Change PIN By Token (PUT)</h6> + This API is used to change a user's PIN using access token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/change-pin-by-access-token/) + + ``` + +access_token = "<access_token>" #Required +change_pin_model = { +"newPIN" : "<newPIN>", +"oldPIN" : "<oldPIN>" +} #Required + +result = loginradius.pin_authentication.change_pin_by_access_token(access_token, change_pin_model) + ``` + + + + +<h6 id="ResetPINByPhoneAndOtp-put-"> Reset PIN by Phone and OTP (PUT)</h6> + This API is used to reset pin using phoneId and OTP. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-phone-and-otp/) + + ``` + +reset_pin_by_phone_and_otp_model = { +"otp" : "<otp>", +"phone" : "<phone>", +"pin" : "<pin>" +} #Required + +result = loginradius.pin_authentication.reset_pin_by_phone_and_otp(reset_pin_by_phone_and_otp_model) + ``` + + + + +<h6 id="ResetPINByEmailAndOtp-put-"> Reset PIN by Email and OTP (PUT)</h6> + This API is used to reset pin using email and OTP. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-email-and-otp/) + + ``` + +reset_pin_by_email_and_otp_model = { +"email" : "<email>", +"otp" : "<otp>", +"pin" : "<pin>" +} #Required + +result = loginradius.pin_authentication.reset_pin_by_email_and_otp(reset_pin_by_email_and_otp_model) + ``` + + + + +<h6 id="ResetPINByUsernameAndOtp-put-"> Reset PIN by Username and OTP (PUT)</h6> + This API is used to reset pin using username and OTP. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-username-and-otp/) + + ``` + +reset_pin_by_username_and_otp_model = { +"otp" : "<otp>", +"pin" : "<pin>", +"username" : "<username>" +} #Required + +result = loginradius.pin_authentication.reset_pin_by_username_and_otp(reset_pin_by_username_and_otp_model) + ``` + + + + +<h6 id="PINLogin-post-"> PIN Login (POST)</h6> + This API is used to login a user by pin and session_token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/login-by-pin/) + + ``` + +login_by_pin_model = { +"pin" : "<pin>" +} #Required +session_token = "<session_token>" #Required + +result = loginradius.pin_authentication.pin_login(login_by_pin_model, session_token) + ``` + + + + +<h6 id="SendForgotPINEmailByEmail-post-"> Forgot PIN By Email (POST)</h6> + This API sends the reset pin email to specified email address. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/forgot-pin-by-email/) + + ``` + +forgot_pin_link_by_email_model = { +"email" : "<email>" +} #Required +email_template = "<email_template>" #Optional +reset_pin_url = "<reset_pin_url>" #Optional + +result = loginradius.pin_authentication.send_forgot_pin_email_by_email(forgot_pin_link_by_email_model, email_template, reset_pin_url) + ``` + + + + +<h6 id="SendForgotPINEmailByUsername-post-"> Forgot PIN By UserName (POST)</h6> + This API sends the reset pin email using username. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/forgot-pin-by-username/) + + ``` + +forgot_pin_link_by_user_name_model = { +"userName" : "<userName>" +} #Required +email_template = "<email_template>" #Optional +reset_pin_url = "<reset_pin_url>" #Optional + +result = loginradius.pin_authentication.send_forgot_pin_email_by_username(forgot_pin_link_by_user_name_model, email_template, reset_pin_url) + ``` + + + + +<h6 id="SendForgotPINSMSByPhone-post-"> Forgot PIN By Phone (POST)</h6> + This API sends the OTP to specified phone number [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/forgot-pin-by-phone/) + + ``` + +forgot_pin_otp_by_phone_model = { +"phone" : "<phone>" +} #Required +sms_template = "<sms_template>" #Optional + +result = loginradius.pin_authentication.send_forgot_pin_sms_by_phone(forgot_pin_otp_by_phone_model, sms_template) + ``` + + + + +<h6 id="SetPINByPinAuthToken-post-"> Set PIN By PinAuthToken (POST)</h6> + This API is used to change a user's PIN using Pin Auth token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/set-pin-by-pinauthtoken/) + + ``` + +pin_required_model = { +"pin" : "<pin>" +} #Required +pin_auth_token = "<pin_auth_token>" #Required + +result = loginradius.pin_authentication.set_pin_by_pin_auth_token(pin_required_model, pin_auth_token) + ``` + + + + +<h6 id="InValidatePinSessionToken-get-"> Invalidate PIN Session Token (GET)</h6> + This API is used to invalidate pin session token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/invalidate-pin-session-token/) + + ``` + +session_token = "<session_token>" #Required + +result = loginradius.pin_authentication.in_validate_pin_session_token(session_token) + ``` + + + + + + +### ReAuthentication API + + +List of APIs in this Section:<br> + +* PUT : [Validate MFA by OTP](#MFAReAuthenticateByOTP-put-)<br> +* PUT : [Validate MFA by Backup Code](#MFAReAuthenticateByBackupCode-put-)<br> +* PUT : [Validate MFA by Google Authenticator Code](#MFAReAuthenticateByGoogleAuth-put-)<br> +* PUT : [Validate MFA by Password](#MFAReAuthenticateByPassword-put-)<br> +* PUT : [MFA Re-authentication by PIN](#VerifyPINAuthentication-put-)<br> +* POST : [Verify Multifactor OTP Authentication](#VerifyMultiFactorOtpReauthentication-post-)<br> +* POST : [Verify Multifactor Password Authentication](#VerifyMultiFactorPasswordReauthentication-post-)<br> +* POST : [Verify Multifactor PIN Authentication](#VerifyMultiFactorPINReauthentication-post-)<br> +* GET : [Multi Factor Re-Authenticate](#MFAReAuthenticate-get-)<br> + + + + +<h6 id="MFAReAuthenticateByOTP-put-"> Validate MFA by OTP (PUT)</h6> + This API is used to re-authenticate via Multi-factor authentication by passing the One Time Password received via SMS [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/mfa/re-auth-by-otp/) + + ``` + +access_token = "<access_token>" #Required +reauth_by_otp_model = { +"otp" : "<otp>" +} #Required + +result = loginradius.re_authentication.mfa_re_authenticate_by_otp(access_token, reauth_by_otp_model) + ``` + + + + +<h6 id="MFAReAuthenticateByBackupCode-put-"> Validate MFA by Backup Code (PUT)</h6> + This API is used to re-authenticate by set of backup codes via access_token on the site that has Multi-factor authentication enabled in re-authentication for the user that does not have the device [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/mfa/re-auth-by-backup-code/) + + ``` + +access_token = "<access_token>" #Required +reauth_by_backup_code_model = { +"backupCode" : "<backupCode>" +} #Required + +result = loginradius.re_authentication.mfa_re_authenticate_by_backup_code(access_token, reauth_by_backup_code_model) + ``` + + + + +<h6 id="MFAReAuthenticateByGoogleAuth-put-"> Validate MFA by Google Authenticator Code (PUT)</h6> + This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-by-google-authenticator-code) + + ``` + +access_token = "<access_token>" #Required +reauth_by_google_authenticator_code_model = { +"googleAuthenticatorCode" : "<googleAuthenticatorCode>" +} #Required + +result = loginradius.re_authentication.mfa_re_authenticate_by_google_auth(access_token, reauth_by_google_authenticator_code_model) + ``` + + + + +<h6 id="MFAReAuthenticateByPassword-put-"> Validate MFA by Password (PUT)</h6> + This API is used to re-authenticate via Multi-factor-authentication by passing the password [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-by-password) + + ``` + +access_token = "<access_token>" #Required +password_event_based_auth_model_with_lockout = { +"password" : "<password>" +} #Required +sms_template2_f_a = "<sms_template2_f_a>" #Optional + +result = loginradius.re_authentication.mfa_re_authenticate_by_password(access_token, password_event_based_auth_model_with_lockout, sms_template2_f_a) + ``` + + + + +<h6 id="VerifyPINAuthentication-put-"> MFA Re-authentication by PIN (PUT)</h6> + This API is used to validate the triggered MFA authentication flow with a password. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/pin/re-auth-by-pin/) + + ``` + +access_token = "<access_token>" #Required +pin_auth_event_based_auth_model_with_lockout = { +"pin" : "<pin>" +} #Required +sms_template2_f_a = "<sms_template2_f_a>" #Optional + +result = loginradius.re_authentication.verify_pin_authentication(access_token, pin_auth_event_based_auth_model_with_lockout, sms_template2_f_a) + ``` + + + + +<h6 id="VerifyMultiFactorOtpReauthentication-post-"> Verify Multifactor OTP Authentication (POST)</h6> + This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by OTP. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/mfa/re-auth-validate-mfa/) + + ``` + +event_based_multi_factor_token = { +"secondFactorValidationToken" : "<secondFactorValidationToken>" +} #Required +uid = "<uid>" #Required + +result = loginradius.re_authentication.verify_multi_factor_otp_reauthentication(event_based_multi_factor_token, uid) + ``` + + + + +<h6 id="VerifyMultiFactorPasswordReauthentication-post-"> Verify Multifactor Password Authentication (POST)</h6> + This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by password. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/re-auth-validate-password/) + + ``` + +event_based_multi_factor_token = { +"secondFactorValidationToken" : "<secondFactorValidationToken>" +} #Required +uid = "<uid>" #Required + +result = loginradius.re_authentication.verify_multi_factor_password_reauthentication(event_based_multi_factor_token, uid) + ``` + + + + +<h6 id="VerifyMultiFactorPINReauthentication-post-"> Verify Multifactor PIN Authentication (POST)</h6> + This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by PIN. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/pin/re-auth-validate-pin/) + + ``` + +event_based_multi_factor_token = { +"secondFactorValidationToken" : "<secondFactorValidationToken>" +} #Required +uid = "<uid>" #Required + +result = loginradius.re_authentication.verify_multi_factor_pin_reauthentication(event_based_multi_factor_token, uid) + ``` + + + + +<h6 id="MFAReAuthenticate-get-"> Multi Factor Re-Authenticate (GET)</h6> + This API is used to trigger the Multi-Factor Autentication workflow for the provided access_token [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-trigger/) + + ``` + +access_token = "<access_token>" #Required +sms_template2_f_a = "<sms_template2_f_a>" #Optional + +result = loginradius.re_authentication.mfa_re_authenticate(access_token, sms_template2_f_a) + ``` + + + + + + +### ConsentManagement API + + +List of APIs in this Section:<br> + +* PUT : [Update Consent By Access Token](#UpdateConsentProfileByAccessToken-put-)<br> +* POST : [Consent By ConsentToken](#SubmitConsentByConsentToken-post-)<br> +* POST : [Post Consent By Access Token](#SubmitConsentByAccessToken-post-)<br> +* GET : [Get Consent Logs By Uid](#GetConsentLogsByUid-get-)<br> +* GET : [Get Consent Log by Access Token](#GetConsentLogs-get-)<br> +* GET : [Get Verify Consent By Access Token](#VerifyConsentByAccessToken-get-)<br> + + + + +<h6 id="UpdateConsentProfileByAccessToken-put-"> Update Consent By Access Token (PUT)</h6> + This API is to update consents using access token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/update-consent-by-access-token/) + + ``` + +access_token = "<access_token>" #Required +consent_update_model = { +"consents" : [ { + "consentOptionId" : "<consentOptionId>" , +"isAccepted" : "True" +} ] +} #Required + +result = loginradius.consent_management.update_consent_profile_by_access_token(access_token, consent_update_model) + ``` + + + + +<h6 id="SubmitConsentByConsentToken-post-"> Consent By ConsentToken (POST)</h6> + This API is to submit consent form using consent token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/consent-by-consent-token/) + + ``` + +consent_token = "<consent_token>" #Required +consent_submit_model = { +"data" : [ { + "consentOptionId" : "<consentOptionId>" , +"isAccepted" : "True" +} ] , +"events" : [ { + "event" : "<event>" , +"isCustom" : "True" +} ] +} #Required + +result = loginradius.consent_management.submit_consent_by_consent_token(consent_token, consent_submit_model) + ``` + + + + +<h6 id="SubmitConsentByAccessToken-post-"> Post Consent By Access Token (POST)</h6> + API to provide a way to end user to submit a consent form for particular event type. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/consent-by-access-token/) + + ``` + +access_token = "<access_token>" #Required +consent_submit_model = { +"data" : [ { + "consentOptionId" : "<consentOptionId>" , +"isAccepted" : "True" +} ] , +"events" : [ { + "event" : "<event>" , +"isCustom" : "True" +} ] +} #Required + +result = loginradius.consent_management.submit_consent_by_access_token(access_token, consent_submit_model) + ``` + + + + +<h6 id="GetConsentLogsByUid-get-"> Get Consent Logs By Uid (GET)</h6> + This API is used to get the Consent logs of the user. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/consent-log-by-uid/) + + ``` + +uid = "<uid>" #Required + +result = loginradius.consent_management.get_consent_logs_by_uid(uid) + ``` + + + + +<h6 id="GetConsentLogs-get-"> Get Consent Log by Access Token (GET)</h6> + This API is used to fetch consent logs. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/consent-log-by-access-token/) + + ``` + +access_token = "<access_token>" #Required + +result = loginradius.consent_management.get_consent_logs(access_token) + ``` + + + + +<h6 id="VerifyConsentByAccessToken-get-"> Get Verify Consent By Access Token (GET)</h6> + This API is used to check if consent is submitted for a particular event or not. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/verify-consent-by-access-token/) + + ``` + +access_token = "<access_token>" #Required +event = "<event>" #Required +is_custom = "True" #Required + +result = loginradius.consent_management.verify_consent_by_access_token(access_token, event, is_custom) + ``` + + + + + + +### SmartLogin API + + +List of APIs in this Section:<br> + +* GET : [Smart Login Verify Token](#SmartLoginTokenVerification-get-)<br> +* GET : [Smart Login By Email](#SmartLoginByEmail-get-)<br> +* GET : [Smart Login By Username](#SmartLoginByUserName-get-)<br> +* GET : [Smart Login Ping](#SmartLoginPing-get-)<br> + + + + +<h6 id="SmartLoginTokenVerification-get-"> Smart Login Verify Token (GET)</h6> + This API verifies the provided token for Smart Login [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-verify-token/) + + ``` + +verification_token = "<verification_token>" #Required +welcome_email_template = "<welcome_email_template>" #Optional + +result = loginradius.smart_login.smart_login_token_verification(verification_token, welcome_email_template) + ``` + + + + +<h6 id="SmartLoginByEmail-get-"> Smart Login By Email (GET)</h6> + This API sends a Smart Login link to the user's Email Id. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-by-email) ``` @@ -2360,7 +2933,7 @@ redirect_url = "<redirect_url>" #Optional smart_login_email_template = "<smart_login_email_template>" #Optional welcome_email_template = "<welcome_email_template>" #Optional -loginradius.smart_login.smart_login_by_email(client_guid, email, redirect_url, smart_login_email_template, welcome_email_template) +result = loginradius.smart_login.smart_login_by_email(client_guid, email, redirect_url, smart_login_email_template, welcome_email_template) ``` @@ -2377,7 +2950,7 @@ redirect_url = "<redirect_url>" #Optional smart_login_email_template = "<smart_login_email_template>" #Optional welcome_email_template = "<welcome_email_template>" #Optional -loginradius.smart_login.smart_login_by_user_name(client_guid, username, redirect_url, smart_login_email_template, welcome_email_template) +result = loginradius.smart_login.smart_login_by_user_name(client_guid, username, redirect_url, smart_login_email_template, welcome_email_template) ``` @@ -2391,7 +2964,7 @@ loginradius.smart_login.smart_login_by_user_name(client_guid, username, redirect client_guid = "<client_guid>" #Required fields = "<fields>" #Optional -loginradius.smart_login.smart_login_ping(client_guid, fields) +result = loginradius.smart_login.smart_login_ping(client_guid, fields) ``` @@ -2399,7 +2972,7 @@ loginradius.smart_login.smart_login_ping(client_guid, fields) -### One Touch Login API +### OneTouchLogin API List of APIs in this Section:<br> @@ -2423,7 +2996,7 @@ phone = "<phone>" #Required fields = "<fields>" #Optional sms_template = "<sms_template>" #Optional -loginradius.one_touch_login.one_touch_login_otp_verification(otp, phone, fields, sms_template) +result = loginradius.one_touch_login.one_touch_login_otp_verification(otp, phone, fields, sms_template) ``` @@ -2443,7 +3016,7 @@ one_touch_login_email_template = "<one_touch_login_email_template>" #Optional redirecturl = "<redirecturl>" #Optional welcomeemailtemplate = "<welcomeemailtemplate>" #Optional -loginradius.one_touch_login.one_touch_login_by_email(one_touch_login_by_email_model, one_touch_login_email_template, redirecturl, welcomeemailtemplate) +result = loginradius.one_touch_login.one_touch_login_by_email(one_touch_login_by_email_model, one_touch_login_email_template, redirecturl, welcomeemailtemplate) ``` @@ -2460,7 +3033,7 @@ one_touch_login_by_phone_model = { } #Required sms_template = "<sms_template>" #Optional -loginradius.one_touch_login.one_touch_login_by_phone(one_touch_login_by_phone_model, sms_template) +result = loginradius.one_touch_login.one_touch_login_by_phone(one_touch_login_by_phone_model, sms_template) ``` @@ -2474,7 +3047,7 @@ loginradius.one_touch_login.one_touch_login_by_phone(one_touch_login_by_phone_mo verification_token = "<verification_token>" #Required welcome_email_template = "<welcome_email_template>" #Optional -loginradius.one_touch_login.one_touch_email_verification(verification_token, welcome_email_template) +result = loginradius.one_touch_login.one_touch_email_verification(verification_token, welcome_email_template) ``` @@ -2488,7 +3061,7 @@ loginradius.one_touch_login.one_touch_email_verification(verification_token, wel client_guid = "<client_guid>" #Required fields = "<fields>" #Optional -loginradius.one_touch_login.one_touch_login_ping(client_guid, fields) +result = loginradius.one_touch_login.one_touch_login_ping(client_guid, fields) ``` @@ -2496,7 +3069,7 @@ loginradius.one_touch_login.one_touch_login_ping(client_guid, fields) -### Password Less Login API +### PasswordLessLogin API List of APIs in this Section:<br> @@ -2522,7 +3095,7 @@ password_less_login_otp_model = { fields = "<fields>" #Optional sms_template = "<sms_template>" #Optional -loginradius.password_less_login.passwordless_login_phone_verification(password_less_login_otp_model, fields, sms_template) +result = loginradius.password_less_login.passwordless_login_phone_verification(password_less_login_otp_model, fields, sms_template) ``` @@ -2536,7 +3109,7 @@ loginradius.password_less_login.passwordless_login_phone_verification(password_l phone = "<phone>" #Required sms_template = "<sms_template>" #Optional -loginradius.password_less_login.passwordless_login_by_phone(phone, sms_template) +result = loginradius.password_less_login.passwordless_login_by_phone(phone, sms_template) ``` @@ -2551,7 +3124,7 @@ email = "<email>" #Required password_less_login_template = "<password_less_login_template>" #Optional verification_url = "<verification_url>" #Optional -loginradius.password_less_login.passwordless_login_by_email(email, password_less_login_template, verification_url) +result = loginradius.password_less_login.passwordless_login_by_email(email, password_less_login_template, verification_url) ``` @@ -2566,7 +3139,7 @@ username = "<username>" #Required password_less_login_template = "<password_less_login_template>" #Optional verification_url = "<verification_url>" #Optional -loginradius.password_less_login.passwordless_login_by_user_name(username, password_less_login_template, verification_url) +result = loginradius.password_less_login.passwordless_login_by_user_name(username, password_less_login_template, verification_url) ``` @@ -2581,7 +3154,7 @@ verification_token = "<verification_token>" #Required fields = "<fields>" #Optional welcome_email_template = "<welcome_email_template>" #Optional -loginradius.password_less_login.passwordless_login_verification(verification_token, fields, welcome_email_template) +result = loginradius.password_less_login.passwordless_login_verification(verification_token, fields, welcome_email_template) ``` @@ -2589,7 +3162,7 @@ loginradius.password_less_login.passwordless_login_verification(verification_tok -### Configuration API +### Configuration API List of APIs in this Section:<br> @@ -2606,18 +3179,18 @@ List of APIs in this Section:<br> time_difference = 0 #Optional -loginradius.configuration.get_server_info(time_difference) +result = loginradius.configuration.get_server_info(time_difference) ``` <h6 id="GetConfigurations-get-"> Get Configuration (GET)</h6> This API is used to get the configurations which are set in the LoginRadius Admin Console for a particular LoginRadius site/environment. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/configuration/get-configurations) ``` -loginradius.configuration.get_configurations() +result = loginradius.configuration.get_configurations() ``` -### Role API +### Role API List of APIs in this Section:<br> @@ -2650,7 +3223,7 @@ account_roles_model = { } #Required uid = "<uid>" #Required -loginradius.role.assign_roles_by_uid(account_roles_model, uid) +result = loginradius.role.assign_roles_by_uid(account_roles_model, uid) ``` @@ -2671,7 +3244,7 @@ account_role_context_model = { } #Required uid = "<uid>" #Required -loginradius.role.update_role_context_by_uid(account_role_context_model, uid) +result = loginradius.role.update_role_context_by_uid(account_role_context_model, uid) ``` @@ -2687,7 +3260,7 @@ permissions_model = { } #Required role = "<role>" #Required -loginradius.role.add_role_permissions(permissions_model, role) +result = loginradius.role.add_role_permissions(permissions_model, role) ``` @@ -2701,11 +3274,11 @@ loginradius.role.add_role_permissions(permissions_model, role) roles_model = { "roles" : [ { "name" : "<name>" , -"permissions" : {"Permission_name":true} +"permissions" : {"Permission_name" : "True"} } ] } #Required -loginradius.role.create_roles(roles_model) +result = loginradius.role.create_roles(roles_model) ``` @@ -2718,7 +3291,7 @@ loginradius.role.create_roles(roles_model) uid = "<uid>" #Required -loginradius.role.get_roles_by_uid(uid) +result = loginradius.role.get_roles_by_uid(uid) ``` @@ -2731,7 +3304,7 @@ loginradius.role.get_roles_by_uid(uid) uid = "<uid>" #Required -loginradius.role.get_role_context_by_uid(uid) +result = loginradius.role.get_role_context_by_uid(uid) ``` @@ -2744,7 +3317,7 @@ loginradius.role.get_role_context_by_uid(uid) context_name = "<context_name>" #Required -loginradius.role.get_role_context_by_context_name(context_name) +result = loginradius.role.get_role_context_by_context_name(context_name) ``` @@ -2756,7 +3329,7 @@ loginradius.role.get_role_context_by_context_name(context_name) ``` -loginradius.role.get_roles_list() +result = loginradius.role.get_roles_list() ``` @@ -2772,7 +3345,7 @@ account_roles_model = { } #Required uid = "<uid>" #Required -loginradius.role.unassign_roles_by_uid(account_roles_model, uid) +result = loginradius.role.unassign_roles_by_uid(account_roles_model, uid) ``` @@ -2786,7 +3359,7 @@ loginradius.role.unassign_roles_by_uid(account_roles_model, uid) context_name = "<context_name>" #Required uid = "<uid>" #Required -loginradius.role.delete_role_context_by_uid(context_name, uid) +result = loginradius.role.delete_role_context_by_uid(context_name, uid) ``` @@ -2803,7 +3376,7 @@ role_context_remove_role_model = { } #Required uid = "<uid>" #Required -loginradius.role.delete_roles_from_role_context_by_uid(context_name, role_context_remove_role_model, uid) +result = loginradius.role.delete_roles_from_role_context_by_uid(context_name, role_context_remove_role_model, uid) ``` @@ -2820,7 +3393,7 @@ role_context_additional_permission_remove_role_model = { } #Required uid = "<uid>" #Required -loginradius.role.delete_additional_permission_from_role_context_by_uid(context_name, role_context_additional_permission_remove_role_model, uid) +result = loginradius.role.delete_additional_permission_from_role_context_by_uid(context_name, role_context_additional_permission_remove_role_model, uid) ``` @@ -2833,7 +3406,7 @@ loginradius.role.delete_additional_permission_from_role_context_by_uid(context_n role = "<role>" #Required -loginradius.role.delete_role(role) +result = loginradius.role.delete_role(role) ``` @@ -2849,7 +3422,7 @@ permissions_model = { } #Required role = "<role>" #Required -loginradius.role.remove_role_permissions(permissions_model, role) +result = loginradius.role.remove_role_permissions(permissions_model, role) ``` @@ -2857,7 +3430,7 @@ loginradius.role.remove_role_permissions(permissions_model, role) -### Custom Registration Data API +### CustomRegistrationData API List of APIs in this Section:<br> @@ -2879,14 +3452,14 @@ List of APIs in this Section:<br> ``` registration_data_update_model = { -"isActive" : true, +"isActive" : "True", "key" : "<key>", "type" : "<type>", "value" : "<value>" } #Required record_id = "<record_id>" #Required -loginradius.custom_registration_data.update_registration_data(registration_data_update_model, record_id) +result = loginradius.custom_registration_data.update_registration_data(registration_data_update_model, record_id) ``` @@ -2900,7 +3473,7 @@ loginradius.custom_registration_data.update_registration_data(registration_data_ code = "<code>" #Required record_id = "<record_id>" #Required -loginradius.custom_registration_data.validate_registration_data_code(code, record_id) +result = loginradius.custom_registration_data.validate_registration_data_code(code, record_id) ``` @@ -2914,7 +3487,7 @@ loginradius.custom_registration_data.validate_registration_data_code(code, recor registration_data_create_model_list = { "data" : [ { "code" : "<code>" , -"isActive" : true , +"isActive" : "True" , "key" : "<key>" , "parentId" : "<parentId>" , "type" : "<type>" , @@ -2922,7 +3495,7 @@ registration_data_create_model_list = { } ] } #Required -loginradius.custom_registration_data.add_registration_data(registration_data_create_model_list) +result = loginradius.custom_registration_data.add_registration_data(registration_data_create_model_list) ``` @@ -2938,7 +3511,7 @@ limit = 0 #Optional parent_id = "<parent_id>" #Optional skip = 0 #Optional -loginradius.custom_registration_data.auth_get_registration_data(type, limit, parent_id, skip) +result = loginradius.custom_registration_data.auth_get_registration_data(type, limit, parent_id, skip) ``` @@ -2954,7 +3527,7 @@ limit = 0 #Optional parent_id = "<parent_id>" #Optional skip = 0 #Optional -loginradius.custom_registration_data.get_registration_data(type, limit, parent_id, skip) +result = loginradius.custom_registration_data.get_registration_data(type, limit, parent_id, skip) ``` @@ -2967,7 +3540,7 @@ loginradius.custom_registration_data.get_registration_data(type, limit, parent_i record_id = "<record_id>" #Required -loginradius.custom_registration_data.delete_registration_data(record_id) +result = loginradius.custom_registration_data.delete_registration_data(record_id) ``` @@ -2980,7 +3553,7 @@ loginradius.custom_registration_data.delete_registration_data(record_id) type = "<type>" #Required -loginradius.custom_registration_data.delete_all_records_by_data_source(type) +result = loginradius.custom_registration_data.delete_all_records_by_data_source(type) ``` @@ -2988,7 +3561,7 @@ loginradius.custom_registration_data.delete_all_records_by_data_source(type) -### Risk Based Authentication API +### RiskBasedAuthentication API List of APIs in this Section:<br> @@ -3012,7 +3585,7 @@ email_authentication_model = { email_template = "<email_template>" #Optional fields = "<fields>" #Optional login_url = "<login_url>" #Optional -password_delegation = True #Optional +password_delegation = "True" #Optional password_delegation_app = "<password_delegation_app>" #Optional rba_browser_email_template = "<rba_browser_email_template>" #Optional rba_browser_sms_template = "<rba_browser_sms_template>" #Optional @@ -3027,7 +3600,7 @@ rba_otp_sms_template = "<rba_otp_sms_template>" #Optional sms_template = "<sms_template>" #Optional verification_url = "<verification_url>" #Optional -loginradius.risk_based_authentication.rba_login_by_email(email_authentication_model, email_template, fields, login_url, password_delegation, password_delegation_app, rba_browser_email_template, rba_browser_sms_template, rba_city_email_template, rba_city_sms_template, rba_country_email_template, rba_country_sms_template, rba_ip_email_template, rba_ip_sms_template, rba_oneclick_email_template, rba_otp_sms_template, sms_template, verification_url) +result = loginradius.risk_based_authentication.rba_login_by_email(email_authentication_model, email_template, fields, login_url, password_delegation, password_delegation_app, rba_browser_email_template, rba_browser_sms_template, rba_city_email_template, rba_city_sms_template, rba_country_email_template, rba_country_sms_template, rba_ip_email_template, rba_ip_sms_template, rba_oneclick_email_template, rba_otp_sms_template, sms_template, verification_url) ``` @@ -3045,7 +3618,7 @@ user_name_authentication_model = { email_template = "<email_template>" #Optional fields = "<fields>" #Optional login_url = "<login_url>" #Optional -password_delegation = True #Optional +password_delegation = "True" #Optional password_delegation_app = "<password_delegation_app>" #Optional rba_browser_email_template = "<rba_browser_email_template>" #Optional rba_browser_sms_template = "<rba_browser_sms_template>" #Optional @@ -3060,7 +3633,7 @@ rba_otp_sms_template = "<rba_otp_sms_template>" #Optional sms_template = "<sms_template>" #Optional verification_url = "<verification_url>" #Optional -loginradius.risk_based_authentication.rba_login_by_user_name(user_name_authentication_model, email_template, fields, login_url, password_delegation, password_delegation_app, rba_browser_email_template, rba_browser_sms_template, rba_city_email_template, rba_city_sms_template, rba_country_email_template, rba_country_sms_template, rba_ip_email_template, rba_ip_sms_template, rba_oneclick_email_template, rba_otp_sms_template, sms_template, verification_url) +result = loginradius.risk_based_authentication.rba_login_by_user_name(user_name_authentication_model, email_template, fields, login_url, password_delegation, password_delegation_app, rba_browser_email_template, rba_browser_sms_template, rba_city_email_template, rba_city_sms_template, rba_country_email_template, rba_country_sms_template, rba_ip_email_template, rba_ip_sms_template, rba_oneclick_email_template, rba_otp_sms_template, sms_template, verification_url) ``` @@ -3078,7 +3651,7 @@ phone_authentication_model = { email_template = "<email_template>" #Optional fields = "<fields>" #Optional login_url = "<login_url>" #Optional -password_delegation = True #Optional +password_delegation = "True" #Optional password_delegation_app = "<password_delegation_app>" #Optional rba_browser_email_template = "<rba_browser_email_template>" #Optional rba_browser_sms_template = "<rba_browser_sms_template>" #Optional @@ -3093,7 +3666,7 @@ rba_otp_sms_template = "<rba_otp_sms_template>" #Optional sms_template = "<sms_template>" #Optional verification_url = "<verification_url>" #Optional -loginradius.risk_based_authentication.rba_login_by_phone(phone_authentication_model, email_template, fields, login_url, password_delegation, password_delegation_app, rba_browser_email_template, rba_browser_sms_template, rba_city_email_template, rba_city_sms_template, rba_country_email_template, rba_country_sms_template, rba_ip_email_template, rba_ip_sms_template, rba_oneclick_email_template, rba_otp_sms_template, sms_template, verification_url) +result = loginradius.risk_based_authentication.rba_login_by_phone(phone_authentication_model, email_template, fields, login_url, password_delegation, password_delegation_app, rba_browser_email_template, rba_browser_sms_template, rba_city_email_template, rba_city_sms_template, rba_country_email_template, rba_country_sms_template, rba_ip_email_template, rba_ip_sms_template, rba_oneclick_email_template, rba_otp_sms_template, sms_template, verification_url) ``` @@ -3101,7 +3674,7 @@ loginradius.risk_based_authentication.rba_login_by_phone(phone_authentication_mo -### Sott API +### Sott API List of APIs in this Section:<br> @@ -3118,7 +3691,7 @@ List of APIs in this Section:<br> time_difference = 0 #Optional -loginradius.sott.generate_sott(time_difference) +result = loginradius.sott.generate_sott(time_difference) ``` @@ -3126,7 +3699,7 @@ loginradius.sott.generate_sott(time_difference) -### Native Social API +### NativeSocial API List of APIs in this Section:<br> @@ -3134,7 +3707,7 @@ List of APIs in this Section:<br> * GET : [Access Token via Facebook Token](#GetAccessTokenByFacebookAccessToken-get-)<br> * GET : [Access Token via Twitter Token](#GetAccessTokenByTwitterAccessToken-get-)<br> * GET : [Access Token via Google Token](#GetAccessTokenByGoogleAccessToken-get-)<br> -* GET : [LoginRadius Access Token using google JWT token for Native Mobile Login](#GetAccessTokenByGoogleJWTAccessToken-get-)<br> +* GET : [Access Token using google JWT token for Native Mobile Login](#GetAccessTokenByGoogleJWTAccessToken-get-)<br> * GET : [Access Token via Linkedin Token](#GetAccessTokenByLinkedinAccessToken-get-)<br> * GET : [Get Access Token By Foursquare Access Token](#GetAccessTokenByFoursquareAccessToken-get-)<br> * GET : [Access Token via Vkontakte Token](#GetAccessTokenByVkontakteAccessToken-get-)<br> @@ -3144,34 +3717,34 @@ List of APIs in this Section:<br> <h6 id="GetAccessTokenByFacebookAccessToken-get-"> Access Token via Facebook Token (GET)</h6> - 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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-facebook-token/) + 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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-facebook-token/) ``` fb_access_token = "<fb_access_token>" #Required -loginradius.native_social.get_access_token_by_facebook_access_token(fb_access_token) +result = loginradius.native_social.get_access_token_by_facebook_access_token(fb_access_token) ``` <h6 id="GetAccessTokenByTwitterAccessToken-get-"> Access Token via Twitter Token (GET)</h6> - 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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-twitter-token) + 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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-twitter-token) ``` tw_access_token = "<tw_access_token>" #Required tw_token_secret = "<tw_token_secret>" #Required -loginradius.native_social.get_access_token_by_twitter_access_token(tw_access_token, tw_token_secret) +result = loginradius.native_social.get_access_token_by_twitter_access_token(tw_access_token, tw_token_secret) ``` <h6 id="GetAccessTokenByGoogleAccessToken-get-"> Access Token via Google Token (GET)</h6> - 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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-google-token) + 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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-google-token) ``` @@ -3179,72 +3752,72 @@ google_access_token = "<google_access_token>" #Required client_id = "<client_id>" #Optional refresh_token = "<refresh_token>" #Optional -loginradius.native_social.get_access_token_by_google_access_token(google_access_token, client_id, refresh_token) +result = loginradius.native_social.get_access_token_by_google_access_token(google_access_token, client_id, refresh_token) ``` -<h6 id="GetAccessTokenByGoogleJWTAccessToken-get-"> LoginRadius Access Token using google JWT token for Native Mobile Login (GET)</h6> +<h6 id="GetAccessTokenByGoogleJWTAccessToken-get-"> Access Token using google JWT token for Native Mobile Login (GET)</h6> This API is used to Get LoginRadius Access Token using google jwt id token for google native mobile login/registration. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-googlejwt) ``` id_token = "<id_token>" #Required -loginradius.native_social.get_access_token_by_google_j_w_t_access_token(id_token) +result = loginradius.native_social.get_access_token_by_google_j_w_t_access_token(id_token) ``` <h6 id="GetAccessTokenByLinkedinAccessToken-get-"> Access Token via Linkedin Token (GET)</h6> - 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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-linkedin-token/) + 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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-linkedin-token/) ``` ln_access_token = "<ln_access_token>" #Required -loginradius.native_social.get_access_token_by_linkedin_access_token(ln_access_token) +result = loginradius.native_social.get_access_token_by_linkedin_access_token(ln_access_token) ``` <h6 id="GetAccessTokenByFoursquareAccessToken-get-"> Get Access Token By Foursquare Access Token (GET)</h6> - 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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-foursquare-token/) + 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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-foursquare-token/) ``` fs_access_token = "<fs_access_token>" #Required -loginradius.native_social.get_access_token_by_foursquare_access_token(fs_access_token) +result = loginradius.native_social.get_access_token_by_foursquare_access_token(fs_access_token) ``` <h6 id="GetAccessTokenByVkontakteAccessToken-get-"> Access Token via Vkontakte Token (GET)</h6> - 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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-vkontakte-token) + 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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-vkontakte-token) ``` vk_access_token = "<vk_access_token>" #Required -loginradius.native_social.get_access_token_by_vkontakte_access_token(vk_access_token) +result = loginradius.native_social.get_access_token_by_vkontakte_access_token(vk_access_token) ``` <h6 id="GetAccessTokenByGoogleAuthCode-get-"> Access Token via Google AuthCode (GET)</h6> - 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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-google-auth-code) + 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. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-google-auth-code) ``` google_authcode = "<google_authcode>" #Required -loginradius.native_social.get_access_token_by_google_auth_code(google_authcode) +result = loginradius.native_social.get_access_token_by_google_auth_code(google_authcode) ``` @@ -3252,7 +3825,7 @@ loginradius.native_social.get_access_token_by_google_auth_code(google_authcode) -### WebHook API +### WebHook API List of APIs in this Section:<br> @@ -3275,7 +3848,7 @@ web_hook_subscribe_model = { "targetUrl" : "<targetUrl>" } #Required -loginradius.web_hook.web_hook_subscribe(web_hook_subscribe_model) +result = loginradius.web_hook.web_hook_subscribe(web_hook_subscribe_model) ``` @@ -3288,7 +3861,7 @@ loginradius.web_hook.web_hook_subscribe(web_hook_subscribe_model) event = "<event>" #Required -loginradius.web_hook.get_web_hook_subscribed_u_r_ls(event) +result = loginradius.web_hook.get_web_hook_subscribed_u_r_ls(event) ``` @@ -3300,7 +3873,7 @@ loginradius.web_hook.get_web_hook_subscribed_u_r_ls(event) ``` -loginradius.web_hook.webhook_test() +result = loginradius.web_hook.webhook_test() ``` @@ -3316,7 +3889,7 @@ web_hook_subscribe_model = { "targetUrl" : "<targetUrl>" } #Required -loginradius.web_hook.web_hook_unsubscribe(web_hook_subscribe_model) +result = loginradius.web_hook.web_hook_unsubscribe(web_hook_subscribe_model) ``` @@ -3356,13 +3929,15 @@ We have a demo web application using the Python SDK, which includes the followin You can get a copy of our demo project at [GitHub](https://github.com/LoginRadius/python-sdk). <br> + ### Configuration 1.Have Flask, requests installed: ```pip install flask``` <br> ```pip install requests``` <br> - +```pip install pbkdf2``` <br> +```pip install cryptography``` <br> 2.Fill in credentials in ```lr.py``` and ```static/js/options.js``` 3.Navigate to demo directory and run: ```python app.py``` diff --git a/demo/LoginRadius/__init__.py b/demo/LoginRadius/__init__.py index f032892..db500c7 100644 --- a/demo/LoginRadius/__init__.py +++ b/demo/LoginRadius/__init__.py @@ -20,7 +20,7 @@ __copyright__ = "Copyright 2019, LoginRadius" __email__ = "developers@loginradius.com" __status__ = "Production" -__version__ = "10.0.0-beta" +__version__ = "10.0.0" import json import sys @@ -46,6 +46,7 @@ from LoginRadius.api.authentication.phoneauthentication_api import PhoneAuthenticationApi from LoginRadius.api.authentication.riskbasedauthentication_api import RiskBasedAuthenticationApi from LoginRadius.api.authentication.smartlogin_api import SmartLoginApi +from LoginRadius.api.authentication.pinauthentication_api import PINAuthenticationApi # Account APIs from LoginRadius.api.account.account_api import AccountApi from LoginRadius.api.account.role_api import RoleApi @@ -56,6 +57,9 @@ from LoginRadius.api.advanced.multifactorauthentication_api import MultiFactorAuthenticationApi from LoginRadius.api.advanced.configuration_api import ConfigurationApi from LoginRadius.api.advanced.webhook_api import WebHookApi +from LoginRadius.api.advanced.reauthentication_api import ReAuthenticationApi +from LoginRadius.api.advanced.consentmanagement_api import ConsentManagementApi + # Social APIs from LoginRadius.api.social.nativesocial_api import NativeSocialApi from LoginRadius.api.social.social_api import SocialApi @@ -132,16 +136,19 @@ def __init__(self): self.risk_based_authentication = RiskBasedAuthenticationApi(self) self.smart_login = SmartLoginApi(self) self.phone_authentication = PhoneAuthenticationApi(self) + self.pin_authentication = PINAuthenticationApi(self) + self.consent_management = ConsentManagementApi(self) + self.account = AccountApi(self) self.role = RoleApi(self) - self.sott = SottApi(self) - + self.sott = SottApi(self) self.custom_object = CustomObjectApi(self) self.custom_registration_data = CustomRegistrationDataApi(self) self.mfa = MultiFactorAuthenticationApi(self) self.configuration = ConfigurationApi(self) self.web_hook = WebHookApi(self) + self.re_authentication = ReAuthenticationApi(self) self.native_social = NativeSocialApi(self) self.social = SocialApi(self) diff --git a/lib/LoginRadius/__init__.py b/lib/LoginRadius/__init__.py index f032892..db500c7 100755 --- a/lib/LoginRadius/__init__.py +++ b/lib/LoginRadius/__init__.py @@ -20,7 +20,7 @@ __copyright__ = "Copyright 2019, LoginRadius" __email__ = "developers@loginradius.com" __status__ = "Production" -__version__ = "10.0.0-beta" +__version__ = "10.0.0" import json import sys @@ -46,6 +46,7 @@ from LoginRadius.api.authentication.phoneauthentication_api import PhoneAuthenticationApi from LoginRadius.api.authentication.riskbasedauthentication_api import RiskBasedAuthenticationApi from LoginRadius.api.authentication.smartlogin_api import SmartLoginApi +from LoginRadius.api.authentication.pinauthentication_api import PINAuthenticationApi # Account APIs from LoginRadius.api.account.account_api import AccountApi from LoginRadius.api.account.role_api import RoleApi @@ -56,6 +57,9 @@ from LoginRadius.api.advanced.multifactorauthentication_api import MultiFactorAuthenticationApi from LoginRadius.api.advanced.configuration_api import ConfigurationApi from LoginRadius.api.advanced.webhook_api import WebHookApi +from LoginRadius.api.advanced.reauthentication_api import ReAuthenticationApi +from LoginRadius.api.advanced.consentmanagement_api import ConsentManagementApi + # Social APIs from LoginRadius.api.social.nativesocial_api import NativeSocialApi from LoginRadius.api.social.social_api import SocialApi @@ -132,16 +136,19 @@ def __init__(self): self.risk_based_authentication = RiskBasedAuthenticationApi(self) self.smart_login = SmartLoginApi(self) self.phone_authentication = PhoneAuthenticationApi(self) + self.pin_authentication = PINAuthenticationApi(self) + self.consent_management = ConsentManagementApi(self) + self.account = AccountApi(self) self.role = RoleApi(self) - self.sott = SottApi(self) - + self.sott = SottApi(self) self.custom_object = CustomObjectApi(self) self.custom_registration_data = CustomRegistrationDataApi(self) self.mfa = MultiFactorAuthenticationApi(self) self.configuration = ConfigurationApi(self) self.web_hook = WebHookApi(self) + self.re_authentication = ReAuthenticationApi(self) self.native_social = NativeSocialApi(self) self.social = SocialApi(self) diff --git a/lib/LoginRadius/api/__init__.py b/lib/LoginRadius/api/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/lib/LoginRadius/api/account/__init__.py b/lib/LoginRadius/api/account/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/lib/LoginRadius/api/account/account_api.py b/lib/LoginRadius/api/account/account_api.py index 89a5b1f..37051c7 100644 --- a/lib/LoginRadius/api/account/account_api.py +++ b/lib/LoginRadius/api/account/account_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # @@ -315,7 +315,7 @@ def invalidate_account_email_verification(self, uid, email_template='', verifica return self._lr_object.execute("PUT", resource_path, query_parameters, None) def get_forgot_password_token(self, email, email_template=None, reset_password_url=None, - send_email=False): + send_email=None): """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. Args: @@ -544,3 +544,50 @@ def get_account_identities_by_email(self, email, fields=''): resource_path = "identity/v2/manage/account/identities" return self._lr_object.execute("GET", resource_path, query_parameters, None) + + def account_delete_by_email(self, email): + """This API is used to delete all user profiles associated with an Email. + + Args: + email: Email of the user + + Returns: + Response containing Definition of Delete Request + 18.36 + """ + + if(self._lr_object.is_null_or_whitespace(email)): + raise Exception(self._lr_object.get_validation_message("email")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["apiSecret"] = self._lr_object.get_api_secret() + query_parameters["email"] = email + + resource_path = "identity/v2/manage/account" + return self._lr_object.execute("DELETE", resource_path, query_parameters, None) + + def account_update_uid(self, update_uid_model, uid): + """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. + + Args: + update_uid_model: Payload containing Update UID + uid: UID, the unified identifier for each user account + + Returns: + Response containing Definition of Complete Validation data + 18.41 + """ + if(update_uid_model is None): + raise Exception(self._lr_object.get_validation_message("update_uid_model")) + + if(self._lr_object.is_null_or_whitespace(uid)): + raise Exception(self._lr_object.get_validation_message("uid")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["apiSecret"] = self._lr_object.get_api_secret() + query_parameters["uid"] = uid + + resource_path = "identity/v2/manage/account/uid" + return self._lr_object.execute("PUT", resource_path, query_parameters, update_uid_model) diff --git a/lib/LoginRadius/api/account/role_api.py b/lib/LoginRadius/api/account/role_api.py index 54e4153..28c7c40 100644 --- a/lib/LoginRadius/api/account/role_api.py +++ b/lib/LoginRadius/api/account/role_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # diff --git a/lib/LoginRadius/api/account/sott_api.py b/lib/LoginRadius/api/account/sott_api.py index 3bc8c4e..13fbbf8 100644 --- a/lib/LoginRadius/api/account/sott_api.py +++ b/lib/LoginRadius/api/account/sott_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # diff --git a/lib/LoginRadius/api/advanced/__init__.py b/lib/LoginRadius/api/advanced/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/lib/LoginRadius/api/advanced/configuration_api.py b/lib/LoginRadius/api/advanced/configuration_api.py index 7e827dc..dd35f2d 100644 --- a/lib/LoginRadius/api/advanced/configuration_api.py +++ b/lib/LoginRadius/api/advanced/configuration_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # diff --git a/lib/LoginRadius/api/advanced/consentmanagement_api.py b/lib/LoginRadius/api/advanced/consentmanagement_api.py new file mode 100644 index 0000000..dfd9fb0 --- /dev/null +++ b/lib/LoginRadius/api/advanced/consentmanagement_api.py @@ -0,0 +1,155 @@ +# -- coding: utf-8 -- +# Created by LoginRadius Development Team +# Copyright 2019 LoginRadius Inc. All rights reserved. +# + + +class ConsentManagementApi: + + def __init__(self, lr_object): + """ + :param lr_object: this is the reference to the parent LoginRadius object. + """ + self._lr_object = lr_object + + def get_consent_logs_by_uid(self, uid): + """This API is used to get the Consent logs of the user. + + Args: + uid: UID, the unified identifier for each user account + + Returns: + Response containing consent logs + 18.37 + """ + + if(self._lr_object.is_null_or_whitespace(uid)): + raise Exception(self._lr_object.get_validation_message("uid")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["apiSecret"] = self._lr_object.get_api_secret() + + resource_path = "identity/v2/manage/account/" + uid + "/consent/logs" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + + def submit_consent_by_consent_token(self, consent_token, consent_submit_model): + """This API is to submit consent form using consent token. + + Args: + consent_token: The consent token received after login error 1226 + consent_submit_model: Model class containing list of multiple consent + + Returns: + Response containing User Profile Data and access token + 43.1 + """ + + if(self._lr_object.is_null_or_whitespace(consent_token)): + raise Exception(self._lr_object.get_validation_message("consent_token")) + if(consent_submit_model is None): + raise Exception(self._lr_object.get_validation_message("consent_submit_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["consentToken"] = consent_token + + resource_path = "identity/v2/auth/consent" + return self._lr_object.execute("POST", resource_path, query_parameters, consent_submit_model) + + def get_consent_logs(self, access_token): + """This API is used to fetch consent logs. + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + + Returns: + Response containing consent logs + 43.2 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/consent/logs" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + + def submit_consent_by_access_token(self, access_token, consent_submit_model): + """API to provide a way to end user to submit a consent form for particular event type. + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + consent_submit_model: Model class containing list of multiple consent + + Returns: + Response containing Definition for Complete profile data + 43.3 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + if(consent_submit_model is None): + raise Exception(self._lr_object.get_validation_message("consent_submit_model")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/consent/profile" + return self._lr_object.execute("POST", resource_path, query_parameters, consent_submit_model) + + def verify_consent_by_access_token(self, access_token, event, is_custom): + """This API is used to check if consent is submitted for a particular event or not. + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + event: Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject + is_custom: true/false + + Returns: + Response containing consent profile + 43.4 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + if(self._lr_object.is_null_or_whitespace(event)): + raise Exception(self._lr_object.get_validation_message("event")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["event"] = event + query_parameters["isCustom"] = is_custom + + resource_path = "identity/v2/auth/consent/verify" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + + def update_consent_profile_by_access_token(self, access_token, consent_update_model): + """This API is to update consents using access token. + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + consent_update_model: Model class containg list of multiple consent + + Returns: + Response containing consent profile + 43.5 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + if(consent_update_model is None): + raise Exception(self._lr_object.get_validation_message("consent_update_model")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/consent" + return self._lr_object.execute("PUT", resource_path, query_parameters, consent_update_model) diff --git a/lib/LoginRadius/api/advanced/customobject_api.py b/lib/LoginRadius/api/advanced/customobject_api.py index 5a81e74..ce07db2 100644 --- a/lib/LoginRadius/api/advanced/customobject_api.py +++ b/lib/LoginRadius/api/advanced/customobject_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # @@ -42,7 +42,7 @@ def create_custom_object_by_token(self, access_token, object_name, payload): return self._lr_object.execute("POST", resource_path, query_parameters, payload) def update_custom_object_by_token(self, access_token, object_name, object_record_id, - payload, update_type=''): + payload, update_type=None): """This API is used to update the specified custom object data of the specified account. If the value of updatetype is 'replace' then it will fully replace custom object with the new custom object and if the value of updatetype is 'partialreplace' then it will perform an upsert type operation Args: @@ -194,7 +194,7 @@ def create_custom_object_by_uid(self, object_name, payload, uid): return self._lr_object.execute("POST", resource_path, query_parameters, payload) def update_custom_object_by_uid(self, object_name, object_record_id, payload, - uid, update_type=''): + uid, update_type=None): """This API is used to update the specified custom object data of a specified account. If the value of updatetype is 'replace' then it will fully replace custom object with new custom object and if the value of updatetype is partialreplace then it will perform an upsert type operation. Args: diff --git a/lib/LoginRadius/api/advanced/customregistrationdata_api.py b/lib/LoginRadius/api/advanced/customregistrationdata_api.py index c3d3d48..3a0dc22 100644 --- a/lib/LoginRadius/api/advanced/customregistrationdata_api.py +++ b/lib/LoginRadius/api/advanced/customregistrationdata_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # diff --git a/lib/LoginRadius/api/advanced/multifactorauthentication_api.py b/lib/LoginRadius/api/advanced/multifactorauthentication_api.py index 8b25d51..f630077 100644 --- a/lib/LoginRadius/api/advanced/multifactorauthentication_api.py +++ b/lib/LoginRadius/api/advanced/multifactorauthentication_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # @@ -509,129 +509,6 @@ def mfa_resend_otp(self, second_factor_authentication_token, sms_template2_f_a=N resource_path = "identity/v2/auth/login/2fa/resend" return self._lr_object.execute("GET", resource_path, query_parameters, None) - def mfa_re_authenticate(self, access_token, sms_template2_f_a=None): - """This API is used to trigger the Multi-Factor Autentication workflow for the provided access_token - - Args: - access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - sms_template2_f_a: SMS Template Name - - Returns: - Response containing Definition of Complete Multi-Factor Authentication Settings data - 14.3 - """ - - if(self._lr_object.is_null_or_whitespace(access_token)): - raise Exception(self._lr_object.get_validation_message("access_token")) - - query_parameters = {} - query_parameters["access_token"] = access_token - query_parameters["apiKey"] = self._lr_object.get_api_key() - if(not self._lr_object.is_null_or_whitespace(sms_template2_f_a)): - query_parameters["smsTemplate2FA"] = sms_template2_f_a - - resource_path = "identity/v2/auth/account/reauth/2fa" - return self._lr_object.execute("GET", resource_path, query_parameters, None) - - def mfa_re_authenticate_by_otp(self, access_token, reauth_by_otp_model): - """This API is used to re-authenticate via Multi-factor authentication by passing the One Time Password received via SMS - - Args: - access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - reauth_by_otp_model: Model Class containing Definition for MFA Reauthentication by OTP - - Returns: - Complete user Multi-Factor Authentication Token data - 14.4 - """ - - if(self._lr_object.is_null_or_whitespace(access_token)): - raise Exception(self._lr_object.get_validation_message("access_token")) - if(reauth_by_otp_model is None): - raise Exception(self._lr_object.get_validation_message("reauth_by_otp_model")) - - query_parameters = {} - query_parameters["access_token"] = access_token - query_parameters["apiKey"] = self._lr_object.get_api_key() - - resource_path = "identity/v2/auth/account/reauth/2fa/otp" - return self._lr_object.execute("PUT", resource_path, query_parameters, reauth_by_otp_model) - - def mfa_re_authenticate_by_backup_code(self, access_token, reauth_by_backup_code_model): - """This API is used to re-authenticate by set of backup codes via access_token on the site that has Multi-factor authentication enabled in re-authentication for the user that does not have the device - - Args: - access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - reauth_by_backup_code_model: Model Class containing Definition for MFA Reauthentication by Backup code - - Returns: - Complete user Multi-Factor Authentication Token data - 14.5 - """ - - if(self._lr_object.is_null_or_whitespace(access_token)): - raise Exception(self._lr_object.get_validation_message("access_token")) - if(reauth_by_backup_code_model is None): - raise Exception(self._lr_object.get_validation_message("reauth_by_backup_code_model")) - - query_parameters = {} - query_parameters["access_token"] = access_token - query_parameters["apiKey"] = self._lr_object.get_api_key() - - resource_path = "identity/v2/auth/account/reauth/2fa/backupcode" - return self._lr_object.execute("PUT", resource_path, query_parameters, reauth_by_backup_code_model) - - def mfa_re_authenticate_by_google_auth(self, access_token, reauth_by_google_authenticator_code_model): - """This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code - - Args: - access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - reauth_by_google_authenticator_code_model: Model Class containing Definition for MFA Reauthentication by Google Authenticator - - Returns: - Complete user Multi-Factor Authentication Token data - 14.6 - """ - - if(self._lr_object.is_null_or_whitespace(access_token)): - raise Exception(self._lr_object.get_validation_message("access_token")) - if(reauth_by_google_authenticator_code_model is None): - raise Exception(self._lr_object.get_validation_message("reauth_by_google_authenticator_code_model")) - - query_parameters = {} - query_parameters["access_token"] = access_token - query_parameters["apiKey"] = self._lr_object.get_api_key() - - resource_path = "identity/v2/auth/account/reauth/2fa/googleauthenticatorcode" - return self._lr_object.execute("PUT", resource_path, query_parameters, reauth_by_google_authenticator_code_model) - - def mfa_re_authenticate_by_password(self, access_token, password_event_based_auth_model_with_lockout, sms_template2_f_a=None): - """This API is used to re-authenticate via Multi-factor-authentication by passing the password - - Args: - access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - password_event_based_auth_model_with_lockout: Model Class containing Definition of payload for PasswordEventBasedAuthModel with Lockout API - sms_template2_f_a: SMS Template Name - - Returns: - Complete user Multi-Factor Authentication Token data - 14.7 - """ - - if(self._lr_object.is_null_or_whitespace(access_token)): - raise Exception(self._lr_object.get_validation_message("access_token")) - if(password_event_based_auth_model_with_lockout is None): - raise Exception(self._lr_object.get_validation_message("password_event_based_auth_model_with_lockout")) - - query_parameters = {} - query_parameters["access_token"] = access_token - query_parameters["apiKey"] = self._lr_object.get_api_key() - if(not self._lr_object.is_null_or_whitespace(sms_template2_f_a)): - query_parameters["smsTemplate2FA"] = sms_template2_f_a - - resource_path = "identity/v2/auth/account/reauth/password" - return self._lr_object.execute("PUT", resource_path, query_parameters, password_event_based_auth_model_with_lockout) - def mfa_reset_sms_authenticator_by_uid(self, otpauthenticator, uid): """This API resets the SMS Authenticator configurations on a given account via the UID. diff --git a/lib/LoginRadius/api/advanced/reauthentication_api.py b/lib/LoginRadius/api/advanced/reauthentication_api.py new file mode 100644 index 0000000..24b8bda --- /dev/null +++ b/lib/LoginRadius/api/advanced/reauthentication_api.py @@ -0,0 +1,235 @@ +# -- coding: utf-8 -- +# Created by LoginRadius Development Team +# Copyright 2019 LoginRadius Inc. All rights reserved. +# + + +class ReAuthenticationApi: + + def __init__(self, lr_object): + """ + :param lr_object: this is the reference to the parent LoginRadius object. + """ + self._lr_object = lr_object + + def mfa_re_authenticate(self, access_token, sms_template2_f_a=None): + """This API is used to trigger the Multi-Factor Autentication workflow for the provided access_token + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + sms_template2_f_a: SMS Template Name + + Returns: + Response containing Definition of Complete Multi-Factor Authentication Settings data + 14.3 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + if(not self._lr_object.is_null_or_whitespace(sms_template2_f_a)): + query_parameters["smsTemplate2FA"] = sms_template2_f_a + + resource_path = "identity/v2/auth/account/reauth/2fa" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + + def mfa_re_authenticate_by_otp(self, access_token, reauth_by_otp_model): + """This API is used to re-authenticate via Multi-factor authentication by passing the One Time Password received via SMS + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + reauth_by_otp_model: Model Class containing Definition for MFA Reauthentication by OTP + + Returns: + Complete user Multi-Factor Authentication Token data + 14.4 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + if(reauth_by_otp_model is None): + raise Exception(self._lr_object.get_validation_message("reauth_by_otp_model")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/account/reauth/2fa/otp" + return self._lr_object.execute("PUT", resource_path, query_parameters, reauth_by_otp_model) + + def mfa_re_authenticate_by_backup_code(self, access_token, reauth_by_backup_code_model): + """This API is used to re-authenticate by set of backup codes via access_token on the site that has Multi-factor authentication enabled in re-authentication for the user that does not have the device + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + reauth_by_backup_code_model: Model Class containing Definition for MFA Reauthentication by Backup code + + Returns: + Complete user Multi-Factor Authentication Token data + 14.5 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + if(reauth_by_backup_code_model is None): + raise Exception(self._lr_object.get_validation_message("reauth_by_backup_code_model")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/account/reauth/2fa/backupcode" + return self._lr_object.execute("PUT", resource_path, query_parameters, reauth_by_backup_code_model) + + def mfa_re_authenticate_by_google_auth(self, access_token, reauth_by_google_authenticator_code_model): + """This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + reauth_by_google_authenticator_code_model: Model Class containing Definition for MFA Reauthentication by Google Authenticator + + Returns: + Complete user Multi-Factor Authentication Token data + 14.6 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + if(reauth_by_google_authenticator_code_model is None): + raise Exception(self._lr_object.get_validation_message("reauth_by_google_authenticator_code_model")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/account/reauth/2fa/googleauthenticatorcode" + return self._lr_object.execute("PUT", resource_path, query_parameters, reauth_by_google_authenticator_code_model) + + def mfa_re_authenticate_by_password(self, access_token, password_event_based_auth_model_with_lockout, sms_template2_f_a=None): + """This API is used to re-authenticate via Multi-factor-authentication by passing the password + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + password_event_based_auth_model_with_lockout: Model Class containing Definition of payload for PasswordEventBasedAuthModel with Lockout API + sms_template2_f_a: SMS Template Name + + Returns: + Complete user Multi-Factor Authentication Token data + 14.7 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + if(password_event_based_auth_model_with_lockout is None): + raise Exception(self._lr_object.get_validation_message("password_event_based_auth_model_with_lockout")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + if(not self._lr_object.is_null_or_whitespace(sms_template2_f_a)): + query_parameters["smsTemplate2FA"] = sms_template2_f_a + + resource_path = "identity/v2/auth/account/reauth/password" + return self._lr_object.execute("PUT", resource_path, query_parameters, password_event_based_auth_model_with_lockout) + + def verify_multi_factor_otp_reauthentication(self, event_based_multi_factor_token, uid): + """This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by OTP. + + Args: + event_based_multi_factor_token: Model Class containing Definition for SecondFactorValidationToken + uid: UID, the unified identifier for each user account + + Returns: + Response containing Definition of Complete Validation data + 18.38 + """ + if(event_based_multi_factor_token is None): + raise Exception(self._lr_object.get_validation_message("event_based_multi_factor_token")) + + if(self._lr_object.is_null_or_whitespace(uid)): + raise Exception(self._lr_object.get_validation_message("uid")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["apiSecret"] = self._lr_object.get_api_secret() + + resource_path = "identity/v2/manage/account/" + uid + "/reauth/2fa" + return self._lr_object.execute("POST", resource_path, query_parameters, event_based_multi_factor_token) + + def verify_multi_factor_password_reauthentication(self, event_based_multi_factor_token, uid): + """This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by password. + + Args: + event_based_multi_factor_token: Model Class containing Definition for SecondFactorValidationToken + uid: UID, the unified identifier for each user account + + Returns: + Response containing Definition of Complete Validation data + 18.39 + """ + if(event_based_multi_factor_token is None): + raise Exception(self._lr_object.get_validation_message("event_based_multi_factor_token")) + + if(self._lr_object.is_null_or_whitespace(uid)): + raise Exception(self._lr_object.get_validation_message("uid")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["apiSecret"] = self._lr_object.get_api_secret() + + resource_path = "identity/v2/manage/account/" + uid + "/reauth/password" + return self._lr_object.execute("POST", resource_path, query_parameters, event_based_multi_factor_token) + + def verify_multi_factor_pin_reauthentication(self, event_based_multi_factor_token, uid): + """This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by PIN. + + Args: + event_based_multi_factor_token: Model Class containing Definition for SecondFactorValidationToken + uid: UID, the unified identifier for each user account + + Returns: + Response containing Definition of Complete Validation data + 18.40 + """ + if(event_based_multi_factor_token is None): + raise Exception(self._lr_object.get_validation_message("event_based_multi_factor_token")) + + if(self._lr_object.is_null_or_whitespace(uid)): + raise Exception(self._lr_object.get_validation_message("uid")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["apiSecret"] = self._lr_object.get_api_secret() + + resource_path = "identity/v2/manage/account/" + uid + "/reauth/pin" + return self._lr_object.execute("POST", resource_path, query_parameters, event_based_multi_factor_token) + + def verify_pin_authentication(self, access_token, pin_auth_event_based_auth_model_with_lockout, sms_template2_f_a=None): + """This API is used to validate the triggered MFA authentication flow with a password. + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + pin_auth_event_based_auth_model_with_lockout: Model Class containing Definition of payload for PIN + sms_template2_f_a: SMS Template Name + + Returns: + Response containing Definition response of MFA reauthentication + 42.13 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + if(pin_auth_event_based_auth_model_with_lockout is None): + raise Exception(self._lr_object.get_validation_message("pin_auth_event_based_auth_model_with_lockout")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + if(not self._lr_object.is_null_or_whitespace(sms_template2_f_a)): + query_parameters["smsTemplate2FA"] = sms_template2_f_a + + resource_path = "identity/v2/auth/account/reauth/pin" + return self._lr_object.execute("PUT", resource_path, query_parameters, pin_auth_event_based_auth_model_with_lockout) diff --git a/lib/LoginRadius/api/advanced/webhook_api.py b/lib/LoginRadius/api/advanced/webhook_api.py index b34ca62..553a969 100644 --- a/lib/LoginRadius/api/advanced/webhook_api.py +++ b/lib/LoginRadius/api/advanced/webhook_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # diff --git a/lib/LoginRadius/api/authentication/__init__.py b/lib/LoginRadius/api/authentication/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/lib/LoginRadius/api/authentication/authentication_api.py b/lib/LoginRadius/api/authentication/authentication_api.py index 2483e02..1757eb5 100644 --- a/lib/LoginRadius/api/authentication/authentication_api.py +++ b/lib/LoginRadius/api/authentication/authentication_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # @@ -932,46 +932,6 @@ def user_registration_by_email(self, auth_user_registration_model, sott, email_t resource_path = "identity/v2/auth/register" return self._lr_object.execute("POST", resource_path, query_parameters, auth_user_registration_model) - def user_registration_by_phone(self, auth_user_registration_model, sott, fields='', - options='', sms_template=None, verification_url=None, welcome_email_template=None): - """This API registers the new users into your Cloud Storage and triggers the phone verification process. - - Args: - auth_user_registration_model: Model Class containing Definition of payload for Auth User Registration API - sott: LoginRadius Secured One Time Token - fields: The fields parameter filters the API response so that the response only includes a specific set of fields - options: PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow) - sms_template: SMS Template name - verification_url: Email verification url - welcome_email_template: Name of the welcome email template - - Returns: - Response containing Definition of Complete Validation, UserProfile data and Access Token - 17.1.2 - """ - if(auth_user_registration_model is None): - raise Exception(self._lr_object.get_validation_message("auth_user_registration_model")) - - if(self._lr_object.is_null_or_whitespace(sott)): - raise Exception(self._lr_object.get_validation_message("sott")) - - query_parameters = {} - query_parameters["apiKey"] = self._lr_object.get_api_key() - query_parameters["sott"] = sott - if(not self._lr_object.is_null_or_whitespace(fields)): - query_parameters["fields"] = fields - if(not self._lr_object.is_null_or_whitespace(options)): - query_parameters["options"] = options - if(not self._lr_object.is_null_or_whitespace(sms_template)): - query_parameters["smsTemplate"] = sms_template - if(not self._lr_object.is_null_or_whitespace(verification_url)): - query_parameters["verificationUrl"] = verification_url - if(not self._lr_object.is_null_or_whitespace(welcome_email_template)): - query_parameters["welcomeEmailTemplate"] = welcome_email_template - - resource_path = "identity/v2/auth/register" - return self._lr_object.execute("POST", resource_path, query_parameters, auth_user_registration_model) - def user_registration_by_captcha(self, auth_user_registration_model_with_captcha, email_template=None, fields='', options='', sms_template=None, verification_url=None, welcome_email_template=None): """This API creates a user in the database as well as sends a verification email to the user. diff --git a/lib/LoginRadius/api/authentication/onetouchlogin_api.py b/lib/LoginRadius/api/authentication/onetouchlogin_api.py index be00562..ca6af53 100644 --- a/lib/LoginRadius/api/authentication/onetouchlogin_api.py +++ b/lib/LoginRadius/api/authentication/onetouchlogin_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # diff --git a/lib/LoginRadius/api/authentication/passwordlesslogin_api.py b/lib/LoginRadius/api/authentication/passwordlesslogin_api.py index 70e9bd9..cd46d45 100644 --- a/lib/LoginRadius/api/authentication/passwordlesslogin_api.py +++ b/lib/LoginRadius/api/authentication/passwordlesslogin_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # diff --git a/lib/LoginRadius/api/authentication/phoneauthentication_api.py b/lib/LoginRadius/api/authentication/phoneauthentication_api.py index 6ce862d..b85706a 100644 --- a/lib/LoginRadius/api/authentication/phoneauthentication_api.py +++ b/lib/LoginRadius/api/authentication/phoneauthentication_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # @@ -125,7 +125,7 @@ def phone_verification_otp_by_access_token(self, access_token, otp, sms_template """This API is used to consume the verification code sent to verify a user's phone number. Use this call for front-end purposes in cases where the user is already logged in by passing the user's access token. Args: - access_token: Access_Token + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. otp: The Verification Code sms_template: SMS Template name @@ -141,16 +141,14 @@ def phone_verification_otp_by_access_token(self, access_token, otp, sms_template raise Exception(self._lr_object.get_validation_message("otp")) query_parameters = {} + query_parameters["access_token"] = access_token query_parameters["apiKey"] = self._lr_object.get_api_key() query_parameters["otp"] = otp if(not self._lr_object.is_null_or_whitespace(sms_template)): query_parameters["smsTemplate"] = sms_template - body_parameters = {} - body_parameters["access_token"] = access_token - resource_path = "identity/v2/auth/phone/otp" - return self._lr_object.execute("PUT", resource_path, query_parameters, body_parameters) + return self._lr_object.execute("PUT", resource_path, query_parameters, None) def phone_resend_verification_otp(self, phone, sms_template=None): """This API is used to resend a verification OTP to verify a user's Phone Number. The user will receive a verification code that they will need to input @@ -198,12 +196,12 @@ def phone_resend_verification_otp_by_token(self, access_token, phone, sms_templa raise Exception(self._lr_object.get_validation_message("phone")) query_parameters = {} + query_parameters["access_token"] = access_token query_parameters["apiKey"] = self._lr_object.get_api_key() if(not self._lr_object.is_null_or_whitespace(sms_template)): query_parameters["smsTemplate"] = sms_template body_parameters = {} - body_parameters["access_token"] = access_token body_parameters["phone"] = phone resource_path = "identity/v2/auth/phone/otp" @@ -244,7 +242,7 @@ def check_phone_number_availability(self, phone): """This API is used to check the Phone Number exists or not on your site. Args: - phone: LoginRadius API Key + phone: The Registered Phone Number Returns: Response containing Definition Complete ExistResponse data @@ -281,3 +279,43 @@ def remove_phone_id_by_access_token(self, access_token): resource_path = "identity/v2/auth/phone" return self._lr_object.execute("DELETE", resource_path, query_parameters, None) + + def user_registration_by_phone(self, auth_user_registration_model, sott, fields='', + options='', sms_template=None, verification_url=None, welcome_email_template=None): + """This API registers the new users into your Cloud Storage and triggers the phone verification process. + + Args: + auth_user_registration_model: Model Class containing Definition of payload for Auth User Registration API + sott: LoginRadius Secured One Time Token + fields: The fields parameter filters the API response so that the response only includes a specific set of fields + options: PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow) + sms_template: SMS Template name + verification_url: Email verification url + welcome_email_template: Name of the welcome email template + + Returns: + Response containing Definition of Complete Validation, UserProfile data and Access Token + 17.1.2 + """ + if(auth_user_registration_model is None): + raise Exception(self._lr_object.get_validation_message("auth_user_registration_model")) + + if(self._lr_object.is_null_or_whitespace(sott)): + raise Exception(self._lr_object.get_validation_message("sott")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["sott"] = sott + if(not self._lr_object.is_null_or_whitespace(fields)): + query_parameters["fields"] = fields + if(not self._lr_object.is_null_or_whitespace(options)): + query_parameters["options"] = options + if(not self._lr_object.is_null_or_whitespace(sms_template)): + query_parameters["smsTemplate"] = sms_template + if(not self._lr_object.is_null_or_whitespace(verification_url)): + query_parameters["verificationUrl"] = verification_url + if(not self._lr_object.is_null_or_whitespace(welcome_email_template)): + query_parameters["welcomeEmailTemplate"] = welcome_email_template + + resource_path = "identity/v2/auth/register" + return self._lr_object.execute("POST", resource_path, query_parameters, auth_user_registration_model) diff --git a/lib/LoginRadius/api/authentication/pinauthentication_api.py b/lib/LoginRadius/api/authentication/pinauthentication_api.py new file mode 100644 index 0000000..5042fd5 --- /dev/null +++ b/lib/LoginRadius/api/authentication/pinauthentication_api.py @@ -0,0 +1,311 @@ +# -- coding: utf-8 -- +# Created by LoginRadius Development Team +# Copyright 2019 LoginRadius Inc. All rights reserved. +# + + +class PINAuthenticationApi: + + def __init__(self, lr_object): + """ + :param lr_object: this is the reference to the parent LoginRadius object. + """ + self._lr_object = lr_object + + def pin_login(self, login_by_pin_model, session_token): + """This API is used to login a user by pin and session_token. + + Args: + login_by_pin_model: Model Class containing Definition of payload for LoginByPin API + session_token: Session Token of user + + Returns: + Response containing User Profile Data and access token + 9.22 + """ + if(login_by_pin_model is None): + raise Exception(self._lr_object.get_validation_message("login_by_pin_model")) + + if(self._lr_object.is_null_or_whitespace(session_token)): + raise Exception(self._lr_object.get_validation_message("session_token")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["session_token"] = session_token + + resource_path = "identity/v2/auth/login/pin" + return self._lr_object.execute("POST", resource_path, query_parameters, login_by_pin_model) + + def send_forgot_pin_email_by_email(self, forgot_pin_link_by_email_model, email_template=None, reset_pin_url=None): + """This API sends the reset pin email to specified email address. + + Args: + forgot_pin_link_by_email_model: Model Class containing Definition for Forgot Pin Link By Email API + email_template: Email template name + reset_pin_url: Reset PIN Url + + Returns: + Response containing Definition of Complete Validation data + 42.1 + """ + if(forgot_pin_link_by_email_model is None): + raise Exception(self._lr_object.get_validation_message("forgot_pin_link_by_email_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + if(not self._lr_object.is_null_or_whitespace(email_template)): + query_parameters["emailTemplate"] = email_template + if(not self._lr_object.is_null_or_whitespace(reset_pin_url)): + query_parameters["resetPINUrl"] = reset_pin_url + + resource_path = "identity/v2/auth/pin/forgot/email" + return self._lr_object.execute("POST", resource_path, query_parameters, forgot_pin_link_by_email_model) + + def send_forgot_pin_email_by_username(self, forgot_pin_link_by_user_name_model, email_template=None, reset_pin_url=None): + """This API sends the reset pin email using username. + + Args: + forgot_pin_link_by_user_name_model: Model Class containing Definition for Forgot Pin Link By UserName API + email_template: Email template name + reset_pin_url: Reset PIN Url + + Returns: + Response containing Definition of Complete Validation data + 42.2 + """ + if(forgot_pin_link_by_user_name_model is None): + raise Exception(self._lr_object.get_validation_message("forgot_pin_link_by_user_name_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + if(not self._lr_object.is_null_or_whitespace(email_template)): + query_parameters["emailTemplate"] = email_template + if(not self._lr_object.is_null_or_whitespace(reset_pin_url)): + query_parameters["resetPINUrl"] = reset_pin_url + + resource_path = "identity/v2/auth/pin/forgot/username" + return self._lr_object.execute("POST", resource_path, query_parameters, forgot_pin_link_by_user_name_model) + + def reset_pin_by_reset_token(self, reset_pin_by_reset_token): + """This API is used to reset pin using reset token. + + Args: + reset_pin_by_reset_token: Model Class containing Definition of payload for Reset Pin By Reset Token API + + Returns: + Response containing Definition of Complete Validation data + 42.3 + """ + if(reset_pin_by_reset_token is None): + raise Exception(self._lr_object.get_validation_message("reset_pin_by_reset_token")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/pin/reset/token" + return self._lr_object.execute("PUT", resource_path, query_parameters, reset_pin_by_reset_token) + + def reset_pin_by_email_and_security_answer(self, reset_pin_by_security_question_answer_and_email_model): + """This API is used to reset pin using security question answer and email. + + Args: + reset_pin_by_security_question_answer_and_email_model: Model Class containing Definition of payload for Reset Pin By Security Question and Email API + + Returns: + Response containing Definition of Complete Validation data + 42.4 + """ + if(reset_pin_by_security_question_answer_and_email_model is None): + raise Exception(self._lr_object.get_validation_message("reset_pin_by_security_question_answer_and_email_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/pin/reset/securityanswer/email" + return self._lr_object.execute("PUT", resource_path, query_parameters, reset_pin_by_security_question_answer_and_email_model) + + def reset_pin_by_username_and_security_answer(self, reset_pin_by_security_question_answer_and_username_model): + """This API is used to reset pin using security question answer and username. + + Args: + reset_pin_by_security_question_answer_and_username_model: Model Class containing Definition of payload for Reset Pin By Security Question and UserName API + + Returns: + Response containing Definition of Complete Validation data + 42.5 + """ + if(reset_pin_by_security_question_answer_and_username_model is None): + raise Exception(self._lr_object.get_validation_message("reset_pin_by_security_question_answer_and_username_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/pin/reset/securityanswer/username" + return self._lr_object.execute("PUT", resource_path, query_parameters, reset_pin_by_security_question_answer_and_username_model) + + def reset_pin_by_phone_and_security_answer(self, reset_pin_by_security_question_answer_and_phone_model): + """This API is used to reset pin using security question answer and phone. + + Args: + reset_pin_by_security_question_answer_and_phone_model: Model Class containing Definition of payload for Reset Pin By Security Question and Phone API + + Returns: + Response containing Definition of Complete Validation data + 42.6 + """ + if(reset_pin_by_security_question_answer_and_phone_model is None): + raise Exception(self._lr_object.get_validation_message("reset_pin_by_security_question_answer_and_phone_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/pin/reset/securityanswer/phone" + return self._lr_object.execute("PUT", resource_path, query_parameters, reset_pin_by_security_question_answer_and_phone_model) + + def send_forgot_pin_sms_by_phone(self, forgot_pin_otp_by_phone_model, sms_template=None): + """This API sends the OTP to specified phone number + + Args: + forgot_pin_otp_by_phone_model: Model Class containing Definition for Forgot Pin Otp By Phone API + sms_template: + + Returns: + Response Containing Validation Data and SMS Data + 42.7 + """ + if(forgot_pin_otp_by_phone_model is None): + raise Exception(self._lr_object.get_validation_message("forgot_pin_otp_by_phone_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + if(not self._lr_object.is_null_or_whitespace(sms_template)): + query_parameters["smsTemplate"] = sms_template + + resource_path = "identity/v2/auth/pin/forgot/otp" + return self._lr_object.execute("POST", resource_path, query_parameters, forgot_pin_otp_by_phone_model) + + def change_pin_by_access_token(self, access_token, change_pin_model): + """This API is used to change a user's PIN using access token. + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + change_pin_model: Model Class containing Definition for change PIN Property + + Returns: + Response containing Definition of Complete Validation data + 42.8 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + if(change_pin_model is None): + raise Exception(self._lr_object.get_validation_message("change_pin_model")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/pin/change" + return self._lr_object.execute("PUT", resource_path, query_parameters, change_pin_model) + + def reset_pin_by_phone_and_otp(self, reset_pin_by_phone_and_otp_model): + """This API is used to reset pin using phoneId and OTP. + + Args: + reset_pin_by_phone_and_otp_model: Model Class containing Definition of payload for Reset Pin By Phone and Otp API + + Returns: + Response containing Definition of Complete Validation data + 42.9 + """ + if(reset_pin_by_phone_and_otp_model is None): + raise Exception(self._lr_object.get_validation_message("reset_pin_by_phone_and_otp_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/pin/reset/otp/phone" + return self._lr_object.execute("PUT", resource_path, query_parameters, reset_pin_by_phone_and_otp_model) + + def reset_pin_by_email_and_otp(self, reset_pin_by_email_and_otp_model): + """This API is used to reset pin using email and OTP. + + Args: + reset_pin_by_email_and_otp_model: Model Class containing Definition of payload for Reset Pin By Email and Otp API + + Returns: + Response containing Definition of Complete Validation data + 42.10 + """ + if(reset_pin_by_email_and_otp_model is None): + raise Exception(self._lr_object.get_validation_message("reset_pin_by_email_and_otp_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/pin/reset/otp/email" + return self._lr_object.execute("PUT", resource_path, query_parameters, reset_pin_by_email_and_otp_model) + + def reset_pin_by_username_and_otp(self, reset_pin_by_username_and_otp_model): + """This API is used to reset pin using username and OTP. + + Args: + reset_pin_by_username_and_otp_model: Model Class containing Definition of payload for Reset Pin By Username and Otp API + + Returns: + Response containing Definition of Complete Validation data + 42.11 + """ + if(reset_pin_by_username_and_otp_model is None): + raise Exception(self._lr_object.get_validation_message("reset_pin_by_username_and_otp_model")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + + resource_path = "identity/v2/auth/pin/reset/otp/username" + return self._lr_object.execute("PUT", resource_path, query_parameters, reset_pin_by_username_and_otp_model) + + def set_pin_by_pin_auth_token(self, pin_required_model, pin_auth_token): + """This API is used to change a user's PIN using Pin Auth token. + + Args: + pin_required_model: Model Class containing Definition for PIN + pin_auth_token: Pin Auth Token + + Returns: + Response containing User Profile Data and access token + 42.12 + """ + if(pin_required_model is None): + raise Exception(self._lr_object.get_validation_message("pin_required_model")) + + if(self._lr_object.is_null_or_whitespace(pin_auth_token)): + raise Exception(self._lr_object.get_validation_message("pin_auth_token")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["pinAuthToken"] = pin_auth_token + + resource_path = "identity/v2/auth/pin/set/pinauthtoken" + return self._lr_object.execute("POST", resource_path, query_parameters, pin_required_model) + + def in_validate_pin_session_token(self, session_token): + """This API is used to invalidate pin session token. + + Args: + session_token: Session Token of user + + Returns: + Response containing Definition of Complete Validation data + 44.1 + """ + + if(self._lr_object.is_null_or_whitespace(session_token)): + raise Exception(self._lr_object.get_validation_message("session_token")) + + query_parameters = {} + query_parameters["apiKey"] = self._lr_object.get_api_key() + query_parameters["session_token"] = session_token + + resource_path = "identity/v2/auth/session_token/invalidate" + return self._lr_object.execute("GET", resource_path, query_parameters, None) diff --git a/lib/LoginRadius/api/authentication/riskbasedauthentication_api.py b/lib/LoginRadius/api/authentication/riskbasedauthentication_api.py index f060def..5181f0d 100644 --- a/lib/LoginRadius/api/authentication/riskbasedauthentication_api.py +++ b/lib/LoginRadius/api/authentication/riskbasedauthentication_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # diff --git a/lib/LoginRadius/api/authentication/smartlogin_api.py b/lib/LoginRadius/api/authentication/smartlogin_api.py index 229ea5d..7bd82a4 100644 --- a/lib/LoginRadius/api/authentication/smartlogin_api.py +++ b/lib/LoginRadius/api/authentication/smartlogin_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # diff --git a/lib/LoginRadius/api/social/__init__.py b/lib/LoginRadius/api/social/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/lib/LoginRadius/api/social/nativesocial_api.py b/lib/LoginRadius/api/social/nativesocial_api.py index 268312d..395d05a 100644 --- a/lib/LoginRadius/api/social/nativesocial_api.py +++ b/lib/LoginRadius/api/social/nativesocial_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # @@ -13,7 +13,7 @@ def __init__(self, lr_object): self._lr_object = lr_object def get_access_token_by_facebook_access_token(self, fb__access__token): - """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. + """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. Args: fb__access__token: Facebook Access Token @@ -34,7 +34,7 @@ def get_access_token_by_facebook_access_token(self, fb__access__token): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_access_token_by_twitter_access_token(self, tw__access__token, tw__token__secret): - """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. + """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. Args: tw__access__token: Twitter Access Token @@ -60,7 +60,7 @@ def get_access_token_by_twitter_access_token(self, tw__access__token, tw__token_ return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_access_token_by_google_access_token(self, google__access__token, client_id=None, refresh_token=None): - """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. + """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. Args: google__access__token: Google Access Token @@ -108,7 +108,7 @@ def get_access_token_by_google_j_w_t_access_token(self, id__token): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_access_token_by_linkedin_access_token(self, ln__access__token): - """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. + """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. Args: ln__access__token: Linkedin Access Token @@ -129,7 +129,7 @@ def get_access_token_by_linkedin_access_token(self, ln__access__token): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_access_token_by_foursquare_access_token(self, fs__access__token): - """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. + """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. Args: fs__access__token: Foursquare Access Token @@ -150,7 +150,7 @@ def get_access_token_by_foursquare_access_token(self, fs__access__token): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_access_token_by_vkontakte_access_token(self, vk_access_token): - """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. + """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. Args: vk_access_token: Vkontakte Access Token @@ -171,7 +171,7 @@ def get_access_token_by_vkontakte_access_token(self, vk_access_token): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_access_token_by_google_auth_code(self, google_authcode): - """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. + """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. Args: google_authcode: Google AuthCode diff --git a/lib/LoginRadius/api/social/social_api.py b/lib/LoginRadius/api/social/social_api.py index 132a692..9b6550c 100644 --- a/lib/LoginRadius/api/social/social_api.py +++ b/lib/LoginRadius/api/social/social_api.py @@ -1,5 +1,5 @@ # -- coding: utf-8 -- -# Created by LoginRadius Development Team +# Created by LoginRadius Development Team # Copyright 2019 LoginRadius Inc. All rights reserved. # @@ -109,7 +109,7 @@ def get_active_session(self, token): Returns: Response containing Definition for Complete active sessions - 20.11 + 20.11.1 """ if(self._lr_object.is_null_or_whitespace(token)): @@ -131,7 +131,7 @@ def get_active_session_by_account_id(self, account_id): Returns: Response containing Definition for Complete active sessions - 20.12 + 20.11.2 """ if(self._lr_object.is_null_or_whitespace(account_id)): @@ -153,7 +153,7 @@ def get_active_session_by_profile_id(self, profile_id): Returns: Response containing Definition for Complete active sessions - 20.13 + 20.11.3 """ if(self._lr_object.is_null_or_whitespace(profile_id)): @@ -175,7 +175,7 @@ def get_albums(self, access_token): Returns: Response Containing List of Album Data - 22.1 + 22.2.1 """ if(self._lr_object.is_null_or_whitespace(access_token)): @@ -187,15 +187,40 @@ def get_albums(self, access_token): resource_path = "api/v2/album" return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_albums_with_cursor(self, access_token, next_cursor): + """<b>Supported Providers:</b> Facebook, Google, Live, Vkontakte.<br><br> This API returns the photo albums associated with the passed in access tokens Social Profile. + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + next_cursor: Cursor value if not all contacts can be retrieved once. + + Returns: + Response Model containing Albums with next cursor + 22.2.2 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + if(self._lr_object.is_null_or_whitespace(next_cursor)): + raise Exception(self._lr_object.get_validation_message("next_cursor")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["nextCursor"] = next_cursor + + resource_path = "api/v2/album" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_audios(self, access_token): - """The Audio API is used to get audio files data from the user’s social account.<br><br><b>Supported Providers:</b> Live, Vkontakte + """The Audio API is used to get audio files data from the user's social account.<br><br><b>Supported Providers:</b> Live, Vkontakte Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. Returns: Response Containing List of Audio Data - 24.1 + 24.2.1 """ if(self._lr_object.is_null_or_whitespace(access_token)): @@ -207,15 +232,40 @@ def get_audios(self, access_token): resource_path = "api/v2/audio" return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_audios_with_cursor(self, access_token, next_cursor): + """The Audio API is used to get audio files data from the user's social account.<br><br><b>Supported Providers:</b> Live, Vkontakte + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + next_cursor: Cursor value if not all contacts can be retrieved once. + + Returns: + Response Model containing Audio with next cursor + 24.2.2 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + if(self._lr_object.is_null_or_whitespace(next_cursor)): + raise Exception(self._lr_object.get_validation_message("next_cursor")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["nextCursor"] = next_cursor + + resource_path = "api/v2/audio" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_check_ins(self, access_token): - """The Check In API is used to get check Ins data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Vkontakte + """The Check In API is used to get check Ins data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Vkontakte Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. Returns: Response Containing List of CheckIn Data - 25.1 + 25.2.1 """ if(self._lr_object.is_null_or_whitespace(access_token)): @@ -227,8 +277,33 @@ def get_check_ins(self, access_token): resource_path = "api/v2/checkin" return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_check_ins_with_cursor(self, access_token, next_cursor): + """The Check In API is used to get check Ins data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Vkontakte + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + next_cursor: Cursor value if not all contacts can be retrieved once. + + Returns: + Response Model containing Checkins with next cursor + 25.2.2 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + if(self._lr_object.is_null_or_whitespace(next_cursor)): + raise Exception(self._lr_object.get_validation_message("next_cursor")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["nextCursor"] = next_cursor + + resource_path = "api/v2/checkin" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_contacts(self, access_token, next_cursor=''): - """The Contact API is used to get contacts/friends/connections data from the user’s social account.This is one of the APIs that makes up the LoginRadius Friend Invite System. The data will normalized into LoginRadius’ standard data format. This API requires setting permissions in your LoginRadius Dashboard. <br><br><b>Note:</b> Facebook restricts access to the list of friends that is returned. When using the Contacts API with Facebook you will only receive friends that have accepted some permissions with your app. <br><br><b>Supported Providers:</b> Facebook, Foursquare, Google, LinkedIn, Live, Twitter, Vkontakte, Yahoo + """The Contact API is used to get contacts/friends/connections data from the user's social account.This is one of the APIs that makes up the LoginRadius Friend Invite System. The data will normalized into LoginRadius' standard data format. This API requires setting permissions in your LoginRadius Dashboard. <br><br><b>Note:</b> Facebook restricts access to the list of friends that is returned. When using the Contacts API with Facebook you will only receive friends that have accepted some permissions with your app. <br><br><b>Supported Providers:</b> Facebook, Foursquare, Google, LinkedIn, Live, Twitter, Vkontakte, Yahoo Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -251,34 +326,59 @@ def get_contacts(self, access_token, next_cursor=''): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_events(self, access_token): - """The Event API is used to get the event data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Live + """The Event API is used to get the event data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Live Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. Returns: Response Containing List of Events Data - 28.1 + 28.2.1 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + query_parameters = {} + query_parameters["access_token"] = access_token + + resource_path = "api/v2/event" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + + def get_events_with_cursor(self, access_token, next_cursor): + """The Event API is used to get the event data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Live + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + next_cursor: Cursor value if not all contacts can be retrieved once. + + Returns: + Response Model containing Events with next cursor + 28.2.2 """ if(self._lr_object.is_null_or_whitespace(access_token)): raise Exception(self._lr_object.get_validation_message("access_token")) + if(self._lr_object.is_null_or_whitespace(next_cursor)): + raise Exception(self._lr_object.get_validation_message("next_cursor")) + query_parameters = {} query_parameters["access_token"] = access_token + query_parameters["nextCursor"] = next_cursor resource_path = "api/v2/event" return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_followings(self, access_token): - """Get the following user list from the user’s social account.<br><br><b>Supported Providers:</b> Twitter + """Get the following user list from the user's social account.<br><br><b>Supported Providers:</b> Twitter Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. Returns: Response Containing List of Contacts Data - 29.1 + 29.2.1 """ if(self._lr_object.is_null_or_whitespace(access_token)): @@ -290,15 +390,40 @@ def get_followings(self, access_token): resource_path = "api/v2/following" return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_followings_with_cursor(self, access_token, next_cursor): + """Get the following user list from the user's social account.<br><br><b>Supported Providers:</b> Twitter + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + next_cursor: Cursor value if not all contacts can be retrieved once. + + Returns: + Response containing Definition of Contact Data with Cursor + 29.2.2 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + if(self._lr_object.is_null_or_whitespace(next_cursor)): + raise Exception(self._lr_object.get_validation_message("next_cursor")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["nextCursor"] = next_cursor + + resource_path = "api/v2/following" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_groups(self, access_token): - """The Group API is used to get group data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Vkontakte + """The Group API is used to get group data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Vkontakte Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. Returns: Response Containing List of Groups Data - 30.1 + 30.2.1 """ if(self._lr_object.is_null_or_whitespace(access_token)): @@ -310,15 +435,40 @@ def get_groups(self, access_token): resource_path = "api/v2/group" return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_groups_with_cursor(self, access_token, next_cursor): + """The Group API is used to get group data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Vkontakte + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + next_cursor: Cursor value if not all contacts can be retrieved once. + + Returns: + Response Model containing Groups with next cursor + 30.2.2 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + if(self._lr_object.is_null_or_whitespace(next_cursor)): + raise Exception(self._lr_object.get_validation_message("next_cursor")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["nextCursor"] = next_cursor + + resource_path = "api/v2/group" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_likes(self, access_token): - """The Like API is used to get likes data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook + """The Like API is used to get likes data from the user's social account.<br><br><b>Supported Providers:</b> Facebook Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. Returns: Response Containing List of Likes Data - 31.1 + 31.2.1 """ if(self._lr_object.is_null_or_whitespace(access_token)): @@ -330,8 +480,33 @@ def get_likes(self, access_token): resource_path = "api/v2/like" return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_likes_with_cursor(self, access_token, next_cursor): + """The Like API is used to get likes data from the user's social account.<br><br><b>Supported Providers:</b> Facebook + + Args: + access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + next_cursor: Cursor value if not all contacts can be retrieved once. + + Returns: + Response Model containing Likes with next cursor + 31.2.2 + """ + + if(self._lr_object.is_null_or_whitespace(access_token)): + raise Exception(self._lr_object.get_validation_message("access_token")) + + if(self._lr_object.is_null_or_whitespace(next_cursor)): + raise Exception(self._lr_object.get_validation_message("next_cursor")) + + query_parameters = {} + query_parameters["access_token"] = access_token + query_parameters["nextCursor"] = next_cursor + + resource_path = "api/v2/like" + return self._lr_object.execute("GET", resource_path, query_parameters, None) + def get_mentions(self, access_token): - """The Mention API is used to get mentions data from the user’s social account.<br><br><b>Supported Providers:</b> Twitter + """The Mention API is used to get mentions data from the user's social account.<br><br><b>Supported Providers:</b> Twitter Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -352,7 +527,7 @@ def get_mentions(self, access_token): def post_message(self, access_token, message, subject, to): - """Post Message API is used to post messages to the user’s contacts.<br><br><b>Supported Providers:</b> Twitter, LinkedIn <br><br>The Message API is used to post messages to the user’s contacts. This is one of the APIs that makes up the LoginRadius Friend Invite System. After using the Contact API, you can send messages to the retrieved contacts. This API requires setting permissions in your LoginRadius Dashboard.<br><br>GET & POST Message API work the same way except the API method is different + """Post Message API is used to post messages to the user's contacts.<br><br><b>Supported Providers:</b> Twitter, LinkedIn <br><br>The Message API is used to post messages to the user?s contacts. This is one of the APIs that makes up the LoginRadius Friend Invite System. After using the Contact API, you can send messages to the retrieved contacts. This API requires setting permissions in your LoginRadius Dashboard.<br><br>GET & POST Message API work the same way except the API method is different Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -387,7 +562,7 @@ def post_message(self, access_token, message, subject, return self._lr_object.execute("POST", resource_path, query_parameters, None) def get_page(self, access_token, page_name): - """The Page API is used to get the page data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, LinkedIn + """The Page API is used to get the page data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, LinkedIn Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -412,7 +587,7 @@ def get_page(self, access_token, page_name): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_photos(self, access_token, album_id): - """The Photo API is used to get photo data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Google, Live, Vkontakte + """The Photo API is used to get photo data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Google, Live, Vkontakte Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -437,7 +612,7 @@ def get_photos(self, access_token, album_id): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_posts(self, access_token): - """The Post API is used to get post message data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook + """The Post API is used to get post message data from the user's social account.<br><br><b>Supported Providers:</b> Facebook Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -459,7 +634,7 @@ def get_posts(self, access_token): def status_posting(self, access_token, caption, description, imageurl, status, title, url, shorturl='0'): - """The Status API is used to update the status on the user’s wall.<br><br><b>Supported Providers:</b> Facebook, Twitter, LinkedIn + """The Status API is used to update the status on the user's wall.<br><br><b>Supported Providers:</b> Facebook, Twitter, LinkedIn Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -511,28 +686,8 @@ def status_posting(self, access_token, caption, description, resource_path = "api/v2/status" return self._lr_object.execute("POST", resource_path, query_parameters, None) - def get_status(self, access_token): - """The Status API is used to get the status messages from the user’s social account. - - Args: - access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - - Returns: - Response Containing List of Status Data - 37.3 - """ - - if(self._lr_object.is_null_or_whitespace(access_token)): - raise Exception(self._lr_object.get_validation_message("access_token")) - - query_parameters = {} - query_parameters["access_token"] = access_token - - resource_path = "api/v2/status" - return self._lr_object.execute("GET", resource_path, query_parameters, None) - def trackable_status_posting(self, access_token, status_model): - """The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> The Trackable Status API is used to update the status on the user’s wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications.<br><br> POST Input Parameter Format: application/x-www-form-urlencoded + """The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> The Trackable Status API is used to update the status on the user's wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications.<br><br> POST Input Parameter Format: application/x-www-form-urlencoded Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -556,7 +711,7 @@ def trackable_status_posting(self, access_token, status_model): def get_trackable_status_stats(self, access_token, caption, description, imageurl, status, title, url): - """The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> The Trackable Status API is used to update the status on the user’s wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications. + """The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> The Trackable Status API is used to update the status on the user's wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications. Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -627,7 +782,7 @@ def trackable_status_fetching(self, post_id): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_social_user_profile(self, access_token, fields=''): - """The User Profile API is used to get social profile data from the user’s social account after authentication.<br><br><b>Supported Providers:</b> All + """The User Profile API is used to get social profile data from the user's social account after authentication.<br><br><b>Supported Providers:</b> All Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -650,7 +805,7 @@ def get_social_user_profile(self, access_token, fields=''): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_refreshed_social_user_profile(self, access_token, fields=''): - """The User Profile API is used to get the latest updated social profile data from the user’s social account after authentication. The social profile will be retrieved via oAuth and OpenID protocols. The data is normalized into LoginRadius’ standard data format. This API should be called using the access token retrieved from the refresh access token API. + """The User Profile API is used to get the latest updated social profile data from the user's social account after authentication. The social profile will be retrieved via oAuth and OpenID protocols. The data is normalized into LoginRadius' standard data format. This API should be called using the access token retrieved from the refresh access token API. Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. @@ -673,7 +828,7 @@ def get_refreshed_social_user_profile(self, access_token, fields=''): return self._lr_object.execute("GET", resource_path, query_parameters, None) def get_videos(self, access_token, next_cursor): - """The Video API is used to get video files data from the user’s social account.<br><br><b>Supported Providers:</b> Facebook, Google, Live, Vkontakte + """The Video API is used to get video files data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Google, Live, Vkontakte Args: access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication. diff --git a/lib/setup.py b/lib/setup.py index e191afb..dba2130 100755 --- a/lib/setup.py +++ b/lib/setup.py @@ -1,8 +1,8 @@ from distutils.core import setup setup( name = 'LoginRadius', - version='10.0.0-beta', - packages=["LoginRadius"], + version='10.0.0', + packages=["LoginRadius","LoginRadius.api"], description = 'Customer identity and access management for Python.', author='LoginRadius', author_email='developers@loginradius.com',