Skip to content

Latest commit

 

History

History
378 lines (276 loc) · 15.3 KB

password.md

File metadata and controls

378 lines (276 loc) · 15.3 KB

Password

7 operation(s). Part of the API index.

Call these as $client-><service>-><method>(...). <service> is the client field for this group — the README lists the field name for every service. These pages group operations the way the OpenAPI specification tags them, which is not always one field per page.


changePassword

PUT /identity/v2/auth/password/change

Update Password

Updates the Account Password using the current Password for verification.

Example

function callChangePassword($client) {
    $changePassword = new \LoginRadius\Sdk\Internal\OpenApi\Model\ChangePassword(['oldPassword' => '<oldPassword>', 'newPassword' => '<newPassword>']); //Required
    $gRecaptchaResponse = '<gRecaptchaResponse>'; //Optional
    $gRecaptchaResponse2 = '<gRecaptchaResponse2>'; //Optional
    $preventWebhook = true; //Optional
    $xPreventWebhook = true; //Optional
    $hCaptchaResponse = '<hCaptchaResponse>'; //Optional
    $qqCaptchaTicket = '<qqCaptchaTicket>'; //Optional
    $qqCaptchaRandstr = '<qqCaptchaRandstr>'; //Optional
    $accessToken = '<accessToken>'; //Optional

    try {
        $response = $client->password->changePassword($changePassword, gRecaptchaResponse: $gRecaptchaResponse, gRecaptchaResponse2: $gRecaptchaResponse2, preventWebhook: $preventWebhook, xPreventWebhook: $xPreventWebhook, hCaptchaResponse: $hCaptchaResponse, qqCaptchaTicket: $qqCaptchaTicket, qqCaptchaRandstr: $qqCaptchaRandstr, accessToken: $accessToken);
        echo $response;
    } catch (\LoginRadius\Sdk\Internal\OpenApi\ApiException $e) {
        $lr = \LoginRadius\Sdk\Client::toLoginRadiusException($e);
        echo $lr->description();
    }
}

Parameters

Name In Type Required Description
g-recaptcha-response query string no Google reCAPTCHA response parameter which will be sent to the server for verification.
g_recaptcha_response query string no Google reCAPTCHA Response
prevent_webhook query boolean no When true, suppresses webhook events for this operation.
X-PreventWebhook header boolean no When true, suppresses webhook events for this operation.
h-captcha-response query string no hCaptcha Response
qq_captcha_ticket query string no QQ Captcha ticket (required if Bot Protection is enabled)
qq_captcha_randstr query string no QQ Captcha rand string (required if Bot Protection is enabled)
access_token query string no Access Token of the User

Request body

changePassword as application/json.

Returns

IsPostedResponse


forgotPassword

POST /identity/v2/auth/password

Forgot Password

Initiates the Password recovery process using Username or Email.

Example

function callForgotPassword($client) {
    $emailtemplate = '<emailtemplate>'; //Optional
    $resetpasswordurl = '<resetpasswordurl>'; //Optional
    $preventWebhook = true; //Optional
    $xPreventWebhook = true; //Optional
    $gRecaptchaResponse = '<gRecaptchaResponse>'; //Optional
    $gRecaptchaResponse2 = '<gRecaptchaResponse2>'; //Optional
    $qqCaptchaTicket = '<qqCaptchaTicket>'; //Optional
    $qqCaptchaRandstr = '<qqCaptchaRandstr>'; //Optional
    $hCaptchaResponse = '<hCaptchaResponse>'; //Optional
    $forgotPasswordRequest = new \LoginRadius\Sdk\Internal\OpenApi\Model\ForgotPasswordRequest(['email' => '<email>', 'userName' => '<userName>', 'gRecaptchaResponse' => '<gRecaptchaResponse>']); //Optional

    try {
        $response = $client->password->forgotPassword($forgotPasswordRequest, emailtemplate: $emailtemplate, resetpasswordurl: $resetpasswordurl, preventWebhook: $preventWebhook, xPreventWebhook: $xPreventWebhook, gRecaptchaResponse: $gRecaptchaResponse, gRecaptchaResponse2: $gRecaptchaResponse2, qqCaptchaTicket: $qqCaptchaTicket, qqCaptchaRandstr: $qqCaptchaRandstr, hCaptchaResponse: $hCaptchaResponse);
        echo $response;
    } catch (\LoginRadius\Sdk\Internal\OpenApi\ApiException $e) {
        $lr = \LoginRadius\Sdk\Client::toLoginRadiusException($e);
        echo $lr->description();
    }
}

