Download the PHP package loginradius/php-sdk-2.0 without Composer

On this page you can find all versions of the php package loginradius/php-sdk-2.0. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-sdk-2.0

LoginRadius

Home Image


LoginRadius PHP wrapper provides access to LoginRadius.

LoginRadius is a unified Customer Identity Management API platform that combines 30 major social platforms into a single simplified and maintenance-free API. With LoginRadius' API, websites and mobile apps can implement capture user profile data, enable social login, enable social sharing, add single sign-on and many more.

LoginRadius helps businesses boost user engagement on their web/mobile platform, manage online identities, utilize social media for marketing, capture accurate consumer data and get unique social insight into their customer base.

PHP Library


Disclaimer

This library is meant to help you with a quick implementation of the LoginRadius platform and also to serve as a reference point for the LoginRadius API. Keep in mind that it is an open source library, which means you are free to download and customize the library functions based on your specific application needs.

Installation

The recommended way to install is through Composer.

Install Composer

Next, run the Composer command to install the latest stable version of library:

Include the following files in your Project Directory

Modify the config.php file in the SDK to include your LoginRadius Credentials

Quickstart Guide

Configuration

After successful install, you need to define the following LoginRadius Account info in your project anywhere before using the LoginRadius SDK or in the config file of your project:

Replace 'LOGINRADIUS_SITE_NAME_HERE', 'LOGINRADIUS_API_KEY_HERE' and 'LOGINRADIUS_API_SECRET_HERE' in the above code with your LoginRadius Site Name, LoginRadius API Key, and Secret.This information can be found in your LoginRadius account as described here.

API Request Signing:- define('API_REQUEST_SIGNING', true); When initializing the SDK, you can optionally specify enabling this feature. Enabling this feature means the customer does not need to pass an API secret in an API request. Instead, they can pass a dynamically generated hash value. This feature will also make sure that the message is not tampered during transit when someone calls our APIs.

Pass the proxy configurations if you want to set Http Server Proxy Configuration through your PHP SDK. Protocol, Host and port are required to set Http Server Proxy configuration (username and password are optional).

If you have Custom API Domain then define 'API_DOMAIN' then replaced it with your custom API domain, Otherwise no need to define this option in configuration.

Implementation

Importing/aliasing with the use operator.

Create a LoginRadius object :

API Examples

Partial API response

We have an option to select fields(partial response) which you require as an API response.
For this, you need to pass an extra parameter(optional) at the end of each API function.

Example:

Output Response:

Authentication API

List of APIs in this Section:
PUT : Auth Update Profile by Token
PUT : Auth Unlock Account by Access Token
PUT : Auth Verify Email By OTP
PUT : Auth Reset Password by Security Answer and Email
PUT : Auth Reset Password by Security Answer and Phone
PUT : Auth Reset Password by Security Answer and UserName
PUT : Auth Reset Password by Reset Token
PUT : Auth Reset Password by OTP
PUT : Auth Reset Password by OTP and UserName
PUT : Auth Change Password
PUT : Auth Set or Change UserName
PUT : Auth Resend Email Verification
POST : Auth Add Email
POST : Auth Login by Email
POST : Auth Login by Username
POST : Auth Forgot Password
POST : Auth Link Social Identities
POST : Auth Link Social Identities By Ping
POST : Auth User Registration by Email
POST : Auth User Registration By Captcha
GET : Get Security Questions By Email
GET : Get Security Questions By UserName
GET : Get Security Questions By Phone
GET : Get Security Questions By Access Token
GET : Auth Validate Access token
GET : Access Token Invalidate
GET : Access Token Info
GET : Auth Read all Profiles by Token
GET : Auth Send Welcome Email
GET : Auth Delete Account
GET : Get Profile By Ping
GET : Auth Check Email Availability
GET : Auth Verify Email
GET : Auth Check UserName Availability
GET : Auth Privacy Policy Accept
GET : Auth Privacy Policy History By Access Token
DELETE : Auth Delete Account with Email Confirmation
DELETE : Auth Remove Email
DELETE : Auth Unlink Social Identities

If you have not already initialized the Authentication object do so now

Auth Update Profile by Token (PUT)

This API is used to update the user's profile by passing the access token. More Info

Auth Unlock Account by Access Token (PUT)

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. More Info

Auth Verify Email By OTP (PUT)

This API is used to verify the email of user when the OTP Email verification flow is enabled, please note that you must contact LoginRadius to have this feature enabled. More Info

Auth Reset Password by Security Answer and Email (PUT)

This API is used to reset password for the specified account by security question More Info

Auth Reset Password by Security Answer and Phone (PUT)

This API is used to reset password for the specified account by security question More Info

Auth Reset Password by Security Answer and UserName (PUT)

This API is used to reset password for the specified account by security question More Info

Auth Reset Password by Reset Token (PUT)

This API is used to set a new password for the specified account. More Info

Auth Reset Password by OTP (PUT)

This API is used to set a new password for the specified account. More Info

Auth Reset Password by OTP and UserName (PUT)

This API is used to set a new password for the specified account if you are using the username as the unique identifier in your workflow More Info

Auth Change Password (PUT)

This API is used to change the accounts password based on the previous password More Info

Auth Set or Change UserName (PUT)

This API is used to set or change UserName by access token. More Info

Auth Resend Email Verification (PUT)

This API resends the verification email to the user. More Info

Auth Add Email (POST)

This API is used to add additional emails to a user's account. More Info

Auth Login by Email (POST)

This API retrieves a copy of the user data based on the Email More Info

