diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5b5ac0d..3088524 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,12 +1,30 @@
# LoginRadius Python SDK Change Log
+# Version 11.0.0
+Released on **August 11,2020**
+## Enhancements:
+ - Added a parameter isWeb in "RefreshAccessToken" API.
+ - Added a parameter SocialAppName in "getAccessTokenByFacebookAccessToken, getAccessTokenByTwitterAccessToken,
+ getAccessTokenByGoogleAccessToken, getAccessTokenByLinkedinAccessToken, getAccessTokenByAppleIdCode,
+ getAccessTokenByGoogleAuthCode" Native Social login APIs.
+
+## Added new multiple APIs for better user experience:
+ - Added linkSocialIdentites(POST) API.
+ - Added linkSocialIdentitiesByPing(POST) API.
+ - Added getAccessTokenByAppleIdCode API.
+ - Added getAccessTokenByWeChatCode API.
+
+## Removed APIs:
+ - linkSocialIdentity API(PUT)
+ - getSocialIdentity API(GET)
+
# Version 10.0.1
-Release on **Oct 24,2019**
+Released on **Oct 24,2019**
## Enhancements
- Fixed the pip installation issue
# Version 10.0.0
-Release on **September 30,2019**
+Released on **September 30,2019**
## Enhancements
This full version release includes major breaking changes with several improvements and optimizations :
diff --git a/Demo/LoginRadius/api/account/account_api.py b/Demo/LoginRadius/api/account/account_api.py
index 37051c7..5a2cbcf 100644
--- a/Demo/LoginRadius/api/account/account_api.py
+++ b/Demo/LoginRadius/api/account/account_api.py
@@ -477,10 +477,10 @@ def remove_email(self, email, uid, fields=''):
return self._lr_object.execute("DELETE", resource_path, query_parameters, body_parameters)
def refresh_access_token_by_refresh_token(self, refresh__token):
- """This API is used to refresh an access_token via it's associated refresh_token.
+ """This API is used to refresh an access token via it's associated refresh token.
Args:
- refresh__token: LoginRadius refresh_token
+ refresh__token: LoginRadius refresh token
Returns:
Response containing Definition of Complete Token data
@@ -502,7 +502,7 @@ def revoke_refresh_token(self, refresh__token):
"""The Revoke Refresh Access Token API is used to revoke a refresh token or the Provider Access Token, revoking an existing refresh token will invalidate the refresh token but the associated access token will work until the expiry.
Args:
- refresh__token: LoginRadius refresh_token
+ refresh__token: LoginRadius refresh token
Returns:
Response containing Definition of Delete Request
diff --git a/Demo/LoginRadius/api/advanced/customregistrationdata_api.py b/Demo/LoginRadius/api/advanced/customregistrationdata_api.py
index 3a0dc22..c347116 100644
--- a/Demo/LoginRadius/api/advanced/customregistrationdata_api.py
+++ b/Demo/LoginRadius/api/advanced/customregistrationdata_api.py
@@ -102,7 +102,7 @@ def get_registration_data(self, type, limit=None, parent_id=None,
return self._lr_object.execute("GET", resource_path, query_parameters, None)
def add_registration_data(self, registration_data_create_model_list):
- """This API allows you to fill data into a dropdown list which you have created for user Registeration. For more details on how to use this API please see our Custom Registration Data Overview
+ """This API allows you to fill data into a dropdown list which you have created for user Registration. For more details on how to use this API please see our Custom Registration Data Overview
Args:
registration_data_create_model_list: Model Class containing Definition of List of Registration Data
diff --git a/Demo/LoginRadius/api/advanced/multifactorauthentication_api.py b/Demo/LoginRadius/api/advanced/multifactorauthentication_api.py
index f630077..17c8a36 100644
--- a/Demo/LoginRadius/api/advanced/multifactorauthentication_api.py
+++ b/Demo/LoginRadius/api/advanced/multifactorauthentication_api.py
@@ -13,7 +13,7 @@ def __init__(self, lr_object):
self._lr_object = lr_object
def mfa_configure_by_access_token(self, access_token, sms_template2_f_a=None):
- """This API is used to configure the Multi-factor authentication after login by using the access_token when MFA is set as optional on the LoginRadius site.
+ """This API is used to configure the Multi-factor authentication after login by using the access token when MFA is set as optional on the LoginRadius site.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
@@ -126,7 +126,7 @@ def mfa_update_phone_number_by_token(self, access_token, phone_no2_f_a, sms_temp
return self._lr_object.execute("PUT", resource_path, query_parameters, body_parameters)
def mfa_reset_google_auth_by_token(self, access_token, googleauthenticator):
- """This API Resets the Google Authenticator configurations on a given account via the access_token
+ """This API Resets the Google Authenticator configurations on a given account via the access token
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
@@ -151,7 +151,7 @@ def mfa_reset_google_auth_by_token(self, access_token, googleauthenticator):
return self._lr_object.execute("DELETE", resource_path, query_parameters, body_parameters)
def mfa_reset_sms_auth_by_token(self, access_token, otpauthenticator):
- """This API resets the SMS Authenticator configurations on a given account via the access_token.
+ """This API resets the SMS Authenticator configurations on a given account via the access token.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
@@ -176,7 +176,7 @@ def mfa_reset_sms_auth_by_token(self, access_token, otpauthenticator):
return self._lr_object.execute("DELETE", resource_path, query_parameters, body_parameters)
def mfa_backup_code_by_access_token(self, access_token):
- """This API is used to get a set of backup codes via access_token to allow the user login on a site that has Multi-factor Authentication enabled in the event that the user does not have a secondary factor available. We generate 10 codes, each code can only be consumed once. If any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically
+ """This API is used to get a set of backup codes via access token to allow the user login on a site that has Multi-factor Authentication enabled in the event that the user does not have a secondary factor available. We generate 10 codes, each code can only be consumed once. If any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
@@ -197,7 +197,7 @@ def mfa_backup_code_by_access_token(self, access_token):
return self._lr_object.execute("GET", resource_path, query_parameters, None)
def mfa_reset_backup_code_by_access_token(self, access_token):
- """API is used to reset the backup codes on a given account via the access_token. This API call will generate 10 new codes, each code can only be consumed once
+ """API is used to reset the backup codes on a given account via the access token. This API call will generate 10 new codes, each code can only be consumed once
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
@@ -428,7 +428,7 @@ def mfa_validate_google_auth_code(self, google_authenticator_code, second_factor
return self._lr_object.execute("PUT", resource_path, query_parameters, body_parameters)
def mfa_validate_backup_code(self, multi_factor_auth_model_by_backup_code, second_factor_authentication_token, fields=''):
- """This API is used to validate the backup code provided by the user and if valid, we return an access_token allowing the user to login incases where Multi-factor authentication (MFA) is enabled and the secondary factor is unavailable. When a user initially downloads the Backup codes, We generate 10 codes, each code can only be consumed once. if any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically
+ """This API is used to validate the backup code provided by the user and if valid, we return an access token allowing the user to login incases where Multi-factor authentication (MFA) is enabled and the secondary factor is unavailable. When a user initially downloads the Backup codes, We generate 10 codes, each code can only be consumed once. if any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically
Args:
multi_factor_auth_model_by_backup_code: Model Class containing Definition of payload for MultiFactorAuth By BackupCode API
diff --git a/Demo/LoginRadius/api/advanced/reauthentication_api.py b/Demo/LoginRadius/api/advanced/reauthentication_api.py
index 24b8bda..3084fe4 100644
--- a/Demo/LoginRadius/api/advanced/reauthentication_api.py
+++ b/Demo/LoginRadius/api/advanced/reauthentication_api.py
@@ -13,7 +13,7 @@ def __init__(self, lr_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
+ """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.
@@ -61,7 +61,7 @@ def mfa_re_authenticate_by_otp(self, access_token, reauth_by_otp_model):
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
+ """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.
diff --git a/Demo/LoginRadius/api/authentication/authentication_api.py b/Demo/LoginRadius/api/authentication/authentication_api.py
index 1757eb5..4d2249b 100644
--- a/Demo/LoginRadius/api/authentication/authentication_api.py
+++ b/Demo/LoginRadius/api/authentication/authentication_api.py
@@ -122,7 +122,7 @@ def auth_in_validate_access_token(self, access_token, prevent_refresh=False):
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- prevent_refresh: Boolean value that when set as true, in addition of the access_token being invalidated, it will no longer have the capability of being refreshed.
+ prevent_refresh: Boolean value that when set as true, in addition of the access token being invalidated, it will no longer have the capability of being refreshed.
Returns:
Response containing Definition of Complete Validation data
@@ -163,7 +163,7 @@ def get_access_token_info(self, access_token):
return self._lr_object.execute("GET", resource_path, query_parameters, None)
def get_profile_by_access_token(self, access_token, fields=''):
- """This API retrieves a copy of the user data based on the access_token.
+ """This API retrieves a copy of the user data based on the access token.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
@@ -212,7 +212,7 @@ def send_welcome_email(self, access_token, welcome_email_template=None):
def update_profile_by_access_token(self, access_token, user_profile_update_model, email_template=None,
fields='', null_support=None, sms_template=None, verification_url=None):
- """This API is used to update the user's profile by passing the access_token.
+ """This API is used to update the user's profile by passing the access token.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
@@ -299,7 +299,7 @@ def delete_account_by_delete_token(self, deletetoken):
return self._lr_object.execute("GET", resource_path, query_parameters, None)
def unlock_account_by_token(self, access_token, unlock_profile_model):
- """This API is used to allow a customer with a valid access_token to unlock their account provided that they successfully pass the prompted Bot Protection challenges. The Block or Suspend block types are not applicable for this API. For additional details see our Auth Security Configuration documentation.You are only required to pass the Post Parameters that correspond to the prompted challenges.
+ """This API is used to allow a customer with a valid access token to unlock their account provided that they successfully pass the prompted Bot Protection challenges. The Block or Suspend block types are not applicable for this API. For additional details see our Auth Security Configuration documentation.You are only required to pass the Post Parameters that correspond to the prompted challenges.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
@@ -713,90 +713,94 @@ def change_password(self, access_token, new_password, old_password):
resource_path = "identity/v2/auth/password/change"
return self._lr_object.execute("PUT", resource_path, query_parameters, body_parameters)
- def link_social_identities(self, access_token, candidate_token):
- """This API is used to link up a social provider account with the specified account based on the access token and the social providers user access token.
+ def unlink_social_identities(self, access_token, provider, provider_id):
+ """This API is used to unlink up a social provider account with the specified account based on the access token and the social providers user access token. The unlinked account will automatically get removed from your database.
Args:
access_token: Access_Token
- candidate_token: Access token of the account to be linked
+ provider: Name of the provider
+ provider_id: Unique ID of the linked account
Returns:
- Response containing Definition of Complete Validation data
- 12.1
+ Response containing Definition of Delete Request
+ 12.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(candidate_token)):
- raise Exception(self._lr_object.get_validation_message("candidate_token"))
+ if(self._lr_object.is_null_or_whitespace(provider)):
+ raise Exception(self._lr_object.get_validation_message("provider"))
+
+ if(self._lr_object.is_null_or_whitespace(provider_id)):
+ raise Exception(self._lr_object.get_validation_message("provider_id"))
query_parameters = {}
query_parameters["access_token"] = access_token
query_parameters["apiKey"] = self._lr_object.get_api_key()
body_parameters = {}
- body_parameters["candidateToken"] = candidate_token
+ body_parameters["provider"] = provider
+ body_parameters["providerId"] = provider_id
resource_path = "identity/v2/auth/socialidentity"
- return self._lr_object.execute("PUT", resource_path, query_parameters, body_parameters)
+ return self._lr_object.execute("DELETE", resource_path, query_parameters, body_parameters)
- def unlink_social_identities(self, access_token, provider, provider_id):
- """This API is used to unlink up a social provider account with the specified account based on the access token and the social providers user access token. The unlinked account will automatically get removed from your database.
+ def link_social_identities(self, access_token, candidate_token):
+ """This API is used to link up a social provider account with an existing LoginRadius account on the basis of access token and the social providers user access token.
Args:
- access_token: Access_Token
- provider: Name of the provider
- provider_id: Unique ID of the linked account
+ access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ candidate_token: Access token of the account to be linked
Returns:
- Response containing Definition of Delete Request
- 12.2
+ Response containing Definition of Complete Validation data
+ 12.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(provider)):
- raise Exception(self._lr_object.get_validation_message("provider"))
-
- if(self._lr_object.is_null_or_whitespace(provider_id)):
- raise Exception(self._lr_object.get_validation_message("provider_id"))
+ if(self._lr_object.is_null_or_whitespace(candidate_token)):
+ raise Exception(self._lr_object.get_validation_message("candidate_token"))
query_parameters = {}
query_parameters["access_token"] = access_token
query_parameters["apiKey"] = self._lr_object.get_api_key()
body_parameters = {}
- body_parameters["provider"] = provider
- body_parameters["providerId"] = provider_id
+ body_parameters["candidateToken"] = candidate_token
resource_path = "identity/v2/auth/socialidentity"
- return self._lr_object.execute("DELETE", resource_path, query_parameters, body_parameters)
+ return self._lr_object.execute("POST", resource_path, query_parameters, body_parameters)
- def get_social_identity(self, access_token, fields=''):
- """This API is called just after account linking API and it prevents the raas profile of the second account from getting created.
+ def link_social_identities_by_ping(self, access_token, client_guid):
+ """This API is used to link up a social provider account with an existing LoginRadius account on the basis of ping and the social providers user access token.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- fields: The fields parameter filters the API response so that the response only includes a specific set of fields
+ client_guid: Unique ID generated by client
Returns:
- Response containing Definition for Complete SocialUserProfile data
- 12.3
+ Response containing Definition of Complete Validation data
+ 12.5
"""
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(client_guid)):
+ raise Exception(self._lr_object.get_validation_message("client_guid"))
+
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(fields)):
- query_parameters["fields"] = fields
+
+ body_parameters = {}
+ body_parameters["clientGuid"] = client_guid
resource_path = "identity/v2/auth/socialidentity"
- return self._lr_object.execute("GET", resource_path, query_parameters, None)
+ return self._lr_object.execute("POST", resource_path, query_parameters, body_parameters)
def set_or_change_user_name(self, access_token, username):
"""This API is used to set or change UserName by access token.
@@ -848,7 +852,7 @@ def check_user_name_availability(self, username):
return self._lr_object.execute("GET", resource_path, query_parameters, None)
def accept_privacy_policy(self, access_token, fields=''):
- """This API is used to update the privacy policy stored in the user's profile by providing the access_token of the user accepting the privacy policy
+ """This API is used to update the privacy policy stored in the user's profile by providing the access token of the user accepting the privacy policy
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
@@ -872,7 +876,7 @@ def accept_privacy_policy(self, access_token, fields=''):
return self._lr_object.execute("GET", resource_path, query_parameters, None)
def get_privacy_policy_history_by_access_token(self, access_token):
- """This API will return all the accepted privacy policies for the user by providing the access_token of that user.
+ """This API will return all the accepted privacy policies for the user by providing the access token of that user.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
diff --git a/Demo/LoginRadius/api/authentication/phoneauthentication_api.py b/Demo/LoginRadius/api/authentication/phoneauthentication_api.py
index b85706a..4852a93 100644
--- a/Demo/LoginRadius/api/authentication/phoneauthentication_api.py
+++ b/Demo/LoginRadius/api/authentication/phoneauthentication_api.py
@@ -260,7 +260,7 @@ def check_phone_number_availability(self, phone):
return self._lr_object.execute("GET", resource_path, query_parameters, None)
def remove_phone_id_by_access_token(self, access_token):
- """This API is used to delete the Phone ID on a user's account via the access_token
+ """This API is used to delete the Phone ID on a user's account via the access token
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
diff --git a/Demo/LoginRadius/api/authentication/pinauthentication_api.py b/Demo/LoginRadius/api/authentication/pinauthentication_api.py
index 5042fd5..9db77f4 100644
--- a/Demo/LoginRadius/api/authentication/pinauthentication_api.py
+++ b/Demo/LoginRadius/api/authentication/pinauthentication_api.py
@@ -13,7 +13,7 @@ def __init__(self, lr_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.
+ """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
diff --git a/Demo/LoginRadius/api/social/nativesocial_api.py b/Demo/LoginRadius/api/social/nativesocial_api.py
index 395d05a..7a05612 100644
--- a/Demo/LoginRadius/api/social/nativesocial_api.py
+++ b/Demo/LoginRadius/api/social/nativesocial_api.py
@@ -12,11 +12,12 @@ def __init__(self, lr_object):
"""
self._lr_object = lr_object
- def get_access_token_by_facebook_access_token(self, fb__access__token):
+ def get_access_token_by_facebook_access_token(self, fb__access__token, social_app_name=None):
"""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
+ social_app_name: Name of Social provider APP
Returns:
Response containing Definition of Complete Token data
@@ -29,16 +30,19 @@ def get_access_token_by_facebook_access_token(self, fb__access__token):
query_parameters = {}
query_parameters["fb_Access_Token"] = fb__access__token
query_parameters["key"] = self._lr_object.get_api_key()
+ if(not self._lr_object.is_null_or_whitespace(social_app_name)):
+ query_parameters["socialAppName"] = social_app_name
resource_path = "api/v2/access_token/facebook"
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):
+ def get_access_token_by_twitter_access_token(self, tw__access__token, tw__token__secret, social_app_name=None):
"""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
tw__token__secret: Twitter Token Secret
+ social_app_name: Name of Social provider APP
Returns:
Response containing Definition of Complete Token data
@@ -55,17 +59,21 @@ def get_access_token_by_twitter_access_token(self, tw__access__token, tw__token_
query_parameters["key"] = self._lr_object.get_api_key()
query_parameters["tw_Access_Token"] = tw__access__token
query_parameters["tw_Token_Secret"] = tw__token__secret
+ if(not self._lr_object.is_null_or_whitespace(social_app_name)):
+ query_parameters["socialAppName"] = social_app_name
resource_path = "api/v2/access_token/twitter"
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):
+ def get_access_token_by_google_access_token(self, google__access__token, client_id=None, refresh_token=None,
+ social_app_name=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.
Args:
google__access__token: Google Access Token
client_id: Google Client ID
- refresh_token: LoginRadius refresh_token
+ refresh_token: LoginRadius refresh token
+ social_app_name: Name of Social provider APP
Returns:
Response containing Definition of Complete Token data
@@ -82,6 +90,8 @@ def get_access_token_by_google_access_token(self, google__access__token, client_
query_parameters["client_id"] = client_id
if(not self._lr_object.is_null_or_whitespace(refresh_token)):
query_parameters["refresh_token"] = refresh_token
+ if(not self._lr_object.is_null_or_whitespace(social_app_name)):
+ query_parameters["socialAppName"] = social_app_name
resource_path = "api/v2/access_token/google"
return self._lr_object.execute("GET", resource_path, query_parameters, None)
@@ -107,11 +117,12 @@ def get_access_token_by_google_j_w_t_access_token(self, id__token):
resource_path = "api/v2/access_token/googlejwt"
return self._lr_object.execute("GET", resource_path, query_parameters, None)
- def get_access_token_by_linkedin_access_token(self, ln__access__token):
+ def get_access_token_by_linkedin_access_token(self, ln__access__token, social_app_name=None):
"""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
+ social_app_name: Name of Social provider APP
Returns:
Response containing Definition of Complete Token data
@@ -124,6 +135,8 @@ def get_access_token_by_linkedin_access_token(self, ln__access__token):
query_parameters = {}
query_parameters["key"] = self._lr_object.get_api_key()
query_parameters["ln_Access_Token"] = ln__access__token
+ if(not self._lr_object.is_null_or_whitespace(social_app_name)):
+ query_parameters["socialAppName"] = social_app_name
resource_path = "api/v2/access_token/linkedin"
return self._lr_object.execute("GET", resource_path, query_parameters, None)
@@ -149,6 +162,51 @@ def get_access_token_by_foursquare_access_token(self, fs__access__token):
resource_path = "api/v2/access_token/foursquare"
return self._lr_object.execute("GET", resource_path, query_parameters, None)
+ def get_access_token_by_apple_id_code(self, code, social_app_name=None):
+ """The API is used to get LoginRadius access token by sending a valid Apple ID OAuth Code. It will be valid for the specific duration of time specified in the response.
+
+ Args:
+ code: Apple Code
+ social_app_name: Name of Social provider APP
+
+ Returns:
+ Response containing Definition of Complete Token data
+ 20.12
+ """
+
+ if(self._lr_object.is_null_or_whitespace(code)):
+ raise Exception(self._lr_object.get_validation_message("code"))
+
+ query_parameters = {}
+ query_parameters["code"] = code
+ query_parameters["key"] = self._lr_object.get_api_key()
+ if(not self._lr_object.is_null_or_whitespace(social_app_name)):
+ query_parameters["socialAppName"] = social_app_name
+
+ resource_path = "api/v2/access_token/apple"
+ return self._lr_object.execute("GET", resource_path, query_parameters, None)
+
+ def get_access_token_by_we_chat_code(self, code):
+ """This API is used to retrieve a LoginRadius access token by passing in a valid WeChat OAuth Code.
+
+ Args:
+ code: WeChat Code
+
+ Returns:
+ Response containing Definition of Complete Token data
+ 20.13
+ """
+
+ if(self._lr_object.is_null_or_whitespace(code)):
+ raise Exception(self._lr_object.get_validation_message("code"))
+
+ query_parameters = {}
+ query_parameters["code"] = code
+ query_parameters["key"] = self._lr_object.get_api_key()
+
+ resource_path = "api/v2/access_token/wechat"
+ 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.
@@ -170,11 +228,12 @@ def get_access_token_by_vkontakte_access_token(self, vk_access_token):
resource_path = "api/v2/access_token/vkontakte"
return self._lr_object.execute("GET", resource_path, query_parameters, None)
- def get_access_token_by_google_auth_code(self, google_authcode):
+ def get_access_token_by_google_auth_code(self, google_authcode, social_app_name=None):
"""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
+ social_app_name: Name of Social provider APP
Returns:
Response containing Definition of Complete Token data
@@ -187,6 +246,8 @@ def get_access_token_by_google_auth_code(self, google_authcode):
query_parameters = {}
query_parameters["apiKey"] = self._lr_object.get_api_key()
query_parameters["google_authcode"] = google_authcode
+ if(not self._lr_object.is_null_or_whitespace(social_app_name)):
+ query_parameters["socialAppName"] = social_app_name
resource_path = "api/v2/access_token/google"
return self._lr_object.execute("GET", resource_path, query_parameters, None)
diff --git a/Demo/LoginRadius/api/social/social_api.py b/Demo/LoginRadius/api/social/social_api.py
index 9b6550c..ea8a9c8 100644
--- a/Demo/LoginRadius/api/social/social_api.py
+++ b/Demo/LoginRadius/api/social/social_api.py
@@ -33,12 +33,13 @@ def exchange_access_token(self, token):
resource_path = "api/v2/access_token"
return self._lr_object.execute("GET", resource_path, query_parameters, None)
- def refresh_access_token(self, access_token, expires_in=0):
+ def refresh_access_token(self, access_token, expires_in=0, is_web=False):
"""The Refresh Access Token API is used to refresh the provider access token after authentication. It will be valid for up to 60 days on LoginRadius depending on the provider. In order to use the access token in other APIs, always refresh the token using this API.
Supported Providers : Facebook,Yahoo,Google,Twitter, Linkedin.
Contact LoginRadius support team to enable this API.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- expires_in: Allows you to specify a desired expiration time in minutes for the newly issued access_token.
+ expires_in: Allows you to specify a desired expiration time in minutes for the newly issued access token.
+ is_web: Is web or not.
Returns:
Response containing Definition of Complete Token data
@@ -53,6 +54,8 @@ def refresh_access_token(self, access_token, expires_in=0):
query_parameters["secret"] = self._lr_object.get_api_secret()
if(expires_in is not None):
query_parameters["expiresIn"] = expires_in
+ if(is_web is not None):
+ query_parameters["isWeb"] = is_web
resource_path = "api/v2/access_token/refresh"
return self._lr_object.execute("GET", resource_path, query_parameters, None)
diff --git a/README.md b/README.md
index 995d9a4..545ef13 100755
--- a/README.md
+++ b/README.md
@@ -29,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.1
+ pip install loginradius-v2==11.0.0
```
or with easy_install
```
- easy_install loginradius-v2==10.0.1
+ easy_install loginradius-v2==11.0.0
```
### Install From Source
@@ -104,13 +104,14 @@ List of APIs in this Section:
* PUT : [Auth Reset Password by OTP](#ResetPasswordByEmailOTP-put-)
* PUT : [Auth Reset Password by OTP and UserName](#ResetPasswordByOTPAndUserName-put-)
* PUT : [Auth Change Password](#ChangePassword-put-)
-* PUT : [Auth Link Social Identities](#LinkSocialIdentities-put-)
* PUT : [Auth Set or Change UserName](#SetOrChangeUserName-put-)
* PUT : [Auth Resend Email Verification](#AuthResendEmailVerification-put-)
* POST : [Auth Add Email](#AddEmail-post-)
* POST : [Auth Login by Email](#LoginByEmail-post-)
* POST : [Auth Login by Username](#LoginByUserName-post-)
* POST : [Auth Forgot Password](#ForgotPassword-post-)
+* POST : [Auth Link Social Identities](#LinkSocialIdentities-post-)
+* POST : [Auth Link Social Identities By Ping](#LinkSocialIdentitiesByPing-post-)
* POST : [Auth User Registration by Email](#UserRegistrationByEmail-post-)
* POST : [Auth User Registration By Captcha](#UserRegistrationByCaptcha-post-)
* GET : [Get Security Questions By Email](#GetSecurityQuestionsByEmail-get-)
@@ -125,7 +126,6 @@ List of APIs in this Section:
* GET : [Auth Delete Account](#DeleteAccountByDeleteToken-get-)
* GET : [Auth Check Email Availability](#CheckEmailAvailability-get-)
* GET : [Auth Verify Email](#VerifyEmail-get-)
-* GET : [Auth Social Identity](#GetSocialIdentity-get-)
* GET : [Auth Check UserName Availability](#CheckUserNameAvailability-get-)
* GET : [Auth Privacy Policy Accept](#AcceptPrivacyPolicy-get-)
* GET : [Auth Privacy Policy History By Access Token](#GetPrivacyPolicyHistoryByAccessToken-get-)
@@ -137,7 +137,7 @@ List of APIs in this Section:
" #Required
+social_app_name = "" #Optional
+
+result = loginradius.native_social.get_access_token_by_apple_id_code(code, social_app_name)
+ ```
+
+
+
+
+ Access Token via WeChat Code (GET)
+ This API is used to retrieve a LoginRadius access token by passing in a valid WeChat OAuth Code. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-wechat-code)
+
+ ```
+
+code = "" #Required
+
+result = loginradius.native_social.get_access_token_by_we_chat_code(code)
+ ```
+
+
+
+
Access Token via Vkontakte Token (GET)
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)
@@ -3815,9 +3832,10 @@ result = loginradius.native_social.get_access_token_by_vkontakte_access_token(vk
```
-google_authcode = "" #Required
+google_authcode = "" #Required
+social_app_name = "" #Optional
-result = 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, social_app_name)
```
diff --git a/demo/LoginRadius/__init__.py b/demo/LoginRadius/__init__.py
index fc43142..c422d23 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.1"
+__version__ = "11.0.0"
import json
import sys
diff --git a/lib/LoginRadius/__init__.py b/lib/LoginRadius/__init__.py
index fc43142..c422d23 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.1"
+__version__ = "11.0.0"
import json
import sys
diff --git a/lib/LoginRadius/api/account/account_api.py b/lib/LoginRadius/api/account/account_api.py
index 37051c7..5a2cbcf 100644
--- a/lib/LoginRadius/api/account/account_api.py
+++ b/lib/LoginRadius/api/account/account_api.py
@@ -477,10 +477,10 @@ def remove_email(self, email, uid, fields=''):
return self._lr_object.execute("DELETE", resource_path, query_parameters, body_parameters)
def refresh_access_token_by_refresh_token(self, refresh__token):
- """This API is used to refresh an access_token via it's associated refresh_token.
+ """This API is used to refresh an access token via it's associated refresh token.
Args:
- refresh__token: LoginRadius refresh_token
+ refresh__token: LoginRadius refresh token
Returns:
Response containing Definition of Complete Token data
@@ -502,7 +502,7 @@ def revoke_refresh_token(self, refresh__token):
"""The Revoke Refresh Access Token API is used to revoke a refresh token or the Provider Access Token, revoking an existing refresh token will invalidate the refresh token but the associated access token will work until the expiry.
Args:
- refresh__token: LoginRadius refresh_token
+ refresh__token: LoginRadius refresh token
Returns:
Response containing Definition of Delete Request
diff --git a/lib/LoginRadius/api/advanced/customregistrationdata_api.py b/lib/LoginRadius/api/advanced/customregistrationdata_api.py
index 3a0dc22..c347116 100644
--- a/lib/LoginRadius/api/advanced/customregistrationdata_api.py
+++ b/lib/LoginRadius/api/advanced/customregistrationdata_api.py
@@ -102,7 +102,7 @@ def get_registration_data(self, type, limit=None, parent_id=None,
return self._lr_object.execute("GET", resource_path, query_parameters, None)
def add_registration_data(self, registration_data_create_model_list):
- """This API allows you to fill data into a dropdown list which you have created for user Registeration. For more details on how to use this API please see our Custom Registration Data Overview
+ """This API allows you to fill data into a dropdown list which you have created for user Registration. For more details on how to use this API please see our Custom Registration Data Overview
Args:
registration_data_create_model_list: Model Class containing Definition of List of Registration Data
diff --git a/lib/LoginRadius/api/advanced/multifactorauthentication_api.py b/lib/LoginRadius/api/advanced/multifactorauthentication_api.py
index f630077..17c8a36 100644
--- a/lib/LoginRadius/api/advanced/multifactorauthentication_api.py
+++ b/lib/LoginRadius/api/advanced/multifactorauthentication_api.py
@@ -13,7 +13,7 @@ def __init__(self, lr_object):
self._lr_object = lr_object
def mfa_configure_by_access_token(self, access_token, sms_template2_f_a=None):
- """This API is used to configure the Multi-factor authentication after login by using the access_token when MFA is set as optional on the LoginRadius site.
+ """This API is used to configure the Multi-factor authentication after login by using the access token when MFA is set as optional on the LoginRadius site.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
@@ -126,7 +126,7 @@ def mfa_update_phone_number_by_token(self, access_token, phone_no2_f_a, sms_temp
return self._lr_object.execute("PUT", resource_path, query_parameters, body_parameters)
def mfa_reset_google_auth_by_token(self, access_token, googleauthenticator):
- """This API Resets the Google Authenticator configurations on a given account via the access_token
+ """This API Resets the Google Authenticator configurations on a given account via the access token
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
@@ -151,7 +151,7 @@ def mfa_reset_google_auth_by_token(self, access_token, googleauthenticator):
return self._lr_object.execute("DELETE", resource_path, query_parameters, body_parameters)
def mfa_reset_sms_auth_by_token(self, access_token, otpauthenticator):
- """This API resets the SMS Authenticator configurations on a given account via the access_token.
+ """This API resets the SMS Authenticator configurations on a given account via the access token.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
@@ -176,7 +176,7 @@ def mfa_reset_sms_auth_by_token(self, access_token, otpauthenticator):
return self._lr_object.execute("DELETE", resource_path, query_parameters, body_parameters)
def mfa_backup_code_by_access_token(self, access_token):
- """This API is used to get a set of backup codes via access_token to allow the user login on a site that has Multi-factor Authentication enabled in the event that the user does not have a secondary factor available. We generate 10 codes, each code can only be consumed once. If any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically
+ """This API is used to get a set of backup codes via access token to allow the user login on a site that has Multi-factor Authentication enabled in the event that the user does not have a secondary factor available. We generate 10 codes, each code can only be consumed once. If any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
@@ -197,7 +197,7 @@ def mfa_backup_code_by_access_token(self, access_token):
return self._lr_object.execute("GET", resource_path, query_parameters, None)
def mfa_reset_backup_code_by_access_token(self, access_token):
- """API is used to reset the backup codes on a given account via the access_token. This API call will generate 10 new codes, each code can only be consumed once
+ """API is used to reset the backup codes on a given account via the access token. This API call will generate 10 new codes, each code can only be consumed once
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
@@ -428,7 +428,7 @@ def mfa_validate_google_auth_code(self, google_authenticator_code, second_factor
return self._lr_object.execute("PUT", resource_path, query_parameters, body_parameters)
def mfa_validate_backup_code(self, multi_factor_auth_model_by_backup_code, second_factor_authentication_token, fields=''):
- """This API is used to validate the backup code provided by the user and if valid, we return an access_token allowing the user to login incases where Multi-factor authentication (MFA) is enabled and the secondary factor is unavailable. When a user initially downloads the Backup codes, We generate 10 codes, each code can only be consumed once. if any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically
+ """This API is used to validate the backup code provided by the user and if valid, we return an access token allowing the user to login incases where Multi-factor authentication (MFA) is enabled and the secondary factor is unavailable. When a user initially downloads the Backup codes, We generate 10 codes, each code can only be consumed once. if any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically
Args:
multi_factor_auth_model_by_backup_code: Model Class containing Definition of payload for MultiFactorAuth By BackupCode API
diff --git a/lib/LoginRadius/api/advanced/reauthentication_api.py b/lib/LoginRadius/api/advanced/reauthentication_api.py
index 24b8bda..3084fe4 100644
--- a/lib/LoginRadius/api/advanced/reauthentication_api.py
+++ b/lib/LoginRadius/api/advanced/reauthentication_api.py
@@ -13,7 +13,7 @@ def __init__(self, lr_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
+ """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.
@@ -61,7 +61,7 @@ def mfa_re_authenticate_by_otp(self, access_token, reauth_by_otp_model):
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
+ """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.
diff --git a/lib/LoginRadius/api/authentication/authentication_api.py b/lib/LoginRadius/api/authentication/authentication_api.py
index 1757eb5..4d2249b 100644
--- a/lib/LoginRadius/api/authentication/authentication_api.py
+++ b/lib/LoginRadius/api/authentication/authentication_api.py
@@ -122,7 +122,7 @@ def auth_in_validate_access_token(self, access_token, prevent_refresh=False):
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- prevent_refresh: Boolean value that when set as true, in addition of the access_token being invalidated, it will no longer have the capability of being refreshed.
+ prevent_refresh: Boolean value that when set as true, in addition of the access token being invalidated, it will no longer have the capability of being refreshed.
Returns:
Response containing Definition of Complete Validation data
@@ -163,7 +163,7 @@ def get_access_token_info(self, access_token):
return self._lr_object.execute("GET", resource_path, query_parameters, None)
def get_profile_by_access_token(self, access_token, fields=''):
- """This API retrieves a copy of the user data based on the access_token.
+ """This API retrieves a copy of the user data based on the access token.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
@@ -212,7 +212,7 @@ def send_welcome_email(self, access_token, welcome_email_template=None):
def update_profile_by_access_token(self, access_token, user_profile_update_model, email_template=None,
fields='', null_support=None, sms_template=None, verification_url=None):
- """This API is used to update the user's profile by passing the access_token.
+ """This API is used to update the user's profile by passing the access token.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
@@ -299,7 +299,7 @@ def delete_account_by_delete_token(self, deletetoken):
return self._lr_object.execute("GET", resource_path, query_parameters, None)
def unlock_account_by_token(self, access_token, unlock_profile_model):
- """This API is used to allow a customer with a valid access_token to unlock their account provided that they successfully pass the prompted Bot Protection challenges. The Block or Suspend block types are not applicable for this API. For additional details see our Auth Security Configuration documentation.You are only required to pass the Post Parameters that correspond to the prompted challenges.
+ """This API is used to allow a customer with a valid access token to unlock their account provided that they successfully pass the prompted Bot Protection challenges. The Block or Suspend block types are not applicable for this API. For additional details see our Auth Security Configuration documentation.You are only required to pass the Post Parameters that correspond to the prompted challenges.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
@@ -713,90 +713,94 @@ def change_password(self, access_token, new_password, old_password):
resource_path = "identity/v2/auth/password/change"
return self._lr_object.execute("PUT", resource_path, query_parameters, body_parameters)
- def link_social_identities(self, access_token, candidate_token):
- """This API is used to link up a social provider account with the specified account based on the access token and the social providers user access token.
+ def unlink_social_identities(self, access_token, provider, provider_id):
+ """This API is used to unlink up a social provider account with the specified account based on the access token and the social providers user access token. The unlinked account will automatically get removed from your database.
Args:
access_token: Access_Token
- candidate_token: Access token of the account to be linked
+ provider: Name of the provider
+ provider_id: Unique ID of the linked account
Returns:
- Response containing Definition of Complete Validation data
- 12.1
+ Response containing Definition of Delete Request
+ 12.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(candidate_token)):
- raise Exception(self._lr_object.get_validation_message("candidate_token"))
+ if(self._lr_object.is_null_or_whitespace(provider)):
+ raise Exception(self._lr_object.get_validation_message("provider"))
+
+ if(self._lr_object.is_null_or_whitespace(provider_id)):
+ raise Exception(self._lr_object.get_validation_message("provider_id"))
query_parameters = {}
query_parameters["access_token"] = access_token
query_parameters["apiKey"] = self._lr_object.get_api_key()
body_parameters = {}
- body_parameters["candidateToken"] = candidate_token
+ body_parameters["provider"] = provider
+ body_parameters["providerId"] = provider_id
resource_path = "identity/v2/auth/socialidentity"
- return self._lr_object.execute("PUT", resource_path, query_parameters, body_parameters)
+ return self._lr_object.execute("DELETE", resource_path, query_parameters, body_parameters)
- def unlink_social_identities(self, access_token, provider, provider_id):
- """This API is used to unlink up a social provider account with the specified account based on the access token and the social providers user access token. The unlinked account will automatically get removed from your database.
+ def link_social_identities(self, access_token, candidate_token):
+ """This API is used to link up a social provider account with an existing LoginRadius account on the basis of access token and the social providers user access token.
Args:
- access_token: Access_Token
- provider: Name of the provider
- provider_id: Unique ID of the linked account
+ access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
+ candidate_token: Access token of the account to be linked
Returns:
- Response containing Definition of Delete Request
- 12.2
+ Response containing Definition of Complete Validation data
+ 12.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(provider)):
- raise Exception(self._lr_object.get_validation_message("provider"))
-
- if(self._lr_object.is_null_or_whitespace(provider_id)):
- raise Exception(self._lr_object.get_validation_message("provider_id"))
+ if(self._lr_object.is_null_or_whitespace(candidate_token)):
+ raise Exception(self._lr_object.get_validation_message("candidate_token"))
query_parameters = {}
query_parameters["access_token"] = access_token
query_parameters["apiKey"] = self._lr_object.get_api_key()
body_parameters = {}
- body_parameters["provider"] = provider
- body_parameters["providerId"] = provider_id
+ body_parameters["candidateToken"] = candidate_token
resource_path = "identity/v2/auth/socialidentity"
- return self._lr_object.execute("DELETE", resource_path, query_parameters, body_parameters)
+ return self._lr_object.execute("POST", resource_path, query_parameters, body_parameters)
- def get_social_identity(self, access_token, fields=''):
- """This API is called just after account linking API and it prevents the raas profile of the second account from getting created.
+ def link_social_identities_by_ping(self, access_token, client_guid):
+ """This API is used to link up a social provider account with an existing LoginRadius account on the basis of ping and the social providers user access token.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- fields: The fields parameter filters the API response so that the response only includes a specific set of fields
+ client_guid: Unique ID generated by client
Returns:
- Response containing Definition for Complete SocialUserProfile data
- 12.3
+ Response containing Definition of Complete Validation data
+ 12.5
"""
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(client_guid)):
+ raise Exception(self._lr_object.get_validation_message("client_guid"))
+
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(fields)):
- query_parameters["fields"] = fields
+
+ body_parameters = {}
+ body_parameters["clientGuid"] = client_guid
resource_path = "identity/v2/auth/socialidentity"
- return self._lr_object.execute("GET", resource_path, query_parameters, None)
+ return self._lr_object.execute("POST", resource_path, query_parameters, body_parameters)
def set_or_change_user_name(self, access_token, username):
"""This API is used to set or change UserName by access token.
@@ -848,7 +852,7 @@ def check_user_name_availability(self, username):
return self._lr_object.execute("GET", resource_path, query_parameters, None)
def accept_privacy_policy(self, access_token, fields=''):
- """This API is used to update the privacy policy stored in the user's profile by providing the access_token of the user accepting the privacy policy
+ """This API is used to update the privacy policy stored in the user's profile by providing the access token of the user accepting the privacy policy
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
@@ -872,7 +876,7 @@ def accept_privacy_policy(self, access_token, fields=''):
return self._lr_object.execute("GET", resource_path, query_parameters, None)
def get_privacy_policy_history_by_access_token(self, access_token):
- """This API will return all the accepted privacy policies for the user by providing the access_token of that user.
+ """This API will return all the accepted privacy policies for the user by providing the access token of that user.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
diff --git a/lib/LoginRadius/api/authentication/phoneauthentication_api.py b/lib/LoginRadius/api/authentication/phoneauthentication_api.py
index b85706a..4852a93 100644
--- a/lib/LoginRadius/api/authentication/phoneauthentication_api.py
+++ b/lib/LoginRadius/api/authentication/phoneauthentication_api.py
@@ -260,7 +260,7 @@ def check_phone_number_availability(self, phone):
return self._lr_object.execute("GET", resource_path, query_parameters, None)
def remove_phone_id_by_access_token(self, access_token):
- """This API is used to delete the Phone ID on a user's account via the access_token
+ """This API is used to delete the Phone ID on a user's account via the access token
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
diff --git a/lib/LoginRadius/api/authentication/pinauthentication_api.py b/lib/LoginRadius/api/authentication/pinauthentication_api.py
index 5042fd5..9db77f4 100644
--- a/lib/LoginRadius/api/authentication/pinauthentication_api.py
+++ b/lib/LoginRadius/api/authentication/pinauthentication_api.py
@@ -13,7 +13,7 @@ def __init__(self, lr_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.
+ """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
diff --git a/lib/LoginRadius/api/social/nativesocial_api.py b/lib/LoginRadius/api/social/nativesocial_api.py
index 395d05a..7a05612 100644
--- a/lib/LoginRadius/api/social/nativesocial_api.py
+++ b/lib/LoginRadius/api/social/nativesocial_api.py
@@ -12,11 +12,12 @@ def __init__(self, lr_object):
"""
self._lr_object = lr_object
- def get_access_token_by_facebook_access_token(self, fb__access__token):
+ def get_access_token_by_facebook_access_token(self, fb__access__token, social_app_name=None):
"""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
+ social_app_name: Name of Social provider APP
Returns:
Response containing Definition of Complete Token data
@@ -29,16 +30,19 @@ def get_access_token_by_facebook_access_token(self, fb__access__token):
query_parameters = {}
query_parameters["fb_Access_Token"] = fb__access__token
query_parameters["key"] = self._lr_object.get_api_key()
+ if(not self._lr_object.is_null_or_whitespace(social_app_name)):
+ query_parameters["socialAppName"] = social_app_name
resource_path = "api/v2/access_token/facebook"
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):
+ def get_access_token_by_twitter_access_token(self, tw__access__token, tw__token__secret, social_app_name=None):
"""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
tw__token__secret: Twitter Token Secret
+ social_app_name: Name of Social provider APP
Returns:
Response containing Definition of Complete Token data
@@ -55,17 +59,21 @@ def get_access_token_by_twitter_access_token(self, tw__access__token, tw__token_
query_parameters["key"] = self._lr_object.get_api_key()
query_parameters["tw_Access_Token"] = tw__access__token
query_parameters["tw_Token_Secret"] = tw__token__secret
+ if(not self._lr_object.is_null_or_whitespace(social_app_name)):
+ query_parameters["socialAppName"] = social_app_name
resource_path = "api/v2/access_token/twitter"
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):
+ def get_access_token_by_google_access_token(self, google__access__token, client_id=None, refresh_token=None,
+ social_app_name=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.
Args:
google__access__token: Google Access Token
client_id: Google Client ID
- refresh_token: LoginRadius refresh_token
+ refresh_token: LoginRadius refresh token
+ social_app_name: Name of Social provider APP
Returns:
Response containing Definition of Complete Token data
@@ -82,6 +90,8 @@ def get_access_token_by_google_access_token(self, google__access__token, client_
query_parameters["client_id"] = client_id
if(not self._lr_object.is_null_or_whitespace(refresh_token)):
query_parameters["refresh_token"] = refresh_token
+ if(not self._lr_object.is_null_or_whitespace(social_app_name)):
+ query_parameters["socialAppName"] = social_app_name
resource_path = "api/v2/access_token/google"
return self._lr_object.execute("GET", resource_path, query_parameters, None)
@@ -107,11 +117,12 @@ def get_access_token_by_google_j_w_t_access_token(self, id__token):
resource_path = "api/v2/access_token/googlejwt"
return self._lr_object.execute("GET", resource_path, query_parameters, None)
- def get_access_token_by_linkedin_access_token(self, ln__access__token):
+ def get_access_token_by_linkedin_access_token(self, ln__access__token, social_app_name=None):
"""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
+ social_app_name: Name of Social provider APP
Returns:
Response containing Definition of Complete Token data
@@ -124,6 +135,8 @@ def get_access_token_by_linkedin_access_token(self, ln__access__token):
query_parameters = {}
query_parameters["key"] = self._lr_object.get_api_key()
query_parameters["ln_Access_Token"] = ln__access__token
+ if(not self._lr_object.is_null_or_whitespace(social_app_name)):
+ query_parameters["socialAppName"] = social_app_name
resource_path = "api/v2/access_token/linkedin"
return self._lr_object.execute("GET", resource_path, query_parameters, None)
@@ -149,6 +162,51 @@ def get_access_token_by_foursquare_access_token(self, fs__access__token):
resource_path = "api/v2/access_token/foursquare"
return self._lr_object.execute("GET", resource_path, query_parameters, None)
+ def get_access_token_by_apple_id_code(self, code, social_app_name=None):
+ """The API is used to get LoginRadius access token by sending a valid Apple ID OAuth Code. It will be valid for the specific duration of time specified in the response.
+
+ Args:
+ code: Apple Code
+ social_app_name: Name of Social provider APP
+
+ Returns:
+ Response containing Definition of Complete Token data
+ 20.12
+ """
+
+ if(self._lr_object.is_null_or_whitespace(code)):
+ raise Exception(self._lr_object.get_validation_message("code"))
+
+ query_parameters = {}
+ query_parameters["code"] = code
+ query_parameters["key"] = self._lr_object.get_api_key()
+ if(not self._lr_object.is_null_or_whitespace(social_app_name)):
+ query_parameters["socialAppName"] = social_app_name
+
+ resource_path = "api/v2/access_token/apple"
+ return self._lr_object.execute("GET", resource_path, query_parameters, None)
+
+ def get_access_token_by_we_chat_code(self, code):
+ """This API is used to retrieve a LoginRadius access token by passing in a valid WeChat OAuth Code.
+
+ Args:
+ code: WeChat Code
+
+ Returns:
+ Response containing Definition of Complete Token data
+ 20.13
+ """
+
+ if(self._lr_object.is_null_or_whitespace(code)):
+ raise Exception(self._lr_object.get_validation_message("code"))
+
+ query_parameters = {}
+ query_parameters["code"] = code
+ query_parameters["key"] = self._lr_object.get_api_key()
+
+ resource_path = "api/v2/access_token/wechat"
+ 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.
@@ -170,11 +228,12 @@ def get_access_token_by_vkontakte_access_token(self, vk_access_token):
resource_path = "api/v2/access_token/vkontakte"
return self._lr_object.execute("GET", resource_path, query_parameters, None)
- def get_access_token_by_google_auth_code(self, google_authcode):
+ def get_access_token_by_google_auth_code(self, google_authcode, social_app_name=None):
"""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
+ social_app_name: Name of Social provider APP
Returns:
Response containing Definition of Complete Token data
@@ -187,6 +246,8 @@ def get_access_token_by_google_auth_code(self, google_authcode):
query_parameters = {}
query_parameters["apiKey"] = self._lr_object.get_api_key()
query_parameters["google_authcode"] = google_authcode
+ if(not self._lr_object.is_null_or_whitespace(social_app_name)):
+ query_parameters["socialAppName"] = social_app_name
resource_path = "api/v2/access_token/google"
return self._lr_object.execute("GET", resource_path, query_parameters, None)
diff --git a/lib/LoginRadius/api/social/social_api.py b/lib/LoginRadius/api/social/social_api.py
index 9b6550c..ea8a9c8 100644
--- a/lib/LoginRadius/api/social/social_api.py
+++ b/lib/LoginRadius/api/social/social_api.py
@@ -33,12 +33,13 @@ def exchange_access_token(self, token):
resource_path = "api/v2/access_token"
return self._lr_object.execute("GET", resource_path, query_parameters, None)
- def refresh_access_token(self, access_token, expires_in=0):
+ def refresh_access_token(self, access_token, expires_in=0, is_web=False):
"""The Refresh Access Token API is used to refresh the provider access token after authentication. It will be valid for up to 60 days on LoginRadius depending on the provider. In order to use the access token in other APIs, always refresh the token using this API.
Supported Providers : Facebook,Yahoo,Google,Twitter, Linkedin.
Contact LoginRadius support team to enable this API.
Args:
access_token: Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
- expires_in: Allows you to specify a desired expiration time in minutes for the newly issued access_token.
+ expires_in: Allows you to specify a desired expiration time in minutes for the newly issued access token.
+ is_web: Is web or not.
Returns:
Response containing Definition of Complete Token data
@@ -53,6 +54,8 @@ def refresh_access_token(self, access_token, expires_in=0):
query_parameters["secret"] = self._lr_object.get_api_secret()
if(expires_in is not None):
query_parameters["expiresIn"] = expires_in
+ if(is_web is not None):
+ query_parameters["isWeb"] = is_web
resource_path = "api/v2/access_token/refresh"
return self._lr_object.execute("GET", resource_path, query_parameters, None)
diff --git a/lib/README.md b/lib/README.md
index 4fdea27..cf24978 100644
--- a/lib/README.md
+++ b/lib/README.md
@@ -21,18 +21,38 @@ From Package
Using pip
```
- pip install loginradius-v2==10.0.1
+ pip install loginradius-v2==11.0.0
```
or with easy_install
```
- easy_install loginradius-v2==10.0.1
+ easy_install loginradius-v2==11.0.0
```
Changelog
======
+11.0.0
+-----------
+Release on **July 28,2020**
+
+## Enhancements:
+- Added a parameter isWeb in "RefreshAccessToken" API.
+- Added a parameter SocialAppName in "getAccessTokenByFacebookAccessToken, getAccessTokenByTwitterAccessToken,
+ getAccessTokenByGoogleAccessToken, getAccessTokenByLinkedinAccessToken, getAccessTokenByAppleIdCode,
+ getAccessTokenByGoogleAuthCode" Native Social login APIs.
+
+## Added new multiple APIs for better user experience:
+- Added linkSocialIdentites(POST) API.
+- Added linkSocialIdentitiesByPing(POST) API.
+- Added getAccessTokenByAppleIdCode API.
+- Added getAccessTokenByWeChatCode API.
+
+## Removed APIs:
+ - linkSocialIdentity API(PUT)
+ - getSocialIdentity API(GET)
+
10.0.1
-----------
Release on **October 10,2019**
diff --git a/lib/setup.py b/lib/setup.py
index 22e613f..5f81688 100755
--- a/lib/setup.py
+++ b/lib/setup.py
@@ -8,7 +8,7 @@
setuptools.setup(
name = 'LoginRadius-v2',
- version='10.0.1',
+ version='11.0.0',
long_description=long_description,
long_description_content_type='text/markdown',
packages=setuptools.find_packages(),