Parameters

Name In Type Required Description
emailtemplate query string no Name of the Email template to use for this notification.
resetpasswordurl query string no Callback URL for the Password Reset link in the Email.
prevent_webhook query boolean no When true, suppresses webhook events for this operation.
X-PreventWebhook header boolean no When true, suppresses webhook events for this operation.
g-recaptcha-response query string no Google reCAPTCHA response parameter which will be sent to the server for verification.
g_recaptcha_response query string no Google reCAPTCHA Response
qq_captcha_ticket query string no QQ reCAPTCHA Response
qq_captcha_randstr query string no QQ reCAPTCHA Response
h-captcha-response query string no hCaptcha Response

Request body

object as application/json.

Returns

IsPostedResponse


requestOTPForPasswordReset

POST /identity/v2/auth/password/otp

Retrieve Password reset OTP

Requests an OTP for resetting the Password using the User's Phone number.

Example

function callRequestOTPForPasswordReset($client) {
    $forgotPasswordPhoneModel = new \LoginRadius\Sdk\Internal\OpenApi\Model\ForgotPasswordPhoneModel(['phone' => '<phone>']); //Required
    $smstemplate = '<smstemplate>'; //Optional
    $gRecaptchaResponse = '<gRecaptchaResponse>'; //Optional
    $gRecaptchaResponse2 = '<gRecaptchaResponse2>'; //Optional
    $hCaptchaResponse = '<hCaptchaResponse>'; //Optional
    $qqCaptchaTicket = '<qqCaptchaTicket>'; //Optional
    $qqCaptchaRandstr = '<qqCaptchaRandstr>'; //Optional
    $isvoiceotp = true; //Optional

    try {
        $response = $client->password->requestOTPForPasswordReset($forgotPasswordPhoneModel, smstemplate: $smstemplate, gRecaptchaResponse: $gRecaptchaResponse, gRecaptchaResponse2: $gRecaptchaResponse2, hCaptchaResponse: $hCaptchaResponse, qqCaptchaTicket: $qqCaptchaTicket, qqCaptchaRandstr: $qqCaptchaRandstr, isvoiceotp: $isvoiceotp);
        echo $response;
    } catch (\LoginRadius\Sdk\Internal\OpenApi\ApiException $e) {
        $lr = \LoginRadius\Sdk\Client::toLoginRadiusException($e);
        echo $lr->description();
    }
}

Parameters

Name In Type Required Description
smstemplate query string no SMS Template
g-recaptcha-response query string no Google reCAPTCHA response parameter which will be sent to the server for verification.
g_recaptcha_response query string no Google reCAPTCHA Response
h-captcha-response query string no hCaptcha Response
qq_captcha_ticket query string no QQ Captcha ticket (required if Bot Protection is enabled)
qq_captcha_randstr query string no QQ Captcha rand string (required if Bot Protection is enabled)
isvoiceotp query boolean no Boolean flag to enforce sending SMS content via Voice.

Request body

ForgotPasswordPhoneModel as application/json.

Returns

SMSResponse


resetPassword

PUT /identity/v2/auth/password/reset

Reset Password with token and OTP

Sets a new Password for the specified Account using a reset token and OTP.

Example