Auth Login by Username (POST)

This API retrieves a copy of the user data based on the Username More Info

Auth Forgot Password (POST)

This API is used to send the reset password url to a specified account. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' More Info

Auth Link Social Identities (POST)

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. More Info

Auth Link Social Identities By Ping (POST)

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. More Info

Auth User Registration by Email (POST)

This API creates a user in the database as well as sends a verification email to the user. More Info

Auth User Registration By Captcha (POST)

This API creates a user in the database as well as sends a verification email to the user. More Info

Get Security Questions By Email (GET)

This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. More Info

Get Security Questions By UserName (GET)

This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. More Info

Get Security Questions By Phone (GET)

This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. More Info

Get Security Questions By Access Token (GET)

This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. More Info

Auth Validate Access token (GET)

This api validates access token, if valid then returns a response with its expiry otherwise error. More Info

Access Token Invalidate (GET)

This api call invalidates the active access token or expires an access token's validity. More Info

Access Token Info (GET)

This api call provide the active access token Information More Info

Auth Read all Profiles by Token (GET)

This API retrieves a copy of the user data based on the access token. More Info

Auth Send Welcome Email (GET)

This API sends a welcome email More Info

Auth Delete Account (GET)

This API is used to delete an account by passing it a delete token. More Info

Get Profile By Ping (GET)

This API is used to get a user's profile using the clientGuid parameter if no callback feature enabled.More Info

Auth Check Email Availability (GET)

This API is used to check the email exists or not on your site. More Info

Auth Verify Email (GET)

This API is used to verify the email of user. Note: This API will only return the full profile if you have 'Enable auto login after email verification' set in your LoginRadius Admin Console's Email Workflow settings under 'Verification Email'. More Info

Auth Check UserName Availability (GET)

This API is used to check the UserName exists or not on your site. More Info

Auth Privacy Policy Accept (GET)

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 More Info

Auth Privacy Policy History By Access Token (GET)

This API will return all the accepted privacy policies for the user by providing the access token of that user. More Info

Auth Delete Account with Email Confirmation (DELETE)

This API will send a confirmation email for account deletion to the customer's email when passed the customer's access token More Info

Auth Remove Email (DELETE)

This API is used to remove additional emails from a user's account. More Info

Auth Unlink Social Identities (DELETE)

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. More Info

Account API

List of APIs in this Section:
PUT : Account Update
PUT : Update Phone ID by UID
PUT : Account Set Password
PUT : Account Invalidate Verification Email
PUT : Reset phone ID verification
PUT : Upsert Email
PUT : Update UID
POST : Account Create
POST : Forgot Password token
POST : Email Verification token
GET : Get Privacy Policy History By Uid
GET : Account Profiles by Email
GET : Account Profiles by Username
GET : Account Profile by Phone ID
GET : Account Profiles by UID
GET : Account Password
GET : Access Token based on UID or User impersonation API
GET : Refresh Access Token by Refresh Token
GET : Revoke Refresh Token
GET : Account Identities by Email
DELETE : Account Delete
DELETE : Account Remove Email
DELETE : Delete User Profiles By Email

If you have not already initialized the Account object do so now

Account Update (PUT)

This API is used to update the information of existing accounts in your Cloud Storage. See our Advanced API Usage section Here for more capabilities. More Info

Update Phone ID by UID (PUT)

This API is used to update the PhoneId by using the Uid's. Admin can update the PhoneId's for both the verified and unverified profiles. It will directly replace the PhoneId and bypass the OTP verification process. More Info

Account Set Password (PUT)

This API is used to set the password of an account in Cloud Storage. More Info

Account Invalidate Verification Email (PUT)

This API is used to invalidate the Email Verification status on an account. More Info

Reset phone ID verification (PUT)

This API Allows you to reset the phone no verification of an end user’s account. More Info

Upsert Email (PUT)

This API is used to add/upsert another emails in account profile by different-different email types. If the email type is same then it will simply update the existing email, otherwise it will add a new email in Email array. More Info

Update UID (PUT)

This API is used to update a user's Uid. It will update all profiles, custom objects and consent management logs associated with the Uid. More Info

Account Create (POST)

This API is used to create an account in Cloud Storage. This API bypass the normal email verification process and manually creates the user.

In order to use this API, you need to format a JSON request body with all of the mandatory fields More Info

Forgot Password token (POST)

This API Returns a Forgot Password Token it can also be used to send a Forgot Password email to the customer. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' in the body. More Info

Email Verification token (POST)

This API Returns an Email Verification token. More Info

Get Privacy Policy History By Uid (GET)

This API is used to retrieve all of the accepted Policies by the user, associated with their UID. More Info

Account Profiles by Email (GET)

This API is used to retrieve all of the profile data, associated with the specified account by email in Cloud Storage. More Info

Account Profiles by Username (GET)

This API is used to retrieve all of the profile data associated with the specified account by user name in Cloud Storage. More Info

Account Profile by Phone ID (GET)

This API is used to retrieve all of the profile data, associated with the account by phone number in Cloud Storage. More Info

Account Profiles by UID (GET)

This API is used to retrieve all of the profile data, associated with the account by uid in Cloud Storage. More Info

Account Password (GET)

This API use to retrive the hashed password of a specified account in Cloud Storage. More Info

Access Token based on UID or User impersonation API (GET)

The API is used to get LoginRadius access token based on UID. More Info

Refresh Access Token by Refresh Token (GET)

This API is used to refresh an access token via it's associated refresh token. More Info

Revoke Refresh Token (GET)

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. More Info

