diff --git a/CHANGELOG.md b/CHANGELOG.md index 384b3b7..bf6ff40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,65 @@ > **LoginRadius PHP SDK Change Log** provides information regarding what has changed, more specifically what changes, improvements and bug fix has been made to the SDK. For more details please refer to the [LoginRadius API Documention](https://www.loginradius.com/docs/api/v2/deployment/sdk-libraries/php-library/) +# Version 11.2.0 + +Release on **September 6, 2021** + +## Enhancements + +- Updated Jquery with latest version(3.6.0) in SDK Demo + + +## Added new multiple APIs for better user experience + + +- MFAEmailOtpByAccessToken +- MFAValidateEmailOtpByAccessToken +- MFAResetEmailOtpAuthenticatorByAccessToken +- MFASecurityQuestionAnswerByAccessToken +- MFAResetSecurityQuestionAuthenticatorByAccessToken +- MFAEmailOTP +- MFAValidateEmailOtp +- MFASecurityQuestionAnswer +- MFASecurityQuestionAnswerVerification +- MFAResetEmailOtpAuthenticatorByUid +- MFAResetSecurityQuestionAuthenticatorByUid +- ReAuthValidateEmailOtp +- ReAuthSendEmailOtp +- ReAuthBySecurityQuestion + +## Removed APIs: + +- GetSocialUserProfile + +#### Added `EmailTemplate2FA` parameter in the following API +- MFALoginByEmail +- MFALoginByUserName +- MFALoginByPhone + +#### Added `RbaBrowserEmailTemplate`, `RbaCityEmailTemplate` ,`RbaCountryEmailTemplate` , `RbaIpEmailTemplate` parameter in the following API +- MFAValidateOTPByPhone +- MFAValidateGoogleAuthCode +- MFAValidateBackupCode + +#### Added `emailTemplate`, `verificationUrl` ,`welcomeEmailTemplate` parameter in the following API + +- GetProfileByAccessToken + +#### Removed `smsTemplate2FA ` parameter from the following API +- mfaValidateGoogleAuthCode + # Version 11.1.1 Release on **June 11, 2021** + + ## Bug Fixed -- Fixed API Key Validation issue +- fixed API Key Validation issue + # Version 11.1.0 -Release on **April 06, 2021** +Release on **March 25, 2021** ## Enhancements - Added X-Origin-IP header support. @@ -21,31 +72,30 @@ Release on **April 06, 2021** - Passwordless Login Verification By User Name And OTP. -# Version 11.0.0 -Release on **Aug 10, 2020** -## Enhancements - - Added a parameter isWeb in "RefreshAccessToken" API. - - Added a parameter SocialAppName in "getAccessTokenByFacebookAccessToken, getAccessTokenByTwitterAccessToken, - getAccessTokenByGoogleAccessToken, getAccessTokenByLinkedinAccessToken, getAccessTokenByAppleIdCode, getAccessTokenByGoogleAuthCode" native Social login APIs. +# Version 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 linkSocialIdentities(POST) API. - Added linkSocialIdentitiesByPing(POST) API. - Added getAccessTokenByAppleIdCode API. - Added getAccessTokenByWeChatCode API. - ## Removed APIs: - - linkSocialIdentity API(PUT) - getSocialIdentity API(GET) + # Version 10.0.0 -Release on **September 30, 2019** +Release on **September 26, 2019** ## Enhancements This full version release includes major changes with several improvements and optimizations : @@ -57,14 +107,13 @@ This full version release includes major changes with several improvements and o - 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. + - Better Error and 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 Functionality to generate SOTT locally in Utility folder, compatible with latest version of PHP. + ## Added new multiple APIs for better user experience @@ -83,20 +132,20 @@ This full version release includes major changes with several improvements and o - Verify Multifactor PIN Authentication - Update UID - MFA Re-authentication by PIN - - PIN Login - - Forgot PIN By Email - - Forgot PIN By UserName + - 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 + - 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 + - Set Pin By PinAuthToken + - Invalidate Pin Session Token - Submit Consent By ConsentToken - Get Consent Logs - Submit Consent By AccessToken @@ -271,4 +320,8 @@ Released on **February 28, 2017** - Added resthooks api's - Added role api's - Added add or remove email api's - - Added Custom object api's \ No newline at end of file + - Added Custom object api's + + + + diff --git a/README.md b/README.md index b076c38..c045e23 100644 --- a/README.md +++ b/README.md @@ -648,9 +648,12 @@ This API retrieves a copy of the user data based on the access token. ``` $access_token = "access_token"; //Required -$fields = null; //Optional +$fields = null; //Optional +$emailTemplate = "emailTemplate"; //Optional +$verificationUrl = "verificationUrl"; //Optional +$welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional -$result = $authenticationAPI->getProfileByAccessToken($access_token,$fields); +$result = $authenticationAPI->getProfileByAccessToken($access_token,$fields,$emailTemplate,$verificationUrl,$welcomeEmailTemplate); ``` @@ -1188,7 +1191,6 @@ List of APIs in this Section:
[GET : Get Post](#GetPosts-get-)
[GET : Get Trackable Status Stats](#GetTrackableStatusStats-get-)
[GET : Trackable Status Fetching](#TrackableStatusFetching-get-)
-[GET : User Profile](#GetSocialUserProfile-get-)
[GET : Refresh User Profile](#GetRefreshedSocialUserProfile-get-)
[GET : Video](#GetVideos-get-)
@@ -1605,20 +1607,6 @@ $postId = "postId"; //Required $result = $socialAPI->trackableStatusFetching($postId); ``` - -
User Profile (GET)
-The User Profile API is used to get social profile data from the user's social account after authentication.

Supported Providers: All - [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/user-profile) - - ``` - -$access_Token = "access_Token"; //Required -$fields = null; //Optional - -$result = $socialAPI->getSocialUserProfile($access_Token,$fields); - ``` - -
Refresh User Profile (GET)
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) @@ -2007,23 +1995,34 @@ List of APIs in this Section:
[PUT : Update MFA Setting](#MFAUpdateSetting-put-)
[PUT : Update MFA by Access Token](#MFAUpdateByAccessToken-put-)
[PUT : MFA Update Phone Number by Token](#MFAUpdatePhoneNumberByToken-put-)
+[PUT : Verify MFA Email OTP by Access Token](#MFAValidateEmailOtpByAccessToken-put-)
+[PUT : Update MFA Security Question by Access Token](#MFASecurityQuestionAnswerByAccessToken-put-)
[PUT : MFA Validate OTP](#MFAValidateOTPByPhone-put-)
[PUT : MFA Validate Google Auth Code](#MFAValidateGoogleAuthCode-put-)
[PUT : MFA Validate Backup code](#MFAValidateBackupCode-put-)
[PUT : MFA Update Phone Number](#MFAUpdatePhoneNumber-put-)
+[PUT : Verify MFA Email OTP by MFA Token](#MFAValidateEmailOtp-put-)
+[PUT : Update MFA Security Question by MFA Token](#MFASecurityQuestionAnswer-put-)
[POST : MFA Email Login](#MFALoginByEmail-post-)
[POST : MFA UserName Login](#MFALoginByUserName-post-)
[POST : MFA Phone Login](#MFALoginByPhone-post-)
+[POST : Send MFA Email OTP by MFA Token](#MFAEmailOTP-post-)
+[POST : Verify MFA Security Question by MFA Token](#MFASecurityQuestionAnswerVerification-post-)
[GET : MFA Validate Access Token](#MFAConfigureByAccessToken-get-)
[GET : MFA Backup Code by Access Token](#MFABackupCodeByAccessToken-get-)
[GET : Reset Backup Code by Access Token](#MFAResetBackupCodeByAccessToken-get-)
+[GET : Send MFA Email OTP by Access Token](#MFAEmailOtpByAccessToken-get-)
[GET : MFA Resend Otp](#MFAResendOTP-get-)
[GET : MFA Backup Code by UID](#MFABackupCodeByUid-get-)
[GET : MFA Reset Backup Code by UID](#MFAResetBackupCodeByUid-get-)
[DELETE : MFA Reset Google Authenticator by Token](#MFAResetGoogleAuthByToken-delete-)
[DELETE : MFA Reset SMS Authenticator by Token](#MFAResetSMSAuthByToken-delete-)
+[DELETE : Reset MFA Email OTP Authenticator By Access Token](#MFAResetEmailOtpAuthenticatorByAccessToken-delete-)
+[DELETE : MFA Reset Security Question Authenticator By Access Token](#MFAResetSecurityQuestionAuthenticatorByAccessToken-delete-)
[DELETE : MFA Reset SMS Authenticator By UID](#MFAResetSMSAuthenticatorByUid-delete-)
[DELETE : MFA Reset Google Authenticator By UID](#MFAResetGoogleAuthenticatorByUid-delete-)
+[DELETE : Reset MFA Email OTP Authenticator Settings by Uid](#MFAResetEmailOtpAuthenticatorByUid-delete-)
+[DELETE : Reset MFA Security Question Authenticator Settings by Uid](#MFAResetSecurityQuestionAuthenticatorByUid-delete-)
If you have not already initialized the MultiFactorAuthentication object do so now ``` @@ -2078,6 +2077,43 @@ $result = $multiFactorAuthenticationAPI->mfaUpdatePhoneNumberByToken($access_tok ``` +
Verify MFA Email OTP by Access Token (PUT)
+This API is used to set up MFA Email OTP authenticator on profile after login. + [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/verify-mfa-otp-by-access-token/) + + ``` + +$access_token = "access_token"; //Required + $payload = '{ + "EmailId":"", + "Otp":"otp" + }'; //Required + +$result = $multiFactorAuthenticationAPI->mfaValidateEmailOtpByAccessToken($access_token,$payload); + ``` + + +
Update MFA Security Question by Access Token (PUT)
+This API is used to set up MFA Security Question authenticator on profile after login. + [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/update-mfa-security-question-by-access-token) + + ``` + +$access_token = "access_token"; //Required + $payload = '{ + "securityquestionanswer": [ + { + "QuestionId": "db7****8a73e4******bd9****8c20", + "Answer": "" + } + ], + "ReplaceSecurityQuestionAnswer":false // required + }'; //Required + +$result = $multiFactorAuthenticationAPI->mfaSecurityQuestionAnswerByAccessToken($access_token,$payload); + ``` + +
MFA Validate OTP (PUT)
This API is used to login 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/sms-authenticator/mfa-validate-otp/) @@ -2090,8 +2126,12 @@ This API is used to login via Multi-factor authentication by passing the One Tim $secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required $fields = null; //Optional $smsTemplate2FA = "smsTemplate2FA"; //Optional +$rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional +$rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional +$rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional +$rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional -$result = $multiFactorAuthenticationAPI->mfaValidateOTPByPhone($payload,$secondFactorAuthenticationToken,$fields,$smsTemplate2FA); +$result = $multiFactorAuthenticationAPI->mfaValidateOTPByPhone($payload,$secondFactorAuthenticationToken,$fields,$smsTemplate2FA,$rbaBrowserEmailTemplate,$rbaCityEmailTemplate,$rbaCountryEmailTemplate,$rbaIpEmailTemplate); ``` @@ -2104,9 +2144,12 @@ This API is used to login via Multi-factor-authentication by passing the google $googleAuthenticatorCode = "googleAuthenticatorCode"; //Required $secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required $fields = null; //Optional -$smsTemplate2FA = "smsTemplate2FA"; //Optional +$rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional +$rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional +$rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional +$rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional -$result = $multiFactorAuthenticationAPI->mfaValidateGoogleAuthCode($googleAuthenticatorCode,$secondFactorAuthenticationToken,$fields,$smsTemplate2FA); +$result = $multiFactorAuthenticationAPI->mfaValidateGoogleAuthCode($googleAuthenticatorCode,$secondFactorAuthenticationToken,$fields,$rbaBrowserEmailTemplate,$rbaCityEmailTemplate,$rbaCountryEmailTemplate,$rbaIpEmailTemplate); ``` @@ -2120,9 +2163,13 @@ This API is used to validate the backup code provided by the user and if valid, "backupCode" : "" }'; //Required $secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required -$fields = null; //Optional +$fields = null; //Optional +$rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional +$rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional +$rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional +$rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional -$result = $multiFactorAuthenticationAPI->mfaValidateBackupCode($payload,$secondFactorAuthenticationToken,$fields); +$result = $multiFactorAuthenticationAPI->mfaValidateBackupCode($payload,$secondFactorAuthenticationToken,$fields,$rbaBrowserEmailTemplate,$rbaCityEmailTemplate,$rbaCountryEmailTemplate,$rbaIpEmailTemplate); ``` @@ -2140,6 +2187,47 @@ $result = $multiFactorAuthenticationAPI->mfaUpdatePhoneNumber($phoneNo2FA,$secon ``` +
Verify MFA Email OTP by MFA Token (PUT)
+This API is used to Verify MFA Email OTP by MFA Token + [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/verify-mfa-email-otp-by-mfa-token/) + + ``` + + $payload = ' + { + "EmailId":"email", + "Otp":"otp" + }'; //Required +$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required +$rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional +$rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional +$rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional +$rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional + +$result = $multiFactorAuthenticationAPI->mfaValidateEmailOtp($payload,$secondFactorAuthenticationToken,$rbaBrowserEmailTemplate,$rbaCityEmailTemplate,$rbaCountryEmailTemplate,$rbaIpEmailTemplate); + ``` + + +
Update MFA Security Question by MFA Token (PUT)
+This API is used to set the security questions on the profile with the MFA token when MFA flow is required. + [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/update-mfa-security-question-by-mfa-token/) + + ``` + + $payload = '{ + "securityquestionanswer": [ + { + "QuestionId": "db7****8a73e4******bd9****8c20", + "Answer": "" + } + ] +}'; //Required +$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required + +$result = $multiFactorAuthenticationAPI->mfaSecurityQuestionAnswer($payload,$secondFactorAuthenticationToken); + ``` + +
MFA Email Login (POST)
This API can be used to login by emailid on a Multi-factor authentication enabled LoginRadius site. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-email-login) @@ -2154,8 +2242,9 @@ $loginUrl = "loginUrl"; //Optional $smsTemplate = "smsTemplate"; //Optional $smsTemplate2FA = "smsTemplate2FA"; //Optional $verificationUrl = "verificationUrl"; //Optional +$emailTemplate2FA = "emailTemplate2FA"; //Optional -$result = $multiFactorAuthenticationAPI->mfaLoginByEmail($email,$password,$emailTemplate,$fields,$loginUrl,$smsTemplate,$smsTemplate2FA,$verificationUrl); +$result = $multiFactorAuthenticationAPI->mfaLoginByEmail($email,$password,$emailTemplate,$fields,$loginUrl,$smsTemplate,$smsTemplate2FA,$verificationUrl,$emailTemplate2FA); ``` @@ -2173,8 +2262,9 @@ $loginUrl = "loginUrl"; //Optional $smsTemplate = "smsTemplate"; //Optional $smsTemplate2FA = "smsTemplate2FA"; //Optional $verificationUrl = "verificationUrl"; //Optional - -$result = $multiFactorAuthenticationAPI->mfaLoginByUserName($password,$username,$emailTemplate,$fields,$loginUrl,$smsTemplate,$smsTemplate2FA,$verificationUrl); +$emailTemplate2FA = "emailTemplate2FA"; //Optional + +$result = $multiFactorAuthenticationAPI->mfaLoginByUserName($password,$username,$emailTemplate,$fields,$loginUrl,$smsTemplate,$smsTemplate2FA,$verificationUrl,$emailTemplate2FA); ``` @@ -2192,8 +2282,49 @@ $loginUrl = "loginUrl"; //Optional $smsTemplate = "smsTemplate"; //Optional $smsTemplate2FA = "smsTemplate2FA"; //Optional $verificationUrl = "verificationUrl"; //Optional +$emailTemplate2FA = "emailTemplate2FA"; //Optional + +$result = $multiFactorAuthenticationAPI->mfaLoginByPhone($password,$phone,$emailTemplate,$fields,$loginUrl,$smsTemplate,$smsTemplate2FA,$verificationUrl,$emailTemplate2FA); + ``` + + +
Send MFA Email OTP by MFA Token (POST)
+An API designed to send the MFA Email OTP to the email. + [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/send-mfa-email-otp-by-mfa-token/) + + ``` + + $payload = '{ + "EmailId":"email" + }'; //Required +$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required +$emailTemplate2FA = "emailTemplate2FA"; //Optional -$result = $multiFactorAuthenticationAPI->mfaLoginByPhone($password,$phone,$emailTemplate,$fields,$loginUrl,$smsTemplate,$smsTemplate2FA,$verificationUrl); +$result = $multiFactorAuthenticationAPI->mfaEmailOTP($payload,$secondFactorAuthenticationToken,$emailTemplate2FA); + ``` + + +
Verify MFA Security Question by MFA Token (POST)
+This API is used to resending the verification OTP to the provided phone number + [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/verify-mfa-security-question-by-mfa-token/) + + ``` + + $payload = '{ + "securityquestionanswer": [ + { + "QuestionId": "db7****8a73e4******bd9****8c20", + "Answer": "" + } + ] +}'; //Required +$secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required +$rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional +$rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional +$rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional +$rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional + +$result = $multiFactorAuthenticationAPI->mfaSecurityQuestionAnswerVerification($payload,$secondFactorAuthenticationToken,$rbaBrowserEmailTemplate,$rbaCityEmailTemplate,$rbaCountryEmailTemplate,$rbaIpEmailTemplate); ``` @@ -2234,6 +2365,20 @@ $result = $multiFactorAuthenticationAPI->mfaResetBackupCodeByAccessToken($access ``` +
Send MFA Email OTP by Access Token (GET)
+This API is created to send the OTP to the email if email OTP authenticator is enabled in app's MFA configuration. + [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/send-mfa-email-otp-by-access-token/) + + ``` + +$access_token = "access_token"; //Required +$emailId = "emailId"; //Required +$emailTemplate2FA = "emailTemplate2FA"; //Optional + +$result = $multiFactorAuthenticationAPI->mfaEmailOtpByAccessToken($access_token,$emailId,$emailTemplate2FA); + ``` + +
MFA Resend Otp (GET)
This API is used to resending the verification OTP to the provided phone number [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/resend-twofactorauthentication-otp/) @@ -2297,6 +2442,30 @@ $result = $multiFactorAuthenticationAPI->mfaResetSMSAuthByToken($access_token,$o ``` +
Reset MFA Email OTP Authenticator By Access Token (DELETE)
+This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user + [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/reset-mfa-email-otp-authenticator-access-token/) + + ``` + +$access_token = "access_token"; //Required + +$result = $multiFactorAuthenticationAPI->mfaResetEmailOtpAuthenticatorByAccessToken($access_token); + ``` + + +
MFA Reset Security Question Authenticator By Access Token (DELETE)
+This API is used to Reset MFA Security Question Authenticator By Access Token + [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/reset-mfa-security-question-by-access-token/) + + ``` + +$access_token = "access_token"; //Required + +$result = $multiFactorAuthenticationAPI->mfaResetSecurityQuestionAuthenticatorByAccessToken($access_token); + ``` + +
MFA Reset SMS Authenticator By UID (DELETE)
This API resets the SMS Authenticator configurations on a given account via the UID. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-reset-sms-authenticator-by-uid/) @@ -2323,8 +2492,28 @@ $result = $multiFactorAuthenticationAPI->mfaResetGoogleAuthenticatorByUid($googl ``` +
Reset MFA Email OTP Authenticator Settings by Uid (DELETE)
+This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user. + [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/reset-mfa-email-otp-authenticator-settings-by-uid/) + + ``` + +$uid = "uid"; //Required + +$result = $multiFactorAuthenticationAPI->mfaResetEmailOtpAuthenticatorByUid($uid); + ``` + +
Reset MFA Security Question Authenticator Settings by Uid (DELETE)
+This API is used to reset the Security Question Authenticator settings for an MFA-enabled user. + [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/reset-mfa-security-question-authenticator-settings-by-uid/) + ``` + +$uid = "uid"; //Required + +$result = $multiFactorAuthenticationAPI->mfaResetSecurityQuestionAuthenticatorByUid($uid); + ``` ### PINAuthentication API @@ -2577,10 +2766,13 @@ List of APIs in this Section:
[PUT : Validate MFA by Google Authenticator Code](#MFAReAuthenticateByGoogleAuth-put-)
[PUT : Validate MFA by Password](#MFAReAuthenticateByPassword-put-)
[PUT : MFA Re-authentication by PIN](#VerifyPINAuthentication-put-)
+[PUT : MFA Re-authentication by Email OTP](#ReAuthValidateEmailOtp-put-)
[POST : Verify Multifactor OTP Authentication](#VerifyMultiFactorOtpReauthentication-post-)
[POST : Verify Multifactor Password Authentication](#VerifyMultiFactorPasswordReauthentication-post-)
[POST : Verify Multifactor PIN Authentication](#VerifyMultiFactorPINReauthentication-post-)
+[POST : MFA Re-authentication by Security Question](#ReAuthBySecurityQuestion-post-)
[GET : Multi Factor Re-Authenticate](#MFAReAuthenticate-get-)
+[GET : Send MFA Re-auth Email OTP by Access Token](#ReAuthSendEmailOtp-get-)
If you have not already initialized the ReAuthentication object do so now ``` @@ -2665,6 +2857,22 @@ $result = $reAuthenticationAPI->verifyPINAuthentication($access_token,$payload,$ ``` +
MFA Re-authentication by Email OTP (PUT)
+This API is used to validate the triggered MFA authentication flow with an Email OTP. + [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/mfa-re-auth-by-email-otp/) + + ``` + +$access_token = "access_token"; //Required + $payload = '{ + "EmailId":"email", + "otp": "otp" +}'; //Required + +$result = $reAuthenticationAPI->reAuthValidateEmailOtp($access_token,$payload); + ``` + +
Verify Multifactor OTP Authentication (POST)
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/) @@ -2710,6 +2918,26 @@ $result = $reAuthenticationAPI->verifyMultiFactorPINReauthentication($payload,$u ``` +
MFA Re-authentication by Security Question (POST)
+This API is used to validate the triggered MFA re-authentication flow with security questions answers. + [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/mfa-re-authentication-by-security-question/) + + ``` + +$access_token = "access_token"; //Required + $payload = '{ + "securityquestionanswer": [ + { + "QuestionId": "db7****8a73e4******bd9****8c20", + "Answer": "" + } + ] +}'; //Required + +$result = $reAuthenticationAPI->reAuthBySecurityQuestion($access_token,$payload); + ``` + +
Multi Factor Re-Authenticate (GET)
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/) @@ -2723,6 +2951,20 @@ $result = $reAuthenticationAPI->mfaReAuthenticate($access_token,$smsTemplate2FA) ``` +
Send MFA Re-auth Email OTP by Access Token (GET)
+This API is used to send the MFA Email OTP to the email for Re-authentication + [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/send-mfa-re-auth-email-otp-by-access-token/) + + ``` + +$access_token = "access_token"; //Required +$emailId = "emailId"; //Required +$emailTemplate2FA = "emailTemplate2FA"; //Optional + +$result = $reAuthenticationAPI->reAuthSendEmailOtp($access_token,$emailId,$emailTemplate2FA); + ``` + + diff --git a/composer.json b/composer.json index b3c38f8..f0be6f0 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "loginradius/php-sdk", - "description": "LoginRadius PHP SDK v11.1.1", + "description": "LoginRadius PHP SDK v11.2.0", "keywords": ["loginradius", "phpsdk"], "type": "library", "license": "MIT", diff --git a/demo/emailverification.html b/demo/emailverification.html index 3482864..7ab3806 100644 --- a/demo/emailverification.html +++ b/demo/emailverification.html @@ -6,7 +6,7 @@ - + diff --git a/demo/index.html b/demo/index.html index b6a5cb8..29891cc 100644 --- a/demo/index.html +++ b/demo/index.html @@ -6,7 +6,7 @@ - + + diff --git a/demo/profile.html b/demo/profile.html index 824daa4..072df61 100644 --- a/demo/profile.html +++ b/demo/profile.html @@ -6,7 +6,7 @@ - + diff --git a/demo/resetpassword.html b/demo/resetpassword.html index d662b9c..0cdc20d 100644 --- a/demo/resetpassword.html +++ b/demo/resetpassword.html @@ -6,7 +6,7 @@ - + diff --git a/src/LoginRadiusSDK/Clients/DefaultHttpClient.php b/src/LoginRadiusSDK/Clients/DefaultHttpClient.php index 9c1b149..2e58b15 100644 --- a/src/LoginRadiusSDK/Clients/DefaultHttpClient.php +++ b/src/LoginRadiusSDK/Clients/DefaultHttpClient.php @@ -5,7 +5,7 @@ * @category : Clients * @package : DefaultHttpClient * @author : LoginRadius Team - * @version : 11.1.1 + * @version : 11.2.0 * @license : https://opensource.org/licenses/MIT */ diff --git a/src/LoginRadiusSDK/Clients/IHttpClientInterface.php b/src/LoginRadiusSDK/Clients/IHttpClientInterface.php index c5f778d..6fa8220 100644 --- a/src/LoginRadiusSDK/Clients/IHttpClientInterface.php +++ b/src/LoginRadiusSDK/Clients/IHttpClientInterface.php @@ -5,7 +5,7 @@ * @category : Clients * @package : IHttpClientInterface * @author : LoginRadius Team - * @version : 11.1.1 + * @version : 11.2.0 * @license : https://opensource.org/licenses/MIT */ diff --git a/src/LoginRadiusSDK/CustomerRegistration/Advanced/MultiFactorAuthenticationAPI.php b/src/LoginRadiusSDK/CustomerRegistration/Advanced/MultiFactorAuthenticationAPI.php index 2bb4440..4535f24 100644 --- a/src/LoginRadiusSDK/CustomerRegistration/Advanced/MultiFactorAuthenticationAPI.php +++ b/src/LoginRadiusSDK/CustomerRegistration/Advanced/MultiFactorAuthenticationAPI.php @@ -224,6 +224,123 @@ public function mfaResetBackupCodeByAccessToken($accessToken) + /** + * This API is created to send the OTP to the email if email OTP authenticator is enabled in app's MFA configuration. + * @param accessToken access_token + * @param emailId EmailId + * @param emailTemplate2FA EmailTemplate2FA + * @return Response containing Definition of Complete Validation data + * 5.17 + */ + + public function mfaEmailOtpByAccessToken($accessToken, $emailId, + $emailTemplate2FA = null) + { + $resourcePath = "/identity/v2/auth/account/2fa/otp/email"; + $queryParam = []; + if ($accessToken === '' || ctype_space($accessToken)) { + throw new LoginRadiusException(Functions::paramValidationMsg('accessToken')); + } + $queryParam['apiKey'] = Functions::getApiKey(); + if ($emailId === '' || ctype_space($emailId)) { + throw new LoginRadiusException(Functions::paramValidationMsg('emailId')); + } + if ($emailTemplate2FA != '') { + $queryParam['emailTemplate2FA'] = $emailTemplate2FA; + } + $queryParam['access_token'] = $accessToken; + $queryParam['emailId'] = $emailId; + return Functions::_apiClientHandler('GET', $resourcePath, $queryParam); + } + + + + /** + * This API is used to set up MFA Email OTP authenticator on profile after login. + * @param accessToken access_token + * @param multiFactorAuthModelByEmailOtpWithLockout payload + * @return Response containing Definition for Complete profile data + * 5.18 + */ + + public function mfaValidateEmailOtpByAccessToken($accessToken, $multiFactorAuthModelByEmailOtpWithLockout) + { + $resourcePath = "/identity/v2/auth/account/2fa/verification/otp/email"; + $queryParam = []; + if ($accessToken === '' || ctype_space($accessToken)) { + throw new LoginRadiusException(Functions::paramValidationMsg('accessToken')); + } + $queryParam['apiKey'] = Functions::getApiKey(); + $queryParam['access_token'] = $accessToken; + return Functions::_apiClientHandler('PUT', $resourcePath, $queryParam, $multiFactorAuthModelByEmailOtpWithLockout); + } + + + + /** + * This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user + * @param accessToken access_token + * @return Response containing Definition of Delete Request + * 5.19 + */ + + public function mfaResetEmailOtpAuthenticatorByAccessToken($accessToken) + { + $resourcePath = "/identity/v2/auth/account/2fa/authenticator/otp/email"; + $queryParam = []; + if ($accessToken === '' || ctype_space($accessToken)) { + throw new LoginRadiusException(Functions::paramValidationMsg('accessToken')); + } + $queryParam['apiKey'] = Functions::getApiKey(); + $queryParam['access_token'] = $accessToken; + return Functions::_apiClientHandler('DELETE', $resourcePath, $queryParam); + } + + + + /** + * This API is used to set up MFA Security Question authenticator on profile after login. + * @param accessToken access_token + * @param securityQuestionAnswerModelByAccessToken payload + * @return Response containing Definition of Complete Validation data + * 5.20 + */ + + public function mfaSecurityQuestionAnswerByAccessToken($accessToken, $securityQuestionAnswerModelByAccessToken) + { + $resourcePath = "/identity/v2/auth/account/2fa/securityquestionanswer"; + $queryParam = []; + if ($accessToken === '' || ctype_space($accessToken)) { + throw new LoginRadiusException(Functions::paramValidationMsg('accessToken')); + } + $queryParam['apiKey'] = Functions::getApiKey(); + $queryParam['access_token'] = $accessToken; + return Functions::_apiClientHandler('PUT', $resourcePath, $queryParam, $securityQuestionAnswerModelByAccessToken); + } + + + + /** + * This API is used to Reset MFA Security Question Authenticator By Access Token + * @param accessToken access_token + * @return Response containing Definition of Delete Request + * 5.21 + */ + + public function mfaResetSecurityQuestionAuthenticatorByAccessToken($accessToken) + { + $resourcePath = "/identity/v2/auth/account/2fa/authenticator/securityquestionanswer"; + $queryParam = []; + if ($accessToken === '' || ctype_space($accessToken)) { + throw new LoginRadiusException(Functions::paramValidationMsg('accessToken')); + } + $queryParam['apiKey'] = Functions::getApiKey(); + $queryParam['access_token'] = $accessToken; + return Functions::_apiClientHandler('DELETE', $resourcePath, $queryParam); + } + + + /** * This API can be used to login by emailid on a Multi-factor authentication enabled LoginRadius site. * @param email user's email @@ -234,13 +351,15 @@ public function mfaResetBackupCodeByAccessToken($accessToken) * @param smsTemplate SMS Template name * @param smsTemplate2FA SMS Template Name * @param verificationUrl Email verification url + * @param emailTemplate2FA 2FA Email Template name * @return Complete user UserProfile data * 9.8.1 */ public function mfaLoginByEmail($email, $password, - $emailTemplate = null, $fields = "", $loginUrl = null, - $smsTemplate = null, $smsTemplate2FA = null, $verificationUrl = null) + $emailTemplate = null, $fields = "", + $loginUrl = null, $smsTemplate = null, $smsTemplate2FA = null, + $verificationUrl = null, $emailTemplate2FA = null) { $resourcePath = "/identity/v2/auth/login/2fa"; $bodyParam = []; @@ -266,6 +385,9 @@ public function mfaLoginByEmail($email, $password, if ($verificationUrl != '') { $queryParam['verificationUrl'] = $verificationUrl; } + if ($emailTemplate2FA != '') { + $queryParam['emailTemplate2FA'] = $emailTemplate2FA; + } return Functions::_apiClientHandler('POST', $resourcePath, $queryParam, json_encode($bodyParam)); } @@ -281,13 +403,15 @@ public function mfaLoginByEmail($email, $password, * @param smsTemplate SMS Template name * @param smsTemplate2FA SMS Template Name * @param verificationUrl Email verification url + * @param emailTemplate2FA 2FA Email Template name * @return Complete user UserProfile data * 9.8.2 */ public function mfaLoginByUserName($password, $username, - $emailTemplate = null, $fields = "", $loginUrl = null, - $smsTemplate = null, $smsTemplate2FA = null, $verificationUrl = null) + $emailTemplate = null, $fields = "",$loginUrl = null, + $smsTemplate = null, $smsTemplate2FA = null, + $verificationUrl = null, $emailTemplate2FA = null) { $resourcePath = "/identity/v2/auth/login/2fa"; $bodyParam = []; @@ -313,6 +437,9 @@ public function mfaLoginByUserName($password, $username, if ($verificationUrl != '') { $queryParam['verificationUrl'] = $verificationUrl; } + if ($emailTemplate2FA != '') { + $queryParam['emailTemplate2FA'] = $emailTemplate2FA; + } return Functions::_apiClientHandler('POST', $resourcePath, $queryParam, json_encode($bodyParam)); } @@ -328,13 +455,15 @@ public function mfaLoginByUserName($password, $username, * @param smsTemplate SMS Template name * @param smsTemplate2FA SMS Template Name * @param verificationUrl Email verification url + * @param emailTemplate2FA 2FA Email Template name * @return Complete user UserProfile data * 9.8.3 */ public function mfaLoginByPhone($password, $phone, - $emailTemplate = null, $fields = "", $loginUrl = null, - $smsTemplate = null, $smsTemplate2FA = null, $verificationUrl = null) + $emailTemplate = null, $fields = "", + $loginUrl = null, $smsTemplate = null, $smsTemplate2FA = null, + $verificationUrl = null, $emailTemplate2FA = null) { $resourcePath = "/identity/v2/auth/login/2fa"; $bodyParam = []; @@ -360,6 +489,9 @@ public function mfaLoginByPhone($password, $phone, if ($verificationUrl != '') { $queryParam['verificationUrl'] = $verificationUrl; } + if ($emailTemplate2FA != '') { + $queryParam['emailTemplate2FA'] = $emailTemplate2FA; + } return Functions::_apiClientHandler('POST', $resourcePath, $queryParam, json_encode($bodyParam)); } @@ -371,12 +503,17 @@ public function mfaLoginByPhone($password, $phone, * @param secondFactorAuthenticationToken A Uniquely generated MFA identifier token after successful authentication * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields * @param smsTemplate2FA SMS Template Name + * @param rbaBrowserEmailTemplate + * @param rbaCityEmailTemplate + * @param rbaCountryEmailTemplate + * @param rbaIpEmailTemplate * @return Complete user UserProfile data * 9.12 */ public function mfaValidateOTPByPhone($multiFactorAuthModelWithLockout, $secondFactorAuthenticationToken, - $fields = "", $smsTemplate2FA = null) + $fields = "", $smsTemplate2FA = null, $rbaBrowserEmailTemplate = null, $rbaCityEmailTemplate = null, + $rbaCountryEmailTemplate = null, $rbaIpEmailTemplate = null) { $resourcePath = "/identity/v2/auth/login/2fa/verification/otp"; $queryParam = []; @@ -390,6 +527,18 @@ public function mfaValidateOTPByPhone($multiFactorAuthModelWithLockout, $secondF if ($smsTemplate2FA != '') { $queryParam['smsTemplate2FA'] = $smsTemplate2FA; } + if ($rbaBrowserEmailTemplate != '') { + $queryParam['rbaBrowserEmailTemplate'] = $rbaBrowserEmailTemplate; + } + if ($rbaCityEmailTemplate != '') { + $queryParam['rbaCityEmailTemplate'] = $rbaCityEmailTemplate; + } + if ($rbaCountryEmailTemplate != '') { + $queryParam['rbaCountryEmailTemplate'] = $rbaCountryEmailTemplate; + } + if ($rbaIpEmailTemplate != '') { + $queryParam['rbaIpEmailTemplate'] = $rbaIpEmailTemplate; + } $queryParam['secondFactorAuthenticationToken'] = $secondFactorAuthenticationToken; return Functions::_apiClientHandler('PUT', $resourcePath, $queryParam, $multiFactorAuthModelWithLockout); } @@ -399,15 +548,19 @@ public function mfaValidateOTPByPhone($multiFactorAuthModelWithLockout, $secondF /** * This API is used to login via Multi-factor-authentication by passing the google authenticator code. * @param googleAuthenticatorCode The code generated by google authenticator app after scanning QR code - * @param secondFactorAuthenticationToken A Uniquely generated MFA identifier token after successful authentication + * @param secondFactorAuthenticationToken SecondFactorAuthenticationToken * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields - * @param smsTemplate2FA SMS Template Name + * @param rbaBrowserEmailTemplate RbaBrowserEmailTemplate + * @param rbaCityEmailTemplate RbaCityEmailTemplate + * @param rbaCountryEmailTemplate RbaCountryEmailTemplate + * @param rbaIpEmailTemplate RbaIpEmailTemplate * @return Complete user UserProfile data * 9.13 */ public function mfaValidateGoogleAuthCode($googleAuthenticatorCode, $secondFactorAuthenticationToken, - $fields = "", $smsTemplate2FA = null) + $fields = "", $rbaBrowserEmailTemplate = null, $rbaCityEmailTemplate = null, + $rbaCountryEmailTemplate = null, $rbaIpEmailTemplate = null) { $resourcePath = "/identity/v2/auth/login/2fa/verification/googleauthenticatorcode"; $bodyParam = []; @@ -420,8 +573,17 @@ public function mfaValidateGoogleAuthCode($googleAuthenticatorCode, $secondFacto if ($fields != '') { $queryParam['fields'] = $fields; } - if ($smsTemplate2FA != '') { - $queryParam['smsTemplate2FA'] = $smsTemplate2FA; + if ($rbaBrowserEmailTemplate != '') { + $queryParam['rbaBrowserEmailTemplate'] = $rbaBrowserEmailTemplate; + } + if ($rbaCityEmailTemplate != '') { + $queryParam['rbaCityEmailTemplate'] = $rbaCityEmailTemplate; + } + if ($rbaCountryEmailTemplate != '') { + $queryParam['rbaCountryEmailTemplate'] = $rbaCountryEmailTemplate; + } + if ($rbaIpEmailTemplate != '') { + $queryParam['rbaIpEmailTemplate'] = $rbaIpEmailTemplate; } $queryParam['secondFactorAuthenticationToken'] = $secondFactorAuthenticationToken; return Functions::_apiClientHandler('PUT', $resourcePath, $queryParam, json_encode($bodyParam)); @@ -434,12 +596,17 @@ public function mfaValidateGoogleAuthCode($googleAuthenticatorCode, $secondFacto * @param multiFactorAuthModelByBackupCode Model Class containing Definition of payload for MultiFactorAuth By BackupCode API * @param secondFactorAuthenticationToken A Uniquely generated MFA identifier token after successful authentication * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields + * @param rbaBrowserEmailTemplate + * @param rbaCityEmailTemplate + * @param rbaCountryEmailTemplate + * @param rbaIpEmailTemplate * @return Complete user UserProfile data * 9.14 */ public function mfaValidateBackupCode($multiFactorAuthModelByBackupCode, $secondFactorAuthenticationToken, - $fields = "") + $fields = "", $rbaBrowserEmailTemplate = null, $rbaCityEmailTemplate = null, + $rbaCountryEmailTemplate = null, $rbaIpEmailTemplate = null) { $resourcePath = "/identity/v2/auth/login/2fa/verification/backupcode"; $queryParam = []; @@ -450,6 +617,18 @@ public function mfaValidateBackupCode($multiFactorAuthModelByBackupCode, $second if ($fields != '') { $queryParam['fields'] = $fields; } + if ($rbaBrowserEmailTemplate != '') { + $queryParam['rbaBrowserEmailTemplate'] = $rbaBrowserEmailTemplate; + } + if ($rbaCityEmailTemplate != '') { + $queryParam['rbaCityEmailTemplate'] = $rbaCityEmailTemplate; + } + if ($rbaCountryEmailTemplate != '') { + $queryParam['rbaCountryEmailTemplate'] = $rbaCountryEmailTemplate; + } + if ($rbaIpEmailTemplate != '') { + $queryParam['rbaIpEmailTemplate'] = $rbaIpEmailTemplate; + } $queryParam['secondFactorAuthenticationToken'] = $secondFactorAuthenticationToken; return Functions::_apiClientHandler('PUT', $resourcePath, $queryParam, $multiFactorAuthModelByBackupCode); } @@ -510,6 +689,135 @@ public function mfaResendOTP($secondFactorAuthenticationToken, $smsTemplate2FA = + /** + * An API designed to send the MFA Email OTP to the email. + * @param emailIdModel payload + * @param secondFactorAuthenticationToken SecondFactorAuthenticationToken + * @param emailTemplate2FA EmailTemplate2FA + * @return Response containing Definition of Complete Validation data + * 9.18 + */ + + public function mfaEmailOTP($emailIdModel, $secondFactorAuthenticationToken, + $emailTemplate2FA = null) + { + $resourcePath = "/identity/v2/auth/login/2fa/otp/email"; + $queryParam = []; + $queryParam['apiKey'] = Functions::getApiKey(); + if ($secondFactorAuthenticationToken === '' || ctype_space($secondFactorAuthenticationToken)) { + throw new LoginRadiusException(Functions::paramValidationMsg('secondFactorAuthenticationToken')); + } + if ($emailTemplate2FA != '') { + $queryParam['emailTemplate2FA'] = $emailTemplate2FA; + } + $queryParam['secondFactorAuthenticationToken'] = $secondFactorAuthenticationToken; + return Functions::_apiClientHandler('POST', $resourcePath, $queryParam, $emailIdModel); + } + + + + /** + * This API is used to Verify MFA Email OTP by MFA Token + * @param multiFactorAuthModelByEmailOtp payload + * @param secondFactorAuthenticationToken SecondFactorAuthenticationToken + * @param rbaBrowserEmailTemplate RbaBrowserEmailTemplate + * @param rbaCityEmailTemplate RbaCityEmailTemplate + * @param rbaCountryEmailTemplate RbaCountryEmailTemplate + * @param rbaIpEmailTemplate RbaIpEmailTemplate + * @return Response Containing Access Token and Complete Profile Data + * 9.25 + */ + + public function mfaValidateEmailOtp($multiFactorAuthModelByEmailOtp, $secondFactorAuthenticationToken, + $rbaBrowserEmailTemplate = null, $rbaCityEmailTemplate = null, $rbaCountryEmailTemplate = null, + $rbaIpEmailTemplate = null) + { + $resourcePath = "/identity/v2/auth/login/2fa/verification/otp/email"; + $queryParam = []; + $queryParam['apiKey'] = Functions::getApiKey(); + if ($secondFactorAuthenticationToken === '' || ctype_space($secondFactorAuthenticationToken)) { + throw new LoginRadiusException(Functions::paramValidationMsg('secondFactorAuthenticationToken')); + } + if ($rbaBrowserEmailTemplate != '') { + $queryParam['rbaBrowserEmailTemplate'] = $rbaBrowserEmailTemplate; + } + if ($rbaCityEmailTemplate != '') { + $queryParam['rbaCityEmailTemplate'] = $rbaCityEmailTemplate; + } + if ($rbaCountryEmailTemplate != '') { + $queryParam['rbaCountryEmailTemplate'] = $rbaCountryEmailTemplate; + } + if ($rbaIpEmailTemplate != '') { + $queryParam['rbaIpEmailTemplate'] = $rbaIpEmailTemplate; + } + $queryParam['secondFactorAuthenticationToken'] = $secondFactorAuthenticationToken; + return Functions::_apiClientHandler('PUT', $resourcePath, $queryParam, $multiFactorAuthModelByEmailOtp); + } + + + + /** + * This API is used to set the security questions on the profile with the MFA token when MFA flow is required. + * @param securityQuestionAnswerUpdateModel payload + * @param secondFactorAuthenticationToken SecondFactorAuthenticationToken + * @return Response Containing Access Token and Complete Profile Data + * 9.26 + */ + + public function mfaSecurityQuestionAnswer($securityQuestionAnswerUpdateModel, $secondFactorAuthenticationToken) + { + $resourcePath = "/identity/v2/auth/login/2fa/securityquestionanswer"; + $queryParam = []; + $queryParam['apiKey'] = Functions::getApiKey(); + if ($secondFactorAuthenticationToken === '' || ctype_space($secondFactorAuthenticationToken)) { + throw new LoginRadiusException(Functions::paramValidationMsg('secondFactorAuthenticationToken')); + } + $queryParam['secondFactorAuthenticationToken'] = $secondFactorAuthenticationToken; + return Functions::_apiClientHandler('PUT', $resourcePath, $queryParam, $securityQuestionAnswerUpdateModel); + } + + + + /** + * This API is used to resending the verification OTP to the provided phone number + * @param securityQuestionAnswerUpdateModel payload + * @param secondFactorAuthenticationToken SecondFactorAuthenticationToken + * @param rbaBrowserEmailTemplate RbaBrowserEmailTemplate + * @param rbaCityEmailTemplate RbaCityEmailTemplate + * @param rbaCountryEmailTemplate RbaCountryEmailTemplate + * @param rbaIpEmailTemplate RbaIpEmailTemplate + * @return Response Containing Access Token and Complete Profile Data + * 9.27 + */ + + public function mfaSecurityQuestionAnswerVerification($securityQuestionAnswerUpdateModel, $secondFactorAuthenticationToken, + $rbaBrowserEmailTemplate = null, $rbaCityEmailTemplate = null, $rbaCountryEmailTemplate = null, + $rbaIpEmailTemplate = null) + { + $resourcePath = "/identity/v2/auth/login/2fa/verification/securityquestionanswer"; + $queryParam = []; + $queryParam['apiKey'] = Functions::getApiKey(); + if ($secondFactorAuthenticationToken === '' || ctype_space($secondFactorAuthenticationToken)) { + throw new LoginRadiusException(Functions::paramValidationMsg('secondFactorAuthenticationToken')); + } + if ($rbaBrowserEmailTemplate != '') { + $queryParam['rbaBrowserEmailTemplate'] = $rbaBrowserEmailTemplate; + } + if ($rbaCityEmailTemplate != '') { + $queryParam['rbaCityEmailTemplate'] = $rbaCityEmailTemplate; + } + if ($rbaCountryEmailTemplate != '') { + $queryParam['rbaCountryEmailTemplate'] = $rbaCountryEmailTemplate; + } + if ($rbaIpEmailTemplate != '') { + $queryParam['rbaIpEmailTemplate'] = $rbaIpEmailTemplate; + } + $queryParam['secondFactorAuthenticationToken'] = $secondFactorAuthenticationToken; + return Functions::_apiClientHandler('POST', $resourcePath, $queryParam, $securityQuestionAnswerUpdateModel); + } + + + /** * This API resets the SMS Authenticator configurations on a given account via the UID. * @param otpauthenticator Pass 'otpauthenticator' to remove SMS Authenticator @@ -601,5 +909,49 @@ public function mfaResetBackupCodeByUid($uid) $queryParam['uid'] = $uid; return Functions::_apiClientHandler('GET', $resourcePath, $queryParam); } + + + + /** + * This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user. + * @param uid UID, the unified identifier for each user account + * @return Response containing Definition of Delete Request + * 18.42 + */ + + public function mfaResetEmailOtpAuthenticatorByUid($uid) + { + $resourcePath = "/identity/v2/manage/account/2fa/authenticator/otp/email"; + $queryParam = []; + $queryParam['apiKey'] = Functions::getApiKey(); + $queryParam['apiSecret'] = Functions::getApiSecret(); + if ($uid === '' || ctype_space($uid)) { + throw new LoginRadiusException(Functions::paramValidationMsg('uid')); + } + $queryParam['uid'] = $uid; + return Functions::_apiClientHandler('DELETE', $resourcePath, $queryParam); + } + + + + /** + * This API is used to reset the Security Question Authenticator settings for an MFA-enabled user. + * @param uid UID, the unified identifier for each user account + * @return Response containing Definition of Delete Request + * 18.43 + */ + + public function mfaResetSecurityQuestionAuthenticatorByUid($uid) + { + $resourcePath = "/identity/v2/manage/account/2fa/authenticator/securityquestionanswer"; + $queryParam = []; + $queryParam['apiKey'] = Functions::getApiKey(); + $queryParam['apiSecret'] = Functions::getApiSecret(); + if ($uid === '' || ctype_space($uid)) { + throw new LoginRadiusException(Functions::paramValidationMsg('uid')); + } + $queryParam['uid'] = $uid; + return Functions::_apiClientHandler('DELETE', $resourcePath, $queryParam); + } } \ No newline at end of file diff --git a/src/LoginRadiusSDK/CustomerRegistration/Advanced/ReAuthenticationAPI.php b/src/LoginRadiusSDK/CustomerRegistration/Advanced/ReAuthenticationAPI.php index 6ccf41f..df6725b 100644 --- a/src/LoginRadiusSDK/CustomerRegistration/Advanced/ReAuthenticationAPI.php +++ b/src/LoginRadiusSDK/CustomerRegistration/Advanced/ReAuthenticationAPI.php @@ -221,5 +221,80 @@ public function verifyPINAuthentication($accessToken, $pinAuthEventBasedAuthMode $queryParam['access_token'] = $accessToken; return Functions::_apiClientHandler('PUT', $resourcePath, $queryParam, $pinAuthEventBasedAuthModelWithLockout); } + + + + /** + * This API is used to validate the triggered MFA authentication flow with an Email OTP. + * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + * @param reauthByEmailOtpModel payload + * @return Response containing Definition response of MFA reauthentication + * 42.14 + */ + + public function reAuthValidateEmailOtp($accessToken, $reauthByEmailOtpModel) + { + $resourcePath = "/identity/v2/auth/account/reauth/2fa/otp/email/verify"; + $queryParam = []; + if ($accessToken === '' || ctype_space($accessToken)) { + throw new LoginRadiusException(Functions::paramValidationMsg('accessToken')); + } + $queryParam['apiKey'] = Functions::getApiKey(); + $queryParam['access_token'] = $accessToken; + return Functions::_apiClientHandler('PUT', $resourcePath, $queryParam, $reauthByEmailOtpModel); + } + + + + /** + * This API is used to send the MFA Email OTP to the email for Re-authentication + * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + * @param emailId EmailId + * @param emailTemplate2FA EmailTemplate2FA + * @return Response containing Definition of Complete Validation data + * 42.15 + */ + + public function reAuthSendEmailOtp($accessToken, $emailId, + $emailTemplate2FA = null) + { + $resourcePath = "/identity/v2/auth/account/reauth/2fa/otp/email"; + $queryParam = []; + if ($accessToken === '' || ctype_space($accessToken)) { + throw new LoginRadiusException(Functions::paramValidationMsg('accessToken')); + } + $queryParam['apiKey'] = Functions::getApiKey(); + if ($emailId === '' || ctype_space($emailId)) { + throw new LoginRadiusException(Functions::paramValidationMsg('emailId')); + } + if ($emailTemplate2FA != '') { + $queryParam['emailTemplate2FA'] = $emailTemplate2FA; + } + $queryParam['access_token'] = $accessToken; + $queryParam['emailId'] = $emailId; + return Functions::_apiClientHandler('GET', $resourcePath, $queryParam); + } + + + + /** + * This API is used to validate the triggered MFA re-authentication flow with security questions answers. + * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication. + * @param securityQuestionAnswerUpdateModel payload + * @return Response containing Definition response of MFA reauthentication + * 42.16 + */ + + public function reAuthBySecurityQuestion($accessToken, $securityQuestionAnswerUpdateModel) + { + $resourcePath = "/identity/v2/auth/account/reauth/2fa/securityquestionanswer/verify"; + $queryParam = []; + if ($accessToken === '' || ctype_space($accessToken)) { + throw new LoginRadiusException(Functions::paramValidationMsg('accessToken')); + } + $queryParam['apiKey'] = Functions::getApiKey(); + $queryParam['access_token'] = $accessToken; + return Functions::_apiClientHandler('POST', $resourcePath, $queryParam, $securityQuestionAnswerUpdateModel); + } } \ No newline at end of file diff --git a/src/LoginRadiusSDK/CustomerRegistration/Authentication/AuthenticationAPI.php b/src/LoginRadiusSDK/CustomerRegistration/Authentication/AuthenticationAPI.php index a2bc191..0dd82f1 100644 --- a/src/LoginRadiusSDK/CustomerRegistration/Authentication/AuthenticationAPI.php +++ b/src/LoginRadiusSDK/CustomerRegistration/Authentication/AuthenticationAPI.php @@ -177,11 +177,15 @@ public function getAccessTokenInfo($accessToken) * This API retrieves a copy of the user data based on the access token. * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication. * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields + * @param emailTemplate + * @param verificationUrl + * @param welcomeEmailTemplate * @return Response containing Definition for Complete profile data * 5.2 */ - public function getProfileByAccessToken($accessToken, $fields = "") + public function getProfileByAccessToken($accessToken, $fields = "", + $emailTemplate = null, $verificationUrl = null, $welcomeEmailTemplate = null) { $resourcePath = "/identity/v2/auth/account"; $queryParam = []; @@ -192,6 +196,15 @@ public function getProfileByAccessToken($accessToken, $fields = "") if ($fields != '') { $queryParam['fields'] = $fields; } + if ($emailTemplate != '') { + $queryParam['emailTemplate'] = $emailTemplate; + } + if ($verificationUrl != '') { + $queryParam['verificationUrl'] = $verificationUrl; + } + if ($welcomeEmailTemplate != '') { + $queryParam['welcomeEmailTemplate'] = $welcomeEmailTemplate; + } $queryParam['access_token'] = $accessToken; return Functions::_apiClientHandler('GET', $resourcePath, $queryParam); } @@ -340,6 +353,44 @@ public function unlockAccountByToken($accessToken, $unlockProfileModel) + /** + * This API is used to get a user's profile using the clientGuid parameter if no callback feature enabled + * @param clientGuid ClientGuid + * @param emailTemplate EmailTemplate + * @param fields Fields + * @param verificationUrl VerificationUrl + * @param welcomeEmailTemplate WelcomeEmailTemplate + * @return Response containing User Profile Data and access token + * 5.16 + */ + + public function getProfileByPing($clientGuid, $emailTemplate = null, + $fields = "", $verificationUrl = null, $welcomeEmailTemplate = null) + { + $resourcePath = "/identity/v2/auth/account/ping"; + $queryParam = []; + $queryParam['apiKey'] = Functions::getApiKey(); + if ($clientGuid === '' || ctype_space($clientGuid)) { + throw new LoginRadiusException(Functions::paramValidationMsg('clientGuid')); + } + if ($emailTemplate != '') { + $queryParam['emailTemplate'] = $emailTemplate; + } + if ($fields != '') { + $queryParam['fields'] = $fields; + } + if ($verificationUrl != '') { + $queryParam['verificationUrl'] = $verificationUrl; + } + if ($welcomeEmailTemplate != '') { + $queryParam['welcomeEmailTemplate'] = $welcomeEmailTemplate; + } + $queryParam['clientGuid'] = $clientGuid; + return Functions::_apiClientHandler('GET', $resourcePath, $queryParam); + } + + + /** * This API is used to check the email exists or not on your site. * @param email Email of the user diff --git a/src/LoginRadiusSDK/CustomerRegistration/Authentication/PasswordLessLoginAPI.php b/src/LoginRadiusSDK/CustomerRegistration/Authentication/PasswordLessLoginAPI.php index 98ad5e4..1e3b620 100644 --- a/src/LoginRadiusSDK/CustomerRegistration/Authentication/PasswordLessLoginAPI.php +++ b/src/LoginRadiusSDK/CustomerRegistration/Authentication/PasswordLessLoginAPI.php @@ -160,5 +160,47 @@ public function passwordlessLoginVerification($verificationToken, $fields = "", $queryParam['verificationToken'] = $verificationToken; return Functions::_apiClientHandler('GET', $resourcePath, $queryParam); } + + + + /** + * This API is used to verify the otp sent to the email when doing a passwordless login. + * @param passwordLessLoginByEmailAndOtpModel payload + * @param fields Fields + * @return Response containing User Profile Data and access token + * 9.23 + */ + + public function passwordlessLoginVerificationByEmailAndOTP($passwordLessLoginByEmailAndOtpModel, $fields = "") + { + $resourcePath = "/identity/v2/auth/login/passwordlesslogin/email/verifyotp"; + $queryParam = []; + $queryParam['apiKey'] = Functions::getApiKey(); + if ($fields != '') { + $queryParam['fields'] = $fields; + } + return Functions::_apiClientHandler('POST', $resourcePath, $queryParam, $passwordLessLoginByEmailAndOtpModel); + } + + + + /** + * This API is used to verify the otp sent to the email when doing a passwordless login. + * @param passwordLessLoginByUserNameAndOtpModel payload + * @param fields Fields + * @return Response containing User Profile Data and access token + * 9.24 + */ + + public function passwordlessLoginVerificationByUserNameAndOTP($passwordLessLoginByUserNameAndOtpModel, $fields = "") + { + $resourcePath = "/identity/v2/auth/login/passwordlesslogin/username/verifyotp"; + $queryParam = []; + $queryParam['apiKey'] = Functions::getApiKey(); + if ($fields != '') { + $queryParam['fields'] = $fields; + } + return Functions::_apiClientHandler('POST', $resourcePath, $queryParam, $passwordLessLoginByUserNameAndOtpModel); + } } \ No newline at end of file diff --git a/src/LoginRadiusSDK/CustomerRegistration/Social/SocialAPI.php b/src/LoginRadiusSDK/CustomerRegistration/Social/SocialAPI.php index 1b2e9ac..9679949 100644 --- a/src/LoginRadiusSDK/CustomerRegistration/Social/SocialAPI.php +++ b/src/LoginRadiusSDK/CustomerRegistration/Social/SocialAPI.php @@ -798,30 +798,6 @@ public function trackableStatusFetching($postId) - /** - * The User Profile API is used to get social profile data from the user's social account after authentication.

Supported Providers: All - * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - * @param fields The fields parameter filters the API response so that the response only includes a specific set of fields - * @return Response containing Definition for Complete UserProfile data - * 38.1 - */ - - public function getSocialUserProfile($accessToken, $fields = "") - { - $resourcePath = "/api/v2/userprofile"; - $queryParam = []; - if ($accessToken === '' || ctype_space($accessToken)) { - throw new LoginRadiusException(Functions::paramValidationMsg('accessToken')); - } - if ($fields != '') { - $queryParam['fields'] = $fields; - } - $queryParam['access_token'] = $accessToken; - return Functions::_apiClientHandler('GET', $resourcePath, $queryParam); - } - - - /** * 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. * @param accessToken Uniquely generated identifier key by LoginRadius that is activated after successful authentication. diff --git a/src/LoginRadiusSDK/LoginRadiusException.php b/src/LoginRadiusSDK/LoginRadiusException.php index 2964d5d..ab78128 100644 --- a/src/LoginRadiusSDK/LoginRadiusException.php +++ b/src/LoginRadiusSDK/LoginRadiusException.php @@ -5,7 +5,7 @@ * @category : LoginRadiusSDK * @package : LoginRadiusException * @author : LoginRadius Team - * @version : 11.1.1 + * @version : 11.2.0 * @license : https://opensource.org/licenses/MIT */ namespace LoginRadiusSDK; diff --git a/src/LoginRadiusSDK/Utility/Functions.php b/src/LoginRadiusSDK/Utility/Functions.php index 1580549..0498e86 100644 --- a/src/LoginRadiusSDK/Utility/Functions.php +++ b/src/LoginRadiusSDK/Utility/Functions.php @@ -5,7 +5,7 @@ * @category : Utility * @package : Functions * @author : LoginRadius Team - * @version : 11.1.1 + * @version : 11.2.0 * @license : https://opensource.org/licenses/MIT */ @@ -23,7 +23,7 @@ class Functions { - const VERSION = '11.1.1'; + const VERSION = '11.2.0'; private static $_apikey; private static $_apisecret;