function callResetPassword($client) {
    $resetPassword = new \LoginRadius\Sdk\Internal\OpenApi\Model\ResetPassword(['resetToken' => '<resetToken>', 'password' => '<password>', 'otp' => '<otp>', 'email' => '<email>', 'username' => '<username>']); //Required
    $gRecaptchaResponse = '<gRecaptchaResponse>'; //Optional
    $gRecaptchaResponse2 = '<gRecaptchaResponse2>'; //Optional
    $preventWebhook = true; //Optional
    $xPreventWebhook = true; //Optional
    $hCaptchaResponse = '<hCaptchaResponse>'; //Optional
    $qqCaptchaTicket = '<qqCaptchaTicket>'; //Optional
    $qqCaptchaRandstr = '<qqCaptchaRandstr>'; //Optional

    try {
        $response = $client->password->resetPassword($resetPassword, gRecaptchaResponse: $gRecaptchaResponse, gRecaptchaResponse2: $gRecaptchaResponse2, preventWebhook: $preventWebhook, xPreventWebhook: $xPreventWebhook, hCaptchaResponse: $hCaptchaResponse, qqCaptchaTicket: $qqCaptchaTicket, qqCaptchaRandstr: $qqCaptchaRandstr);
        echo $response;
    } catch (\LoginRadius\Sdk\Internal\OpenApi\ApiException $e) {
        $lr = \LoginRadius\Sdk\Client::toLoginRadiusException($e);
        echo $lr->description();
    }
}

Parameters

Name In Type Required Description
g-recaptcha-response query string no Google reCAPTCHA response parameter which will be sent to the server for verification.
g_recaptcha_response query string no Google reCAPTCHA Response
prevent_webhook query boolean no When true, suppresses webhook events for this operation.
X-PreventWebhook header boolean no When true, suppresses webhook events for this operation.
h-captcha-response query string no hCaptcha Response
qq_captcha_ticket query string no QQ Captcha ticket (required if Bot Protection is enabled)
qq_captcha_randstr query string no QQ Captcha rand string (required if Bot Protection is enabled)

Request body

ResetPassword as application/json.

Returns

ResetPasswordResponse


resetPasswordByResetToken

PUT /identity/v2/auth/password

Reset Password with token and OTP

Sets a new Password for the specified Account using a reset token and OTP.

Example

function callResetPasswordByResetToken($client) {
    $resetPassword = new \LoginRadius\Sdk\Internal\OpenApi\Model\ResetPassword(['resetToken' => '<resetToken>', 'password' => '<password>', 'otp' => '<otp>', 'email' => '<email>', 'username' => '<username>']); //Required
    $gRecaptchaResponse = '<gRecaptchaResponse>'; //Optional
    $gRecaptchaResponse2 = '<gRecaptchaResponse2>'; //Optional
    $preventWebhook = true; //Optional
    $xPreventWebhook = true; //Optional
    $hCaptchaResponse = '<hCaptchaResponse>'; //Optional
    $qqCaptchaTicket = '<qqCaptchaTicket>'; //Optional
    $qqCaptchaRandstr = '<qqCaptchaRandstr>'; //Optional

    try {
        $response = $client->password->resetPasswordByResetToken($resetPassword, gRecaptchaResponse: $gRecaptchaResponse, gRecaptchaResponse2: $gRecaptchaResponse2, preventWebhook: $preventWebhook, xPreventWebhook: $xPreventWebhook, hCaptchaResponse: $hCaptchaResponse, qqCaptchaTicket: $qqCaptchaTicket, qqCaptchaRandstr: $qqCaptchaRandstr);
        echo $response;
    } catch (\LoginRadius\Sdk\Internal\OpenApi\ApiException $e) {
        $lr = \LoginRadius\Sdk\Client::toLoginRadiusException($e);
        echo $lr->description();
    }
}

Parameters

Name In Type Required Description
g-recaptcha-response query string no Google reCAPTCHA response parameter which will be sent to the server for verification.
g_recaptcha_response query string no Google reCAPTCHA Response
prevent_webhook query boolean no When true, suppresses webhook events for this operation.
X-PreventWebhook header boolean no When true, suppresses webhook events for this operation.
h-captcha-response query string no hCaptcha Response
qq_captcha_ticket query string no QQ Captcha ticket (required if Bot Protection is enabled)
qq_captcha_randstr query string no QQ Captcha rand string (required if Bot Protection is enabled)