Account Identities by Email (GET)

Note: This is intended for specific workflows where an email may be associated to multiple UIDs. This API is used to retrieve all of the identities (UID and Profiles), associated with a specified email in Cloud Storage. More Info

Account Delete (DELETE)

This API deletes the Users account and allows them to re-register for a new account. More Info

Account Remove Email (DELETE)

Use this API to Remove emails from a user Account More Info

Delete User Profiles By Email (DELETE)

This API is used to delete all user profiles associated with an Email. More Info

Social API

List of APIs in this Section:
GET : Access Token
GET : Refresh Token
GET : Token Validate
GET : Access Token Invalidate
GET : Get Active Session Details
GET : Get Active Session By Account Id
GET : Get Active Session By Profile Id

If you have not already initialized the Social object do so now

Access Token (GET)

This API Is used to translate the Request Token returned during authentication into an Access Token that can be used with other API calls. More Info

Refresh Token (GET)

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. More Info

Token Validate (GET)

This API validates access token, if valid then returns a response with its expiry otherwise error. More Info

Access Token Invalidate (GET)

This api invalidates the active access token or expires an access token validity. More Info

Get Active Session Details (GET)

This api is use to get all active session by Access Token. More Info

Get Active Session By Account Id (GET)

This api is used to get all active sessions by AccountID(UID). More Info

Get Active Session By Profile Id (GET)

This api is used to get all active sessions by ProfileId. More Info

CustomObject API

List of APIs in this Section:
PUT : Custom Object Update by Access Token
PUT : Custom Object Update by UID
POST : Create Custom Object by Token
POST : Create Custom Object by UID
GET : Custom Object by Token
GET : Custom Object by ObjectRecordId and Token
GET : Custom Object By UID
GET : Custom Object by ObjectRecordId and UID
DELETE : Custom Object Delete by Record Id And Token
DELETE : Account Delete Custom Object by ObjectRecordId

If you have not already initialized the CustomObject object do so now

Custom Object Update by Access Token (PUT)

This API is used to update the specified custom object data of the specified account. If the value of updatetype is 'replace' then it will fully replace custom object with the new custom object and if the value of updatetype is 'partialreplace' then it will perform an upsert type operation More Info

Custom Object Update by UID (PUT)

This API is used to update the specified custom object data of a specified account. If the value of updatetype is 'replace' then it will fully replace custom object with new custom object and if the value of updatetype is partialreplace then it will perform an upsert type operation. More Info

Create Custom Object by Token (POST)

This API is used to write information in JSON format to the custom object for the specified account. More Info

Create Custom Object by UID (POST)

This API is used to write information in JSON format to the custom object for the specified account. More Info

Custom Object by Token (GET)

This API is used to retrieve the specified Custom Object data for the specified account. More Info

Custom Object by ObjectRecordId and Token (GET)

This API is used to retrieve the Custom Object data for the specified account. More Info

Custom Object By UID (GET)

This API is used to retrieve all the custom objects by UID from cloud storage. More Info

Custom Object by ObjectRecordId and UID (GET)

This API is used to retrieve the Custom Object data for the specified account. More Info

Custom Object Delete by Record Id And Token (DELETE)

This API is used to remove the specified Custom Object data using ObjectRecordId of a specified account. More Info

Account Delete Custom Object by ObjectRecordId (DELETE)

This API is used to remove the specified Custom Object data using ObjectRecordId of specified account. More Info

PhoneAuthentication API

List of APIs in this Section:
PUT : Phone Reset Password by OTP
PUT : Phone Verification OTP
PUT : Phone Verification OTP by Token
PUT : Phone Number Update
POST : Phone Login
POST : Phone Forgot Password by OTP
POST : Phone Resend Verification OTP
POST : Phone Resend Verification OTP By Token
POST : Phone User Registration by SMS
GET : Phone Number Availability
DELETE : Remove Phone ID by Access Token

If you have not already initialized the PhoneAuthentication object do so now

Phone Reset Password by OTP (PUT)

This API is used to reset the password More Info

Phone Verification OTP (PUT)

This API is used to validate the verification code sent to verify a user's phone number More Info

Phone Verification OTP by Token (PUT)

This API is used to consume the verification code sent to verify a user's phone number. Use this call for front-end purposes in cases where the user is already logged in by passing the user's access token. More Info

Phone Number Update (PUT)

This API is used to update the login Phone Number of users More Info

Phone Login (POST)

This API retrieves a copy of the user data based on the Phone More Info

Phone Forgot Password by OTP (POST)

This API is used to send the OTP to reset the account password. More Info

Phone Resend Verification OTP (POST)

This API is used to resend a verification OTP to verify a user's Phone Number. The user will receive a verification code that they will need to input More Info

Phone Resend Verification OTP By Token (POST)

This API is used to resend a verification OTP to verify a user's Phone Number in cases in which an active token already exists More Info

Phone User Registration by SMS (POST)

This API registers the new users into your Cloud Storage and triggers the phone verification process. More Info

Phone Number Availability (GET)

This API is used to check the Phone Number exists or not on your site. More Info

Remove Phone ID by Access Token (DELETE)

This API is used to delete the Phone ID on a user's account via the access token More Info

MultiFactorAuthentication API