Request body

ResetPassword as application/json.

Returns

ResetPasswordResponse


resetPasswordSecurityAnswer

PUT /identity/v2/auth/password/securityanswer

Reset Password with security question

Resets the Password using a security question and Email, Username, or Phone.

Example

function callResetPasswordSecurityAnswer($client) {
    $preventWebhook = true; //Optional
    $xPreventWebhook = true; //Optional
    $resetPasswordBySecurityAnswer = new \LoginRadius\Sdk\Internal\OpenApi\Model\ResetPasswordBySecurityAnswer(['securityAnswer' => '<securityAnswer>', 'password' => '<password>']); //Optional

    try {
        $response = $client->password->resetPasswordSecurityAnswer($resetPasswordBySecurityAnswer, preventWebhook: $preventWebhook, xPreventWebhook: $xPreventWebhook);
        echo $response;
    } catch (\LoginRadius\Sdk\Internal\OpenApi\ApiException $e) {
        $lr = \LoginRadius\Sdk\Client::toLoginRadiusException($e);
        echo $lr->description();
    }
}

Parameters

Name In Type Required Description
prevent_webhook query boolean no When true, suppresses webhook events for this operation.
X-PreventWebhook header boolean no When true, suppresses webhook events for this operation.

Request body

ResetPasswordBySecurityAnswer as application/json.

Returns

ResetPasswordResponse


resetPasswordWithOTP

PUT /identity/v2/auth/password/otp

Reset Password with Phone and OTP

Resets the Password using OTP and Phone number verification.

Example

function callResetPasswordWithOTP($client) {
    $resetPasswordWithOTP = new \LoginRadius\Sdk\Internal\OpenApi\Model\ResetPasswordWithOTP(['password' => '<password>', 'otp' => '<otp>', 'phone' => '<phone>']); //Required
    $gRecaptchaResponse = '<gRecaptchaResponse>'; //Optional
    $gRecaptchaResponse2 = '<gRecaptchaResponse2>'; //Optional
    $preventWebhook = true; //Optional
    $xPreventWebhook = true; //Optional
    $hCaptchaResponse = '<hCaptchaResponse>'; //Optional
    $qqCaptchaTicket = '<qqCaptchaTicket>'; //Optional
    $qqCaptchaRandstr = '<qqCaptchaRandstr>'; //Optional

    try {
        $response = $client->password->resetPasswordWithOTP($resetPasswordWithOTP, gRecaptchaResponse: $gRecaptchaResponse, gRecaptchaResponse2: $gRecaptchaResponse2, preventWebhook: $preventWebhook, xPreventWebhook: $xPreventWebhook, hCaptchaResponse: $hCaptchaResponse, qqCaptchaTicket: $qqCaptchaTicket, qqCaptchaRandstr: $qqCaptchaRandstr);
        echo $response;
    } catch (\LoginRadius\Sdk\Internal\OpenApi\ApiException $e) {
        $lr = \LoginRadius\Sdk\Client::toLoginRadiusException($e);
        echo $lr->description();
    }
}

Parameters

Name In Type Required Description
g-recaptcha-response query string no Google reCAPTCHA response parameter which will be sent to the server for verification.
g_recaptcha_response query string no Google reCAPTCHA Response
prevent_webhook query boolean no When true, suppresses webhook events for this operation.
X-PreventWebhook header boolean no When true, suppresses webhook events for this operation.
h-captcha-response query string no hCaptcha Response
qq_captcha_ticket query string no QQ Captcha ticket (required if Bot Protection is enabled)
qq_captcha_randstr query string no QQ Captcha rand string (required if Bot Protection is enabled)

Request body

ResetPasswordWithOTP as application/json.

Returns

ResetPasswordResponse