List of APIs in this Section:
PUT : Update MFA Setting
PUT : Update MFA by Access Token
PUT : MFA Update Phone Number by Token
PUT : Verify MFA Email OTP by Access Token
PUT : Update MFA Security Question by Access Token
PUT : MFA Validate OTP
PUT : MFA Validate Google Auth Code
PUT : MFA Validate Backup code
PUT : MFA Update Phone Number
PUT : Verify MFA Email OTP by MFA Token
PUT : Update MFA Security Question by MFA Token
POST : MFA Email Login
POST : MFA UserName Login
POST : MFA Phone Login
POST : Send MFA Email OTP by MFA Token
POST : Verify MFA Security Question by MFA Token
GET : MFA Validate Access Token
GET : MFA Backup Code by Access Token
GET : Reset Backup Code by Access Token
GET : Send MFA Email OTP by Access Token
GET : MFA Resend Otp
GET : MFA Backup Code by UID
GET : MFA Reset Backup Code by UID
DELETE : MFA Reset Google Authenticator by Token
DELETE : MFA Reset SMS Authenticator by Token
DELETE : Reset MFA Email OTP Authenticator By Access Token
DELETE : MFA Reset Security Question Authenticator By Access Token
DELETE : MFA Reset SMS Authenticator By UID
DELETE : MFA Reset Google Authenticator By UID
DELETE : Reset MFA Email OTP Authenticator Settings by Uid
DELETE : Reset MFA Security Question Authenticator Settings by Uid

If you have not already initialized the MultiFactorAuthentication object do so now

Update MFA Setting (PUT)

This API is used to trigger the Multi-factor authentication settings after login for secure actions More Info

Update MFA by Access Token (PUT)

This API is used to Enable Multi-factor authentication by access token on user login More Info

MFA Update Phone Number by Token (PUT)

This API is used to update the Multi-factor authentication phone number by sending the verification OTP to the provided phone number More Info

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

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

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

MFA Validate Google Auth Code (PUT)

This API is used to login via Multi-factor-authentication by passing the google authenticator code. More Info

MFA Validate Backup code (PUT)

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 More Info

MFA Update Phone Number (PUT)

This API is used to update (if configured) the phone number used for Multi-factor authentication by sending the verification OTP to the provided phone number More Info

Verify MFA Email OTP by MFA Token (PUT)

This API is used to Verify MFA Email OTP by MFA Token More Info

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

MFA Email Login (POST)

This API can be used to login by emailid on a Multi-factor authentication enabled LoginRadius site. More Info

MFA UserName Login (POST)

This API can be used to login by username on a Multi-factor authentication enabled LoginRadius site. More Info

MFA Phone Login (POST)

This API can be used to login by Phone on a Multi-factor authentication enabled LoginRadius site. More Info

Send MFA Email OTP by MFA Token (POST)

An API designed to send the MFA Email OTP to the email. More Info

Verify MFA Security Question by MFA Token (POST)

This API is used to resending the verification OTP to the provided phone number More Info

MFA Validate Access Token (GET)

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. More Info

MFA Backup Code by Access Token (GET)

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 More Info

Reset Backup Code by Access Token (GET)

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 More Info

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

MFA Resend Otp (GET)

This API is used to resending the verification OTP to the provided phone number More Info

MFA Backup Code by UID (GET)

This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once. More Info

MFA Reset Backup Code by UID (GET)

This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once. More Info

MFA Reset Google Authenticator by Token (DELETE)

This API Resets the Google Authenticator configurations on a given account via the access token More Info

MFA Reset SMS Authenticator by Token (DELETE)

This API resets the SMS Authenticator configurations on a given account via the access token. More Info

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

MFA Reset Security Question Authenticator By Access Token (DELETE)

This API is used to Reset MFA Security Question Authenticator By Access Token More Info

MFA Reset SMS Authenticator By UID (DELETE)

This API resets the SMS Authenticator configurations on a given account via the UID. More Info

MFA Reset Google Authenticator By UID (DELETE)

This API resets the Google Authenticator configurations on a given account via the UID. More Info

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

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

PINAuthentication API

List of APIs in this Section:
PUT : Reset PIN By ResetToken
PUT : Reset PIN By SecurityAnswer And Email
PUT : Reset PIN By SecurityAnswer And Username
PUT : Reset PIN By SecurityAnswer And Phone
PUT : Change PIN By Token
PUT : Reset PIN by Phone and OTP
PUT : Reset PIN by Email and OTP
PUT : Reset PIN by Username and OTP
POST : PIN Login
POST : Forgot PIN By Email
POST : Forgot PIN By UserName
POST : Forgot PIN By Phone
POST : Set PIN By PinAuthToken
GET : Invalidate PIN Session Token

If you have not already initialized the PINAuthentication object do so now

Reset PIN By ResetToken (PUT)

This API is used to reset pin using reset token. More Info

Reset PIN By SecurityAnswer And Email (PUT)

This API is used to reset pin using security question answer and email. More Info

Reset PIN By SecurityAnswer And Username (PUT)

This API is used to reset pin using security question answer and username. More Info

Reset PIN By SecurityAnswer And Phone (PUT)

This API is used to reset pin using security question answer and phone. More Info

Change PIN By Token (PUT)

This API is used to change a user's PIN using access token. More Info

Reset PIN by Phone and OTP (PUT)

This API is used to reset pin using phoneId and OTP. More Info

Reset PIN by Email and OTP (PUT)

This API is used to reset pin using email and OTP. More Info

Reset PIN by Username and OTP (PUT)

This API is used to reset pin using username and OTP. More Info

PIN Login (POST)

This API is used to login a user by pin and session token. More Info

Forgot PIN By Email (POST)

This API sends the reset pin email to specified email address. More Info

Forgot PIN By UserName (POST)

This API sends the reset pin email using username. More Info

Forgot PIN By Phone (POST)

This API sends the OTP to specified phone number More Info

Set PIN By PinAuthToken (POST)

This API is used to change a user's PIN using Pin Auth token. More Info

Invalidate PIN Session Token (GET)

This API is used to invalidate pin session token. More Info

ReAuthentication API

List of APIs in this Section:
PUT : Validate MFA by OTP
PUT : Validate MFA by Backup Code
PUT : Validate MFA by Google Authenticator Code
PUT : Validate MFA by Password
PUT : MFA Re-authentication by PIN
PUT : MFA Re-authentication by Email OTP
POST : Verify Multifactor OTP Authentication
POST : Verify Multifactor Password Authentication
POST : Verify Multifactor PIN Authentication
POST : MFA Re-authentication by Security Question
GET : Multi Factor Re-Authenticate
GET : Send MFA Re-auth Email OTP by Access Token

If you have not already initialized the ReAuthentication object do so now

Validate MFA by OTP (PUT)

This API is used to re-authenticate via Multi-factor authentication by passing the One Time Password received via SMS More Info

Validate MFA by Backup Code (PUT)

This API is used to re-authenticate by set of backup codes via access token on the site that has Multi-factor authentication enabled in re-authentication for the user that does not have the device More Info

Validate MFA by Google Authenticator Code (PUT)

This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code More Info

Validate MFA by Password (PUT)

This API is used to re-authenticate via Multi-factor-authentication by passing the password More Info

MFA Re-authentication by PIN (PUT)

This API is used to validate the triggered MFA authentication flow with a password. More Info

MFA Re-authentication by Email OTP (PUT)

This API is used to validate the triggered MFA authentication flow with an Email OTP. More Info

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

Verify Multifactor Password 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 password. More Info

Verify Multifactor PIN 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 PIN. More Info

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

Multi Factor Re-Authenticate (GET)

This API is used to trigger the Multi-Factor Autentication workflow for the provided access token More Info

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

ConsentManagement API

List of APIs in this Section:
PUT : Update Consent By Access Token
POST : Consent By ConsentToken
POST : Post Consent By Access Token
GET : Get Consent Logs By Uid
GET : Get Consent Log by Access Token
GET : Get Verify Consent By Access Token

If you have not already initialized the ConsentManagement object do so now

Update Consent By Access Token (PUT)

This API is to update consents using access token. More Info

Consent By ConsentToken (POST)

This API is to submit consent form using consent token. More Info

Post Consent By Access Token (POST)

API to provide a way to end user to submit a consent form for particular event type. More Info

Get Consent Logs By Uid (GET)

This API is used to get the Consent logs of the user. More Info

Get Consent Log by Access Token (GET)

This API is used to fetch consent logs. More Info

Get Verify Consent By Access Token (GET)

This API is used to check if consent is submitted for a particular event or not. More Info

SmartLogin API

List of APIs in this Section:
GET : Smart Login Verify Token
GET : Smart Login By Email
GET : Smart Login By Username
GET : Smart Login Ping

If you have not already initialized the SmartLogin object do so now

Smart Login Verify Token (GET)

This API verifies the provided token for Smart Login More Info

Smart Login By Email (GET)

This API sends a Smart Login link to the user's Email Id. More Info

Smart Login By Username (GET)

This API sends a Smart Login link to the user's Email Id. More Info

Smart Login Ping (GET)

This API is used to check if the Smart Login link has been clicked or not More Info

OneTouchLogin API

List of APIs in this Section:
PUT : One Touch OTP Verification
POST : One Touch Login by Email
POST : One Touch Login by Phone
GET : One Touch Email Verification
GET : One Touch Login Ping

If you have not already initialized the OneTouchLogin object do so now

One Touch OTP Verification (PUT)

This API is used to verify the otp for One Touch Login. More Info

One Touch Login by Email (POST)

This API is used to send a link to a specified email for a frictionless login/registration More Info

One Touch Login by Phone (POST)

This API is used to send one time password to a given phone number for a frictionless login/registration. More Info

One Touch Email Verification (GET)

This API verifies the provided token for One Touch Login More Info

One Touch Login Ping (GET)

This API is used to check if the One Touch Login link has been clicked or not. More Info

PasswordLessLogin API

List of APIs in this Section:
PUT : Passwordless Login Phone Verification
POST : Passwordless Login Verification By Email And OTP
POST : Passwordless Login Verification By User Name And OTP
GET : Passwordless Login by Phone
GET : Passwordless Login By Email
GET : Passwordless Login By UserName
GET : Passwordless Login Verification

If you have not already initialized the PasswordLessLogin object do so now

Passwordless Login Phone Verification (PUT)

This API verifies an account by OTP and allows the customer to login. More Info

Passwordless Login Verification By Email And OTP (POST)

This API is used to verify the otp sent to the email when doing a passwordless login. More Info

Passwordless Login Verification By User Name And OTP (POST)

This API is used to verify the otp sent to the email when doing a passwordless login. More Info

Passwordless Login by Phone (GET)

API can be used to send a One-time Passcode (OTP) provided that the account has a verified PhoneID More Info

Passwordless Login By Email (GET)

This API is used to send a Passwordless Login verification link to the provided Email ID More Info

Passwordless Login By UserName (GET)

This API is used to send a Passwordless Login Verification Link to a customer by providing their UserName More Info

Passwordless Login Verification (GET)

This API is used to verify the Passwordless Login verification link. Note: If you are using Passwordless Login by Phone you will need to use the Passwordless Login Phone Verification API More Info

Configuration API

List of APIs in this Section:
GET : Get Configurations
GET : Get Server Time

If you have not already initialized the Configuration object do so now

Get Configurations (GET)

This API is used to get the configurations which are set in the LoginRadius Dashboard for a particular LoginRadius site/environment More Info

Get Server Time (GET)

This API allows you to query your LoginRadius account for basic server information and server time information which is useful when generating an SOTT token. More Info

Role API

List of APIs in this Section:
PUT : Assign Roles by UID
PUT : Upsert Context
PUT : Add Permissions to Role
POST : Roles Create
GET : Roles by UID
GET : Get Context with Roles and Permissions
GET : Role Context profile
GET : Roles List
DELETE : Unassign Roles by UID
DELETE : Delete Role Context
DELETE : Delete Role from Context
DELETE : Delete Additional Permission from Context
DELETE : Account Delete Role
DELETE : Remove Permissions

If you have not already initialized the Role object do so now

Assign Roles by UID (PUT)

This API is used to assign your desired roles to a given user. More Info

Upsert Context (PUT)

This API creates a Context with a set of Roles More Info

Add Permissions to Role (PUT)

This API is used to add permissions to a given role. More Info

Roles Create (POST)

This API creates a role with permissions. More Info

Roles by UID (GET)

API is used to retrieve all the assigned roles of a particular User. More Info

Get Context with Roles and Permissions (GET)

This API Gets the contexts that have been configured and the associated roles and permissions. More Info

Role Context profile (GET)

The API is used to retrieve role context by the context name. More Info

Roles List (GET)

This API retrieves the complete list of created roles with permissions of your app. More Info


$result = $roleAPI->getRolesList();
Unassign Roles by UID (DELETE)

This API is used to unassign roles from a user. More Info


 $payload = '{
"roles" : [  "roles" ] 
}';  //Required 
$uid = "uid"; //Required

$result = $roleAPI->unassignRolesByUid($payload,$uid);
Delete Role Context (DELETE)

This API Deletes the specified Role Context More Info


$contextName = "contextName"; //Required 
$uid = "uid"; //Required

$result = $roleAPI->deleteRoleContextByUid($contextName,$uid);
Delete Role from Context (DELETE)

This API Deletes the specified Role from a Context. More Info


$contextName = "contextName"; //Required
 $payload = '{
"roles" : [  "roles" ] 
}';  //Required 
$uid = "uid"; //Required

$result = $roleAPI->deleteRolesFromRoleContextByUid($contextName,$payload,$uid);
Delete Additional Permission from Context (DELETE)

This API Deletes Additional Permissions from Context. More Info


$contextName = "contextName"; //Required
 $payload = '{
"additionalPermissions" : [  "additionalPermissions" ] 
}';  //Required 
$uid = "uid"; //Required

$result = $roleAPI->deleteAdditionalPermissionFromRoleContextByUid($contextName,$payload,$uid);
Account Delete Role (DELETE)

This API is used to delete the role. More Info


$role = "role"; //Required

$result = $roleAPI->deleteRole($role);
Remove Permissions (DELETE)

API is used to remove permissions from a role. More Info


 $payload = '{
"permissions" : [  "permissions" ] 
}';  //Required 
$role = "role"; //Required

$result = $roleAPI->removeRolePermissions($payload,$role);

RiskBasedAuthentication API

List of APIs in this Section:
POST : Risk Based Authentication Login by Email
POST : Risk Based Authentication Login by Username
POST : Risk Based Authentication Phone Login

If you have not already initialized the RiskBasedAuthentication object do so now

$riskBasedAuthenticationAPI = new RiskBasedAuthenticationAPI(); 
Risk Based Authentication Login by Email (POST)

This API retrieves a copy of the user data based on the Email More Info


 $payload = '{
"email" : "<email>",
"password" : "<password>"
}';  //Required 
$emailTemplate = "emailTemplate"; //Optional 
$fields = null; //Optional 
$loginUrl = "loginUrl"; //Optional 
$passwordDelegation = "true"; //Optional 
$passwordDelegationApp = "passwordDelegationApp"; //Optional 
$rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional 
$rbaBrowserSmsTemplate = "rbaBrowserSmsTemplate"; //Optional 
$rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional 
$rbaCitySmsTemplate = "rbaCitySmsTemplate"; //Optional 
$rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional 
$rbaCountrySmsTemplate = "rbaCountrySmsTemplate"; //Optional 
$rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional 
$rbaIpSmsTemplate = "rbaIpSmsTemplate"; //Optional 
$rbaOneclickEmailTemplate = "rbaOneclickEmailTemplate"; //Optional 
$rbaOTPSmsTemplate = "rbaOTPSmsTemplate"; //Optional 
$smsTemplate = "smsTemplate"; //Optional 
$verificationUrl = "verificationUrl"; //Optional

$result = $riskBasedAuthenticationAPI->rbaLoginByEmail($payload,$emailTemplate,$fields,$loginUrl,$passwordDelegation,$passwordDelegationApp,$rbaBrowserEmailTemplate,$rbaBrowserSmsTemplate,$rbaCityEmailTemplate,$rbaCitySmsTemplate,$rbaCountryEmailTemplate,$rbaCountrySmsTemplate,$rbaIpEmailTemplate,$rbaIpSmsTemplate,$rbaOneclickEmailTemplate,$rbaOTPSmsTemplate,$smsTemplate,$verificationUrl);
Risk Based Authentication Login by Username (POST)

This API retrieves a copy of the user data based on the Username More Info


 $payload = '{
"password" : "<password>",
"username" : "<username>"
}';  //Required 
$emailTemplate = "emailTemplate"; //Optional 
$fields = null; //Optional 
$loginUrl = "loginUrl"; //Optional 
$passwordDelegation = "true"; //Optional 
$passwordDelegationApp = "passwordDelegationApp"; //Optional 
$rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional 
$rbaBrowserSmsTemplate = "rbaBrowserSmsTemplate"; //Optional 
$rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional 
$rbaCitySmsTemplate = "rbaCitySmsTemplate"; //Optional 
$rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional 
$rbaCountrySmsTemplate = "rbaCountrySmsTemplate"; //Optional 
$rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional 
$rbaIpSmsTemplate = "rbaIpSmsTemplate"; //Optional 
$rbaOneclickEmailTemplate = "rbaOneclickEmailTemplate"; //Optional 
$rbaOTPSmsTemplate = "rbaOTPSmsTemplate"; //Optional 
$smsTemplate = "smsTemplate"; //Optional 
$verificationUrl = "verificationUrl"; //Optional

$result = $riskBasedAuthenticationAPI->rbaLoginByUserName($payload,$emailTemplate,$fields,$loginUrl,$passwordDelegation,$passwordDelegationApp,$rbaBrowserEmailTemplate,$rbaBrowserSmsTemplate,$rbaCityEmailTemplate,$rbaCitySmsTemplate,$rbaCountryEmailTemplate,$rbaCountrySmsTemplate,$rbaIpEmailTemplate,$rbaIpSmsTemplate,$rbaOneclickEmailTemplate,$rbaOTPSmsTemplate,$smsTemplate,$verificationUrl);
Risk Based Authentication Phone Login (POST)

This API retrieves a copy of the user data based on the Phone More Info


 $payload = '{
"password" : "<password>",
"phone" : "<phone>"
}';  //Required 
$emailTemplate = "emailTemplate"; //Optional 
$fields = null; //Optional 
$loginUrl = "loginUrl"; //Optional 
$passwordDelegation = "true"; //Optional 
$passwordDelegationApp = "passwordDelegationApp"; //Optional 
$rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional 
$rbaBrowserSmsTemplate = "rbaBrowserSmsTemplate"; //Optional 
$rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional 
$rbaCitySmsTemplate = "rbaCitySmsTemplate"; //Optional 
$rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional 
$rbaCountrySmsTemplate = "rbaCountrySmsTemplate"; //Optional 
$rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional 
$rbaIpSmsTemplate = "rbaIpSmsTemplate"; //Optional 
$rbaOneclickEmailTemplate = "rbaOneclickEmailTemplate"; //Optional 
$rbaOTPSmsTemplate = "rbaOTPSmsTemplate"; //Optional 
$smsTemplate = "smsTemplate"; //Optional 
$verificationUrl = "verificationUrl"; //Optional

$result = $riskBasedAuthenticationAPI->rbaLoginByPhone($payload,$emailTemplate,$fields,$loginUrl,$passwordDelegation,$passwordDelegationApp,$rbaBrowserEmailTemplate,$rbaBrowserSmsTemplate,$rbaCityEmailTemplate,$rbaCitySmsTemplate,$rbaCountryEmailTemplate,$rbaCountrySmsTemplate,$rbaIpEmailTemplate,$rbaIpSmsTemplate,$rbaOneclickEmailTemplate,$rbaOTPSmsTemplate,$smsTemplate,$verificationUrl);

Sott API

List of APIs in this Section:
GET : Generate SOTT

If you have not already initialized the Sott object do so now

$sottAPI = new SottAPI(); 
Generate SOTT (GET)

This API allows you to generate SOTT with a given expiration time. More Info


$timeDifference = 0; //Optional

$result = $sottAPI->generateSott($timeDifference);

NativeSocial API

List of APIs in this Section:
GET : Access Token via Facebook Token
GET : Access Token via Twitter Token
GET : Access Token via Google Token
GET : Access Token using google JWT token for Native Mobile Login
GET : Access Token via Linkedin Token
GET : Get Access Token By Foursquare Access Token
GET : Access Token via Apple Id Code
GET : Access Token via WeChat Code
GET : Access Token via Google AuthCode

If you have not already initialized the NativeSocial object do so now

$nativeSocialAPI = new NativeSocialAPI(); 
Access Token via Facebook Token (GET)

The API is used to get LoginRadius access token by sending Facebook's access token. It will be valid for the specific duration of time specified in the response. More Info


$fb_Access_Token = "fb_Access_Token"; //Required 
$socialAppName = "socialAppName"; //Optional

$result = $nativeSocialAPI->getAccessTokenByFacebookAccessToken($fb_Access_Token,$socialAppName);
Access Token via Twitter Token (GET)

The API is used to get LoginRadius access token by sending Twitter's access token. It will be valid for the specific duration of time specified in the response. More Info


$tw_Access_Token = "tw_Access_Token"; //Required 
$tw_Token_Secret = "tw_Token_Secret"; //Required 
$socialAppName = "socialAppName"; //Optional

$result = $nativeSocialAPI->getAccessTokenByTwitterAccessToken($tw_Access_Token,$tw_Token_Secret,$socialAppName);
Access Token via Google Token (GET)

The API is used to get LoginRadius access token by sending Google's access token. It will be valid for the specific duration of time specified in the response. More Info


$google_Access_Token = "google_Access_Token"; //Required 
$client_id = "client_id"; //Optional 
$refresh_token = "refresh_token"; //Optional 
$socialAppName = "socialAppName"; //Optional

$result = $nativeSocialAPI->getAccessTokenByGoogleAccessToken($google_Access_Token,$client_id,$refresh_token,$socialAppName);
Access Token using google JWT token for Native Mobile Login (GET)

This API is used to Get LoginRadius Access Token using google jwt id token for google native mobile login/registration. More Info


$id_Token = "id_Token"; //Required

$result = $nativeSocialAPI->getAccessTokenByGoogleJWTAccessToken($id_Token);
Access Token via Linkedin Token (GET)

The API is used to get LoginRadius access token by sending Linkedin's access token. It will be valid for the specific duration of time specified in the response. More Info


$ln_Access_Token = "ln_Access_Token"; //Required 
$socialAppName = "socialAppName"; //Optional

$result = $nativeSocialAPI->getAccessTokenByLinkedinAccessToken($ln_Access_Token,$socialAppName);
Get Access Token By Foursquare Access Token (GET)

The API is used to get LoginRadius access token by sending Foursquare's access token. It will be valid for the specific duration of time specified in the response. More Info


$fs_Access_Token = "fs_Access_Token"; //Required

$result = $nativeSocialAPI->getAccessTokenByFoursquareAccessToken($fs_Access_Token);
Access Token via Apple Id Code (GET)

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. More Info


$code = "code"; //Required 
$socialAppName = "socialAppName"; //Optional

$result = $nativeSocialAPI->getAccessTokenByAppleIdCode($code,$socialAppName);
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


$code = "code"; //Required

$result = $nativeSocialAPI->getAccessTokenByWeChatCode($code);
Access Token via Google AuthCode (GET)

The API is used to get LoginRadius access token by sending Google's AuthCode. It will be valid for the specific duration of time specified in the response. More Info


$google_authcode = "google_authcode"; //Required 
$socialAppName = "socialAppName"; //Optional

$result = $nativeSocialAPI->getAccessTokenByGoogleAuthCode($google_authcode,$socialAppName);

WebHook API

List of APIs in this Section:
POST : Webhook Subscribe
GET : Webhook Subscribed URLs
GET : Webhook Test
DELETE : WebHook Unsubscribe

If you have not already initialized the WebHook object do so now

$webHookAPI = new WebHookAPI(); 
Webhook Subscribe (POST)

API can be used to configure a WebHook on your LoginRadius site. Webhooks also work on subscribe and notification model, subscribe your hook and get a notification. Equivalent to RESThook but these provide security on basis of signature and RESThook work on unique URL. Following are the events that are allowed by LoginRadius to trigger a WebHook service call. More Info


 $payload = '{
"event" : "<event>",
"targetUrl" : "<targetUrl>"
}';  //Required

$result = $webHookAPI->webHookSubscribe($payload);
Webhook Subscribed URLs (GET)

This API is used to fatch all the subscribed URLs, for particular event More Info


$event = "event"; //Required

$result = $webHookAPI->getWebHookSubscribedURLs($event);
Webhook Test (GET)

API can be used to test a subscribed WebHook. More Info


$result = $webHookAPI->webhookTest();
WebHook Unsubscribe (DELETE)

API can be used to unsubscribe a WebHook configured on your LoginRadius site. More Info


 $payload = '{
"event" : "<event>",
"targetUrl" : "<targetUrl>"
}';  //Required

$result = $webHookAPI->webHookUnsubscribe($payload);

Generate SOTT Manually

SOTT is a secure one-time token that can be created using the API key, API secret, and a timestamp ( start time and end time ). You can manually create a SOTT using the following utility function.


$startTime="2022-01-10 12:00:00";  // (Optional)  Valid Start Date with Date and time

$endTime="2022-03-10 07:00:00"; //(Optional)  Valid End Date with Date and time

$getLRserverTime=false; //(Optional) If true it will call LoginRadius Get Server Time Api and fetch basic server information and server time information which is useful when generating an SOTT token.

//do not pass the time difference if you are passing startTime & endTime.

$timeDifference =''; // (Optional) The time difference will be used to set the expiration time of SOTT, If you do not pass time difference then the default expiration time of SOTT is 10 minutes.

//The LoginRadius API key and primary API secret can be passed additionally, If the credentials will not be passed then this SOTT function will pick the API credentials from the SDK configuration.  

$apiKey=""; //(Optional) LoginRadius Api Key

$apiSecret=""; //(Optional) LoginRadius Api Secret (Only Primary Api Secret is used to generate the SOTT manually)

$sottObj = new SOTT();
$sott = $sottObj->getSott($startTime,$endTime,$getLRserverTime,$timeDifference,$apiKey,$apiSecret);

Implement Custom HTTP Client

namespace LoginRadiusSDK\Clients\IHttpClient;
use LoginRadiusSDK\Utility\Functions;
use LoginRadiusSDK\LoginRadiusException;

class CustomHttpClient implements IHttpClient {

    public function request($path, $query_array = array(), $options = array()) {
    //custom HTTP client request handler code here
    }
}

Note: If you manually added LoginRadius SDK then please make sure that customhttpclient.php file included in your project.

global $apiClient_class;
$apiClient_class = 'CustomHttpClient';

Now your Custom HTTP client library will be used to handle LoginRadius APIs.

Demo

Check out the demo and get the full SDK on our Github

Reference Manual

Please find the reference manual here


All versions of php-sdk-2.0 with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package loginradius/php-sdk-2.0 contains the following files

Loading the files please wait ....