Skip to content

The LoginRadius ASP.NET library will let you integrate LoginRadius' customer identity platform with your ASP.Net application(s).

License

Notifications You must be signed in to change notification settings

LoginRadius/dot-net-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LoginRadius .NET SDK

Home Image

Introduction

LoginRadius ASP.NET Customer Registration wrapper provides access to LoginRadius Identity Management Platform API.

LoginRadius is an Identity Management Platform that simplifies user registration while securing data. LoginRadius Platform simplifies and secures your user registration process, increases conversion with Social Login that combines 30 major social platforms, and offers a full solution with Traditional User Registration. You can gather a wealth of user profile data from Social Login or Traditional User Registration.

LoginRadius centralizes it all in one place, making it easy to manage and access. Easily integrate LoginRadius with all of your third-party applications, like MailChimp, Google Analytics, Livefyre and many more, making it easy to utilize the data you are capturing.

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.

Please visit here for more information.

Prerequisites

  • .NET 4.0 or later / .NetStandard 1.3 or later

Installation

This documentation presumes you have worked through the client-side implementation to setup your LoginRadius User Registration interfaces that will serve the initial registration and login process. Details on this can be found in the getting started guide.

**Note: **LoginRadius uses the industry standard TLS 1.2 protocol, designed to help protect the privacy of information communicated over the Internet. In order to use the LoginRadius .Net SDK, add the following code before instantiating your web service in your project's Global.asax file.

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

Importing Required Libraries

  • Download the User Registration .Net SDK from Github

  • Copy LoginRadiusSDK.V2.dll and LoginRadiusSDK.V2.pdb files into the References directory of your ASP.NET project.

OR

  • Run the following command in the NuGet Package Manager Console:
PM> Install-Package LoginRadiusSDK.NET

OR

  • Open the solution using Visual Studio 2019.

  • Build the project and note where the .nupkg file is located.

  • Access the NuGet Package Manager Settings and import the directory where the .nupkg file is located.

  • Access the "Manage NuGet Packages for Solutions..." tool change the source to the newly created source and select and install the LoginRadius SDK

Next, include the following namespaces in your project:

using LoginRadiusSDK.V2.Api;
using LoginRadiusSDK.V2.Models;

Quickstart Guide

Before using the SDK, you must initialize the SDK with the help of following code: API Key and secret of your LoginRadius site. This information can be found in your LoginRadius account as described here

LoginRadiusSdkGlobalConfig.ApiKey = "__API_KEY__";
LoginRadiusSdkGlobalConfig.ApiSecret = "__API_SECRET__";
LoginRadiusSdkGlobalConfig.AppName = "__LoginRadius_APP_NAME__";
LoginRadiusSdkGlobalConfig.ApiRequestSigning ="false";
LoginRadiusSdkGlobalConfig.ConnectionTimeout = 30000; // Connection Timeout (milliseconds)
LoginRadiusSdkGlobalConfig.ProxyAddress = "__HTTP_PROXY_ADDRESS__"; // Absolute Proxy URI
LoginRadiusSdkGlobalConfig.ProxyCredentials = "__HTTP_PROXY_CREDENTIALS__"; // Proxy Credentials in the format 'USERNAME:PASSWORD'
LoginRadiusSdkGlobalConfig.RequestRetries = 3;
LoginRadiusSdkGlobalConfig.ApiRegion = "_region_";
LoginRadiusSdkGlobalConfig.DomainName = "https://api.loginradius.com/";

OR

For ASP.NET. in web.config:

  <configSections>
    <section name="loginradius" type="LoginRadiusSDK.V2.SDKConfigHandler, LoginRadiusSDK.V2" />
  </configSections>

  <!-- LoginRadius SDK settings -->
  <loginradius>
    <settings>
      <add name="apiKey" value="__API_KEY__" />
      <add name="apiSecret" value="__API_SECRET__" />
      <add name="appName" value="__LoginRadius_APP_NAME__"/>
	  <add name="ApiRequestSigning" value="false"/>
      <add name="proxyAddress" value="__HTTP_PROXY_ADDRESS__" /> <!-- Absolute Proxy URI -->
      <add name="proxyCredentials" value="__HTTP_PROXY_CREDENTIALS__" /> <!-- Proxy Credentials in the format 'USERNAME:PASSWORD' -->
      <add name="connectionTimeout" value="__HTTP_CONNECTION_TIMEOUT__" /> <!-- Connection Timeout (milliseconds) -->
      <add name="requestRetries" value="__HTTP_CONNECTION_RETRY__" />
      <add name="apiRegion" value="_region_" />
      <add name="domainName" value="https://api.loginradius.com/" />
    </settings>
  </loginradius>

OR

For .NET Core, in appsettings.json:

JSON

"loginradius": {
    "apiKey": "__API_KEY__",
    "apiSecret": "__API_SECRET__",
    "appName" : "__LoginRadius_APP_NAME__",
	"ApiRequestSigning" : "false",
    "proxyAddress" : "__HTTP_PROXY_ADDRESS__",
    "proxyCredentials" : "__HTTP_PROXY_CREDENTIAL__",
    "connectionTimeout" : "__HTTP_CONNECTION_TIMEOUT__",
    "requestRetries" : "__HTTP_CONNECTION_RETRY__",
    "apiRegion": "_region_",
    "domainName" : "https://api.loginradius.com/"
  }

Custom Domain

When initializing the SDK, optionally specify a custom domain. Example : In appsettings.json, add following statement -

"domainName" : "https://api.loginradius.com/"

API Request Signing

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. Example : In appsettings.json, add following statement -

"ApiRequestSigning" : "false"

X-Origin-IP LoginRadius allows you add X-Origin-IP in your headers and it determines the IP address of the client's request,this can also be useful to overcome analytics discrepancies where the analytics depend on header data.

"originIp" : "<Client-Ip-Address>"

APIs

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
POST : Auth Link Social Identities
POST : Auth Link Social Identities By Ping
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 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 Social Identity
GET : Auth Check UserName Availability
GET : Auth Privacy Policy Accept
GET : Auth Privacy Policy History By Access Token
GET : Auth send verification Email for linking social profiles
DELETE : Auth Delete Account with Email Confirmation
DELETE : Auth Remove Email
DELETE : Auth Unlink Social Identities

Auth Update Profile by Token (PUT)

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

var accessToken = "accessToken"; //Required
UserProfileUpdateModel userProfileUpdateModel = new UserProfileUpdateModel{
FirstName ="<FirstName>",
LastName ="<LastName>"
}; //Required
var emailTemplate = "emailTemplate"; //Optional
string fields = null; //Optional
; //Optional
var smsTemplate = "smsTemplate"; //Optional
var verificationUrl = "verificationUrl"; //Optional
var isVoiceOtp = false; //Optional
var options = "options"; //Optional
var apiResponse = new AuthenticationApi().UpdateProfileByAccessToken(accessToken, userProfileUpdateModel, emailTemplate, fields, smsTemplate, verificationUrl, isVoiceOtp, options).Result;
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

var accessToken = "accessToken"; //Required
UnlockProfileModel unlockProfileModel = new UnlockProfileModel{
G_recaptcha_response ="<G-recaptcha-response>"
}; //Required
var apiResponse = new AuthenticationApi().UnlockAccountByToken(accessToken, unlockProfileModel).Result;
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

EmailVerificationByOtpModel emailVerificationByOtpModel = new EmailVerificationByOtpModel{
Email ="<Email>",
Otp ="<Otp>"
}; //Required
string fields = null; //Optional
var url = "url"; //Optional
var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
var apiResponse = new AuthenticationApi().VerifyEmailByOTP(emailVerificationByOtpModel, fields, url, welcomeEmailTemplate).Result;
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

ResetPasswordBySecurityAnswerAndEmailModel resetPasswordBySecurityAnswerAndEmailModel = new ResetPasswordBySecurityAnswerAndEmailModel{
Email ="<Email>",
Password ="<Password>",
SecurityAnswer = new Dictionary<String,String>{
["QuestionID"] = "Answer"
}
}; //Required
var apiResponse = new AuthenticationApi().ResetPasswordBySecurityAnswerAndEmail(resetPasswordBySecurityAnswerAndEmailModel).Result;
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

ResetPasswordBySecurityAnswerAndPhoneModel resetPasswordBySecurityAnswerAndPhoneModel = new ResetPasswordBySecurityAnswerAndPhoneModel{
Password ="<Password>",
Phone ="<Phone>",
SecurityAnswer = new Dictionary<String,String>{
["QuestionID"] = "Answer"
}
}; //Required
var apiResponse = new AuthenticationApi().ResetPasswordBySecurityAnswerAndPhone(resetPasswordBySecurityAnswerAndPhoneModel).Result;
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

ResetPasswordBySecurityAnswerAndUserNameModel resetPasswordBySecurityAnswerAndUserNameModel = new ResetPasswordBySecurityAnswerAndUserNameModel{
Password ="<Password>",
SecurityAnswer = new Dictionary<String,String>{
["QuestionID"] = "Answer"
},
UserName ="<UserName>"
}; //Required
var apiResponse = new AuthenticationApi().ResetPasswordBySecurityAnswerAndUserName(resetPasswordBySecurityAnswerAndUserNameModel).Result;
Auth Reset Password by Reset Token (PUT)

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

ResetPasswordByResetTokenModel resetPasswordByResetTokenModel = new ResetPasswordByResetTokenModel{
Password ="<Password>",
ResetToken ="<ResetToken>"
}; //Required
var apiResponse = new AuthenticationApi().ResetPasswordByResetToken(resetPasswordByResetTokenModel).Result;
Auth Reset Password by OTP (PUT)

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

ResetPasswordByEmailAndOtpModel resetPasswordByEmailAndOtpModel = new ResetPasswordByEmailAndOtpModel{
Email ="<Email>",
Otp ="<Otp>",
Password ="<Password>"
}; //Required
var apiResponse = new AuthenticationApi().ResetPasswordByEmailOTP(resetPasswordByEmailAndOtpModel).Result;
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

ResetPasswordByUserNameModel resetPasswordByUserNameModel = new ResetPasswordByUserNameModel{
Otp ="<Otp>",
Password ="<Password>",
UserName ="<UserName>"
}; //Required
var apiResponse = new AuthenticationApi().ResetPasswordByOTPAndUserName(resetPasswordByUserNameModel).Result;
Auth Change Password (PUT)

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

var accessToken = "accessToken"; //Required
var newPassword = "newPassword"; //Required
var oldPassword = "oldPassword"; //Required
var apiResponse = new AuthenticationApi().ChangePassword(accessToken, newPassword, oldPassword).Result;
Auth Link Social Identities (POST)

This API is used to link up a social provider account with the specified account based on the access token and the social providers user access token. More Info

var accessToken = "accessToken"; //Required
var candidateToken = "candidateToken"; //Required
var apiResponse = new AuthenticationApi().LinkSocialIdentities(accessToken, candidateToken).Result;
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

var accessToken = "accessToken"; //Required
var clientGuid = "clientGuid"; //Required
var apiResponse = new AuthenticationApi().LinkSocialIdentitiesByPing(accessToken, clientGuid).Result;
Auth Set or Change UserName (PUT)

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

var accessToken = "accessToken"; //Required
var username = "username"; //Required
var apiResponse = new AuthenticationApi().SetOrChangeUserName(accessToken, username).Result;
Auth Resend Email Verification (PUT)

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

var email = "email"; //Required
var emailTemplate = "emailTemplate"; //Optional
var verificationUrl = "verificationUrl"; //Optional
var apiResponse = new AuthenticationApi().AuthResendEmailVerification(email, emailTemplate, verificationUrl).Result;
Auth Add Email (POST)

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

var accessToken = "accessToken"; //Required
var email = "email"; //Required
var type = "type"; //Required
var emailTemplate = "emailTemplate"; //Optional
var verificationUrl = "verificationUrl"; //Optional
var apiResponse = new AuthenticationApi().AddEmail(accessToken, email, type, emailTemplate, verificationUrl).Result;
Auth Login by Email (POST)

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

EmailAuthenticationModel emailAuthenticationModel = new EmailAuthenticationModel{
Email ="<Email>",
Password ="<Password>"
}; //Required
var emailTemplate = "emailTemplate"; //Optional
string fields = null; //Optional
var loginUrl = "loginUrl"; //Optional
var verificationUrl = "verificationUrl"; //Optional
var apiResponse = new AuthenticationApi().LoginByEmail(emailAuthenticationModel, emailTemplate, fields, loginUrl, verificationUrl).Result;
Auth Login by Username (POST)

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

UserNameAuthenticationModel userNameAuthenticationModel = new UserNameAuthenticationModel{
Password ="<Password>",
Username ="<Username>"
}; //Required
var emailTemplate = "emailTemplate"; //Optional
string fields = null; //Optional
var loginUrl = "loginUrl"; //Optional
var verificationUrl = "verificationUrl"; //Optional
var apiResponse = new AuthenticationApi().LoginByUserName(userNameAuthenticationModel, emailTemplate, fields, loginUrl, verificationUrl).Result;
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

var email = "email"; //Required
var resetPasswordUrl = "resetPasswordUrl"; //Required
var emailTemplate = "emailTemplate"; //Optional
var apiResponse = new AuthenticationApi().ForgotPassword(email, resetPasswordUrl, emailTemplate).Result;
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

AuthUserRegistrationModel authUserRegistrationModel = new AuthUserRegistrationModel{
Email = new List<EmailModel>{
new EmailModel{
Type ="<Type>",
Value ="<Value>"
}},
FirstName ="<FirstName>",
LastName ="<LastName>",
Password ="<Password>"
}; //Required
var sott = "sott"; //Required
var emailTemplate = "emailTemplate"; //Optional
string fields = null; //Optional
var options = "options"; //Optional
var verificationUrl = "verificationUrl"; //Optional
var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
var isVoiceOtp = false; //Optional
var apiResponse = new AuthenticationApi().UserRegistrationByEmail(authUserRegistrationModel, sott, emailTemplate, fields, options, verificationUrl, welcomeEmailTemplate, isVoiceOtp).Result;
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

AuthUserRegistrationModelWithCaptcha authUserRegistrationModelWithCaptcha = new AuthUserRegistrationModelWithCaptcha{
Email = new List<EmailModel>{
new EmailModel{
Type ="<Type>",
Value ="<Value>"
}},
FirstName ="<FirstName>",
G_recaptcha_response ="<G-recaptcha-response>",
LastName ="<LastName>",
Password ="<Password>"
}; //Required
var emailTemplate = "emailTemplate"; //Optional
string fields = null; //Optional
var options = "options"; //Optional
var smsTemplate = "smsTemplate"; //Optional
var verificationUrl = "verificationUrl"; //Optional
var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
var isVoiceOtp = false; //Optional
var apiResponse = new AuthenticationApi().UserRegistrationByCaptcha(authUserRegistrationModelWithCaptcha, emailTemplate, fields, options, smsTemplate, verificationUrl, welcomeEmailTemplate, isVoiceOtp).Result;
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

var email = "email"; //Required
var apiResponse = new AuthenticationApi().GetSecurityQuestionsByEmail(email).Result;
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

var userName = "userName"; //Required
var apiResponse = new AuthenticationApi().GetSecurityQuestionsByUserName(userName).Result;
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

var phone = "phone"; //Required
var apiResponse = new AuthenticationApi().GetSecurityQuestionsByPhone(phone).Result;
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

var accessToken = "accessToken"; //Required
var apiResponse = new AuthenticationApi().GetSecurityQuestionsByAccessToken(accessToken).Result;
Auth Validate Access token (GET)

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

var accessToken = "accessToken"; //Required
var apiResponse = new AuthenticationApi().AuthValidateAccessToken(accessToken).Result;
Access Token Invalidate (GET)

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

var accessToken = "accessToken"; //Required
var preventRefresh = true; //Optional
var apiResponse = new AuthenticationApi().AuthInValidateAccessToken(accessToken, preventRefresh).Result;
Access Token Info (GET)

This api call provide the active access token Information More Info

var accessToken = "accessToken"; //Required
var apiResponse = new AuthenticationApi().GetAccessTokenInfo(accessToken).Result;
Auth Read all Profiles by Token (GET)

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

var accessToken = "accessToken"; //Required
string fields = null; //Optional
var emailTemplate = "emailTemplate"; //Optional
var verificationUrl = "verificationUrl"; //Optional
var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
var apiResponse = new AuthenticationApi().GetProfileByAccessToken(accessToken,fields, emailTemplate, verificationUrl, welcomeEmailTemplate).Result;
Auth Send Welcome Email (GET)

This API sends a welcome email More Info

var accessToken = "accessToken"; //Required
var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
var apiResponse = new AuthenticationApi().SendWelcomeEmail(accessToken, welcomeEmailTemplate).Result;
Auth Delete Account (GET)

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

var deleteToken = "deleteToken"; //Required
var apiResponse = new AuthenticationApi().DeleteAccountByDeleteToken(deleteToken).Result;
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

var clientGuid = "clientGuid"; //Required
var emailTemplate = "emailTemplate"; //Optional
string fields = null; //Optional
var verificationUrl = "verificationUrl"; //Optional
var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
var apiResponse = new AuthenticationApi().GetProfileByPing(clientGuid, emailTemplate, fields, verificationUrl, welcomeEmailTemplate).Result;
Auth Check Email Availability (GET)

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

var email = "email"; //Required
var apiResponse = new AuthenticationApi().CheckEmailAvailability(email).Result;
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

var verificationToken = "verificationToken"; //Required
string fields = null; //Optional
var url = "url"; //Optional
var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
var uuid = "uuid"; //Optional
var apiResponse = new AuthenticationApi().VerifyEmail(verificationToken, fields, url, welcomeEmailTemplate,uuid).Result;
Auth Social Identity (GET)

This API is called just after account linking API and it prevents the raas profile of the second account from getting created. More Info

var accessToken = "accessToken"; //Required
string fields = null; //Optional
var apiResponse = new AuthenticationApi().GetSocialIdentity(accessToken, fields).Result;
Auth Check UserName Availability (GET)

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

var username = "username"; //Required
var apiResponse = new AuthenticationApi().CheckUserNameAvailability(username).Result;
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

var accessToken = "accessToken"; //Required
string fields = null; //Optional
var apiResponse = new AuthenticationApi().AcceptPrivacyPolicy(accessToken, fields).Result;
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

var accessToken = "accessToken"; //Required
var apiResponse = new AuthenticationApi().GetPrivacyPolicyHistoryByAccessToken(accessToken).Result;
Auth send verification Email for linking social profiles (GET)

This API is used to Send verification email to the unverified email of the social profile. This API can be used only incase of optional verification workflow. More Info

var accessToken = "accessToken"; //Required
var clientguid = "clientguid"; //Required
var apiResponse = new AuthenticationApi().AuthSendVerificationEmailForLinkingSocialProfiles(accessToken, clientguid).Result;
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

var accessToken = "accessToken"; //Required
var deleteUrl = "deleteUrl"; //Optional
var emailTemplate = "emailTemplate"; //Optional
var apiResponse = new AuthenticationApi().DeleteAccountWithEmailConfirmation(accessToken, deleteUrl, emailTemplate).Result;
Auth Remove Email (DELETE)

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

var accessToken = "accessToken"; //Required
var email = "email"; //Required
var apiResponse = new AuthenticationApi().RemoveEmail(accessToken, email).Result;
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

var accessToken = "accessToken"; //Required
var provider = "provider"; //Required
var providerId = "providerId"; //Required
var apiResponse = new AuthenticationApi().UnlinkSocialIdentities(accessToken, provider, providerId).Result;

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
POST : Multipurpose Email Token Generation API
POST : Multipurpose SMS OTP Generation API
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 : Revoke All Refresh Token
DELETE : Delete User Profiles By Email

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

AccountUserProfileUpdateModel accountUserProfileUpdateModel = new AccountUserProfileUpdateModel{
FirstName ="<FirstName>",
LastName ="<LastName>"
}; //Required
var uid = "uid"; //Required
string fields = null; //Optional
; //Optional
var apiResponse = new AccountApi().UpdateAccountByUid(accountUserProfileUpdateModel, uid, fields).Result;
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

var phone = "phone"; //Required
var uid = "uid"; //Required
string fields = null; //Optional
var apiResponse = new AccountApi().UpdatePhoneIDByUid(phone, uid, fields).Result;
Account Set Password (PUT)

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

var password = "password"; //Required
var uid = "uid"; //Required
var apiResponse = new AccountApi().SetAccountPasswordByUid(password, uid).Result;
Account Invalidate Verification Email (PUT)

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

var uid = "uid"; //Required
var emailTemplate = "emailTemplate"; //Optional
var verificationUrl = "verificationUrl"; //Optional
var apiResponse = new AccountApi().InvalidateAccountEmailVerification(uid, emailTemplate, verificationUrl).Result;
Reset phone ID verification (PUT)

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

var uid = "uid"; //Required
var smsTemplate = "smsTemplate"; //Optional
var isVoiceOtp = false; //Optional
var apiResponse = new AccountApi().ResetPhoneIDVerificationByUid(uid, smsTemplate, isVoiceOtp).Result;
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

UpsertEmailModel upsertEmailModel = new UpsertEmailModel{
Email = new List<EmailModel>{
new EmailModel{
Type ="<Type>",
Value ="<Value>"
}}
}; //Required
var uid = "uid"; //Required
string fields = null; //Optional
var apiResponse = new AccountApi().UpsertEmail(upsertEmailModel, uid, fields).Result;
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

UpdateUidModel updateUidModel = new UpdateUidModel{
NewUid ="<NewUid>"
}; //Required
var uid = "uid"; //Required
var apiResponse = new AccountApi().AccountUpdateUid(updateUidModel, uid).Result;
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

AccountCreateModel accountCreateModel = new AccountCreateModel{
Email = new List<EmailModel>{
new EmailModel{
Type ="<Type>",
Value ="<Value>"
}},
FirstName ="<FirstName>",
LastName ="<LastName>",
Password ="<Password>"
}; //Required
string fields = null; //Optional
var apiResponse = new AccountApi().CreateAccount(accountCreateModel, fields).Result;
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

var email = "email"; //Required
var emailTemplate = "emailTemplate"; //Optional
var resetPasswordUrl = "resetPasswordUrl"; //Optional
var sendEmail = true; //Optional
var apiResponse = new AccountApi().GetForgotPasswordToken(email, emailTemplate, resetPasswordUrl, sendEmail).Result;
Email Verification token (POST)

This API Returns an Email Verification token. More Info

var email = "email"; //Required
var apiResponse = new AccountApi().GetEmailVerificationToken(email).Result;
Multipurpose Email Token Generation API (POST)

This API generate Email tokens and Email OTPs for Email verification, Add email, Forgot password, Delete user, Passwordless login, Forgot pin, One-touch login and Auto login. More Info

MultiEmailToken multiEmailToken = new MultiEmailToken{
Clientguid ="<Clientguid>",
Email ="<Email>",
Name ="<Name>",
Type ="<Type>",
Uid ="<Uid>",
UserName ="<UserName>"
}; //Required
var tokentype = "tokentype"; //Required
var apiResponse = new AccountApi().MultipurposeEmailTokenGeneration(multiEmailToken, tokentype).Result;
Multipurpose SMS OTP Generation API (POST)

This API generates SMS OTP for Add phone, Phone Id verification, Forgot password, Forgot pin, One-touch login, smart login and Passwordless login. More Info

MultiSmsOtp multiSmsOtp = new MultiSmsOtp{
Name ="<Name>",
Phone ="<Phone>",
Uid ="<Uid>"
}; //Required
var smsotptype = "smsotptype"; //Required
var apiResponse = new AccountApi().MultipurposeSMSOTPGeneration(multiSmsOtp, smsotptype).Result;
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

var uid = "uid"; //Required
var apiResponse = new AccountApi().GetPrivacyPolicyHistoryByUid(uid).Result;
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

var email = "email"; //Required
string fields = null; //Optional
var apiResponse = new AccountApi().GetAccountProfileByEmail(email, fields).Result;
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

var userName = "userName"; //Required
string fields = null; //Optional
var apiResponse = new AccountApi().GetAccountProfileByUserName(userName, fields).Result;
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

var phone = "phone"; //Required
string fields = null; //Optional
var apiResponse = new AccountApi().GetAccountProfileByPhone(phone, fields).Result;
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

var uid = "uid"; //Required
string fields = null; //Optional
var apiResponse = new AccountApi().GetAccountProfileByUid(uid, fields).Result;
Account Password (GET)

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

var uid = "uid"; //Required
var apiResponse = new AccountApi().GetAccountPasswordHashByUid(uid).Result;
Access Token based on UID or User impersonation API (GET)

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

var uid = "uid"; //Required
var apiResponse = new AccountApi().GetAccessTokenByUid(uid).Result;
Refresh Access Token by Refresh Token (GET)

This API is used to refresh an access_token via it's associated refresh_token. More Info

var refreshToken = "refreshToken"; //Required
var apiResponse = new AccountApi().RefreshAccessTokenByRefreshToken(refreshToken).Result;
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

var refreshToken = "refreshToken"; //Required
var apiResponse = new AccountApi().RevokeRefreshToken(refreshToken).Result;
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

var email = "email"; //Required
string fields = null; //Optional
var apiResponse = new AccountApi().GetAccountIdentitiesByEmail(email, fields).Result;
Account Delete (DELETE)

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

var uid = "uid"; //Required
var apiResponse = new AccountApi().DeleteAccountByUid(uid).Result;
Account Remove Email (DELETE)

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

var email = "email"; //Required
var uid = "uid"; //Required
string fields = null; //Optional
var apiResponse = new AccountApi().RemoveEmail(email, uid, fields).Result;
Revoke All Refresh Token (DELETE)

The Revoke All Refresh Access Token API is used to revoke all refresh tokens for a specific user. More Info

var uid = "uid"; //Required
var apiResponse = new AccountApi().RevokeAllRefreshToken(uid).Result;
Delete User Profiles By Email (DELETE)

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

var email = "email"; //Required
var apiResponse = new AccountApi().AccountDeleteByEmail(email).Result;

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

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

var token = "token"; //Required
var apiResponse = new SocialApi().ExchangeAccessToken(token).Result;
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

var accessToken = "accessToken"; //Required
var expiresIn = 0; //Optional
var isWeb = true; //Optional
var apiResponse = new SocialApi().RefreshAccessToken(accessToken, expiresIn, isWeb).Result;
Token Validate (GET)

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

var accessToken = "accessToken"; //Required
var apiResponse = new SocialApi().ValidateAccessToken(accessToken).Result;
Access Token Invalidate (GET)

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

var accessToken = "accessToken"; //Required
var apiResponse = new SocialApi().InValidateAccessToken(accessToken).Result;
Get Active Session Details (GET)

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

var token = "token"; //Required
var apiResponse = new SocialApi().GetActiveSession(token).Result;
Get Active Session By Account Id (GET)

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

var accountId = "accountId"; //Required
var apiResponse = new SocialApi().GetActiveSessionByAccountID(accountId).Result;
Get Active Session By Profile Id (GET)

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

var profileId = "profileId"; //Required
var apiResponse = new SocialApi().GetActiveSessionByProfileID(profileId).Result;

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

Note: CustomObject must be valid JSON. For example:

public class cobj
  {
        public string field1 { get; set; }
        public string field2 { get; set; }
  }
cobj customObject = new cobj();
customObject.field1 = "XXXX";
customObject.field2 = "YYYY";
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

var accessToken = "accessToken"; //Required
var objectName = "objectName"; //Required
var objectRecordId = "objectRecordId"; //Required

CustomObjectUpdateOperationType updateType = CustomObjectUpdateOperationType.Default; //Optional
var apiResponse = new CustomObjectApi().UpdateCustomObjectByToken(accessToken, objectName, objectRecordId, customObject, updateType).Result;
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

var objectName = "objectName"; //Required
var objectRecordId = "objectRecordId"; //Required

var uid = "uid"; //Required
CustomObjectUpdateOperationType updateType = CustomObjectUpdateOperationType.Default; //Optional
var apiResponse = new CustomObjectApi().UpdateCustomObjectByUid(objectName, objectRecordId, customObject, uid, updateType).Result;
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

var accessToken = "accessToken"; //Required
var objectName = "objectName"; //Required

var apiResponse = new CustomObjectApi().CreateCustomObjectByToken(accessToken, objectName, customObject).Result;
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

var objectName = "objectName"; //Required

var uid = "uid"; //Required
var apiResponse = new CustomObjectApi().CreateCustomObjectByUid(objectName, customObject, uid).Result;
Custom Object by Token (GET)

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

var accessToken = "accessToken"; //Required
var objectName = "objectName"; //Required
var apiResponse = new CustomObjectApi().GetCustomObjectByToken(accessToken, objectName).Result;
Custom Object by ObjectRecordId and Token (GET)

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

var accessToken = "accessToken"; //Required
var objectName = "objectName"; //Required
var objectRecordId = "objectRecordId"; //Required
var apiResponse = new CustomObjectApi().GetCustomObjectByRecordIDAndToken(accessToken, objectName, objectRecordId).Result;
Custom Object By UID (GET)

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

var objectName = "objectName"; //Required
var uid = "uid"; //Required
var apiResponse = new CustomObjectApi().GetCustomObjectByUid(objectName, uid).Result;
Custom Object by ObjectRecordId and UID (GET)

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

var objectName = "objectName"; //Required
var objectRecordId = "objectRecordId"; //Required
var uid = "uid"; //Required
var apiResponse = new CustomObjectApi().GetCustomObjectByRecordID(objectName, objectRecordId, uid).Result;
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

var accessToken = "accessToken"; //Required
var objectName = "objectName"; //Required
var objectRecordId = "objectRecordId"; //Required
var apiResponse = new CustomObjectApi().DeleteCustomObjectByToken(accessToken, objectName, objectRecordId).Result;
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

var objectName = "objectName"; //Required
var objectRecordId = "objectRecordId"; //Required
var uid = "uid"; //Required
var apiResponse = new CustomObjectApi().DeleteCustomObjectByRecordID(objectName, objectRecordId, uid).Result;

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

Phone Reset Password by OTP (PUT)

This API is used to reset the password More Info

ResetPasswordByOTPModel resetPasswordByOTPModel = new ResetPasswordByOTPModel{
Otp ="<Otp>",
Password ="<Password>",
Phone ="<Phone>"
}; //Required
var apiResponse = new PhoneAuthenticationApi().ResetPasswordByPhoneOTP(resetPasswordByOTPModel).Result;
Phone Verification OTP (PUT)

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

var otp = "otp"; //Required
var phone = "phone"; //Required
string fields = null; //Optional
var smsTemplate = "smsTemplate"; //Optional
var isVoiceOtp = false; //Optional
var apiResponse = new PhoneAuthenticationApi().PhoneVerificationByOTP(otp, phone, fields, smsTemplate, isVoiceOtp).Result;
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

var accessToken = "accessToken"; //Required
var otp = "otp"; //Required
var smsTemplate = "smsTemplate"; //Optional
var isVoiceOtp = false; //Optional
var apiResponse = new PhoneAuthenticationApi().PhoneVerificationOTPByAccessToken(accessToken, otp, smsTemplate, isVoiceOtp).Result;
Phone Number Update (PUT)

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

var accessToken = "accessToken"; //Required
var phone = "phone"; //Required
var smsTemplate = "smsTemplate"; //Optional
var isVoiceOtp = false; //Optional
var apiResponse = new PhoneAuthenticationApi().UpdatePhoneNumber(accessToken, phone, smsTemplate, isVoiceOtp).Result;
Phone Login (POST)

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

PhoneAuthenticationModel phoneAuthenticationModel = new PhoneAuthenticationModel{
Password ="<Password>",
Phone ="<Phone>"
}; //Required
string fields = null; //Optional
var loginUrl = "loginUrl"; //Optional
var smsTemplate = "smsTemplate"; //Optional
var apiResponse = new PhoneAuthenticationApi().LoginByPhone(phoneAuthenticationModel, fields, loginUrl, smsTemplate).Result;
Phone Forgot Password by OTP (POST)

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

var phone = "phone"; //Required
var smsTemplate = "smsTemplate"; //Optional
var isVoiceOtp = false; //Optional
var apiResponse = new PhoneAuthenticationApi().ForgotPasswordByPhoneOTP(phone, smsTemplate, isVoiceOtp).Result;
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

var phone = "phone"; //Required
var smsTemplate = "smsTemplate"; //Optional
var isVoiceOtp = false; //Optional
var apiResponse = new PhoneAuthenticationApi().PhoneResendVerificationOTP(phone, smsTemplate, isVoiceOtp).Result;
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

var accessToken = "accessToken"; //Required
var phone = "phone"; //Required
var smsTemplate = "smsTemplate"; //Optional
var apiResponse = new PhoneAuthenticationApi().PhoneResendVerificationOTPByToken(accessToken, phone, smsTemplate).Result;
Phone User Registration by SMS (POST)

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

AuthUserRegistrationModel authUserRegistrationModel = new AuthUserRegistrationModel{
Email = new List<EmailModel>{
new EmailModel{
Type ="<Type>",
Value ="<Value>"
}},
FirstName ="<FirstName>",
LastName ="<LastName>",
Password ="<Password>",
PhoneId ="<PhoneId>"
}; //Required
var sott = "sott"; //Required
string fields = null; //Optional
var options = "options"; //Optional
var smsTemplate = "smsTemplate"; //Optional
var verificationUrl = "verificationUrl"; //Optional
var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
var emailTemplate = "emailTemplate"; //Optional
var isVoiceOtp = false; //Optional
var apiResponse = new PhoneAuthenticationApi().UserRegistrationByPhone(authUserRegistrationModel, sott, fields, options,smsTemplate, verificationUrl, welcomeEmailTemplate, emailTemplate, isVoiceOtp).Result;
Phone Number Availability (GET)

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

var phone = "phone"; //Required
var apiResponse = new PhoneAuthenticationApi().CheckPhoneNumberAvailability(phone).Result;
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

var accessToken = "accessToken"; //Required
var apiResponse = new PhoneAuthenticationApi().RemovePhoneIDByAccessToken(accessToken).Result;

MultiFactorAuthentication API

List of APIs in this Section:
PUT : Update MFA Setting
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 Backup code
PUT : MFA Update Phone Number
PUT : Verify MFA Email OTP by MFA Token
PUT : Update MFA Security Question by MFA Token
PUT : MFA Validate Authenticator Code
PUT : MFA Verify Authenticator Code
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

Update MFA Setting (PUT)

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

var accessToken = "accessToken"; //Required
MultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout = new MultiFactorAuthModelWithLockout{
Otp ="<Otp>"
}; //Required
string fields = null; //Optional
var apiResponse = new MultiFactorAuthenticationApi().MFAUpdateSetting(accessToken, multiFactorAuthModelWithLockout, fields).Result;
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

var accessToken = "accessToken"; //Required
var phoneNo2FA = "phoneNo2FA"; //Required
var smsTemplate2FA = "smsTemplate2FA"; //Optional
var isVoiceOtp = false; //Optional
var options = "options"; //Optional
var apiResponse = new MultiFactorAuthenticationApi().MFAUpdatePhoneNumberByToken(accessToken, phoneNo2FA, smsTemplate2FA, isVoiceOtp, options).Result;
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

var accessToken = "accessToken"; //Required
MultiFactorAuthModelByEmailOtpWithLockout multiFactorAuthModelByEmailOtpWithLockout = new MultiFactorAuthModelByEmailOtpWithLockout{
  EmailId="emailid",
  Otp="otp"
}; //Required
var apiResponse = new MultiFactorAuthenticationApi().MFAValidateEmailOtpByAccessToken(accessToken, multiFactorAuthModelByEmailOtpWithLockout).Result;
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

var accessToken = "accessToken"; //Required
SecurityQuestionAnswerModelByAccessToken securityQuestionAnswerModelByAccessToken = new SecurityQuestionAnswerModelByAccessToken{
ReplaceSecurityQuestionAnswer = false,
SecurityQuestionAnswer = new List<SecurityQuestionOptionalModel> { 
new SecurityQuestionOptionalModel
{
QuestionId="",
Answer=""       
}}
};  //Required
var apiResponse = new MultiFactorAuthenticationApi().MFASecurityQuestionAnswerByAccessToken(accessToken, securityQuestionAnswerModelByAccessToken).Result;
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

MultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout = new MultiFactorAuthModelWithLockout{
Otp ="<Otp>"
}; //Required
var secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required
string fields = null; //Optional
var smsTemplate2FA = "smsTemplate2FA"; //Optional
var rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional
var rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional
var rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional
var rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional
var apiResponse = new MultiFactorAuthenticationApi().MFAValidateOTPByPhone(multiFactorAuthModelWithLockout, secondFactorAuthenticationToken, fields, smsTemplate2FA, rbaBrowserEmailTemplate, rbaCityEmailTemplate, rbaCountryEmailTemplate, rbaIpEmailTemplate).Result;
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

MultiFactorAuthModelByBackupCode multiFactorAuthModelByBackupCode = new MultiFactorAuthModelByBackupCode{
BackupCode ="<BackupCode>"
}; //Required
var secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required
string fields = null; //Optional
var rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional
var rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional
var rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional
var rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional
var apiResponse = new MultiFactorAuthenticationApi().MFAValidateBackupCode(multiFactorAuthModelByBackupCode, secondFactorAuthenticationToken, fields, rbaBrowserEmailTemplate, rbaCityEmailTemplate, rbaCountryEmailTemplate, rbaIpEmailTemplate).Result;
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

var phoneNo2FA = "phoneNo2FA"; //Required
var secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required
var smsTemplate2FA = "smsTemplate2FA"; //Optional
var isVoiceOtp = false; //Optional
var options = "options"; //Optional
var apiResponse = new MultiFactorAuthenticationApi().MFAUpdatePhoneNumber(phoneNo2FA, secondFactorAuthenticationToken, smsTemplate2FA, isVoiceOtp,options).Result;
Verify MFA Email OTP by MFA Token (PUT)

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

MultiFactorAuthModelByEmailOtp multiFactorAuthModelByEmailOtp = new MultiFactorAuthModelByEmailOtp{
  EmailId="emailId",
  Otp="otp"
}; //Required
var secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required
var rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional
var rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional
var rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional
var rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional
var apiResponse = new MultiFactorAuthenticationApi().MFAValidateEmailOtp(multiFactorAuthModelByEmailOtp, secondFactorAuthenticationToken, rbaBrowserEmailTemplate, rbaCityEmailTemplate, rbaCountryEmailTemplate, rbaIpEmailTemplate).Result;
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

SecurityQuestionAnswerUpdateModel securityQuestionAnswerUpdateModel = new SecurityQuestionAnswerUpdateModel {
SecurityQuestionAnswer = new List<SecurityQuestionModel> {
new SecurityQuestionModel
{
QuestionId="db7****8a73e4******bd9****8c20",
Answer="<answer"
}
}
}; //Required
var secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required
var apiResponse = new MultiFactorAuthenticationApi().MFASecurityQuestionAnswer(securityQuestionAnswerUpdateModel, secondFactorAuthenticationToken).Result;
MFA Validate Authenticator Code (PUT)

This API is used to login to a user's account during the second MFA step with an Authenticator Code. More Info

MultiFactorAuthModelByAuthenticatorCode multiFactorAuthModelByAuthenticatorCode = new MultiFactorAuthModelByAuthenticatorCode{
AuthenticatorCode ="<AuthenticatorCode>"
}; //Required
var secondfactorauthenticationtoken = "secondfactorauthenticationtoken"; //Required
string fields = null; //Optional
var apiResponse = new MultiFactorAuthenticationApi().MFAValidateAuthenticatorCode(multiFactorAuthModelByAuthenticatorCode, secondfactorauthenticationtoken, fields).Result;
MFA Verify Authenticator Code (PUT)

This API is used to validate an Authenticator Code as part of the MFA process. More Info

var accessToken = "accessToken"; //Required
MultiFactorAuthModelByAuthenticatorCodeSecurityAnswer multiFactorAuthModelByAuthenticatorCodeSecurityAnswer = new MultiFactorAuthModelByAuthenticatorCodeSecurityAnswer{
AuthenticatorCode ="<AuthenticatorCode>"
}; //Required
string fields = null; //Optional
var apiResponse = new MultiFactorAuthenticationApi().MFAVerifyAuthenticatorCode(accessToken, multiFactorAuthModelByAuthenticatorCodeSecurityAnswer, fields).Result;
MFA Email Login (POST)

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

var email = "email"; //Required
var password = "password"; //Required
var emailTemplate = "emailTemplate"; //Optional
string fields = null; //Optional
var loginUrl = "loginUrl"; //Optional
var smsTemplate = "smsTemplate"; //Optional
var smsTemplate2FA = "smsTemplate2FA"; //Optional
var verificationUrl = "verificationUrl"; //Optional
var emailTemplate2FA = "emailTemplate2FA"; //Optional
var isVoiceOtp = false; //Optional
var options = "options"; //Optional
var apiResponse = new MultiFactorAuthenticationApi().MFALoginByEmail(email, password, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl, emailTemplate2FA, isVoiceOtp, options).Result;
MFA UserName Login (POST)

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

var password = "password"; //Required
var username = "username"; //Required
var emailTemplate = "emailTemplate"; //Optional
string fields = null; //Optional
var loginUrl = "loginUrl"; //Optional
var smsTemplate = "smsTemplate"; //Optional
var smsTemplate2FA = "smsTemplate2FA"; //Optional
var verificationUrl = "verificationUrl"; //Optional
var emailTemplate2FA = "emailTemplate2FA"; //Optional
var isVoiceOtp = false; //Optional
var apiResponse = new MultiFactorAuthenticationApi().MFALoginByUserName(password, username, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl, emailTemplate2FA, isVoiceOtp).Result;
MFA Phone Login (POST)

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

var password = "password"; //Required
var phone = "phone"; //Required
var emailTemplate = "emailTemplate"; //Optional
string fields = null; //Optional
var loginUrl = "loginUrl"; //Optional
var smsTemplate = "smsTemplate"; //Optional
var smsTemplate2FA = "smsTemplate2FA"; //Optional
var verificationUrl = "verificationUrl"; //Optional
var emailTemplate2FA = "emailTemplate2FA"; //Optional
var isVoiceOtp = false; //Optional
var options = "options"; //Optional
var apiResponse = new MultiFactorAuthenticationApi().MFALoginByPhone(password, phone, emailTemplate, emailTemplate2FA, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl, isVoiceOtp, options).Result;
Send MFA Email OTP by MFA Token (POST)

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

EmailIdModel emailIdModel = new EmailIdModel{
EmailId= "emailId"
}; //Required
var secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required
var emailTemplate2FA = "emailTemplate2FA"; //Optional
var apiResponse = new MultiFactorAuthenticationApi().MFAEmailOTP(emailIdModel, secondFactorAuthenticationToken, emailTemplate2FA).Result;
Verify MFA Security Question by MFA Token (POST)

This API is used to login to a user's account during the second MFA step via answering the security questions.More Info

SecurityQuestionAnswerUpdateModel securityQuestionAnswerUpdateModel = new SecurityQuestionAnswerUpdateModel
{
SecurityQuestionAnswer =new List<SecurityQuestionModel>{
new SecurityQuestionModel
{
QuestionId = "db7****8a73e4******bd9****8c20",
Answer = "<answer>"
}
}
}; //Required
var secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required
var rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional
var rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional
var rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional
var rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional
var apiResponse = new MultiFactorAuthenticationApi().MFASecurityQuestionAnswerVerification(securityQuestionAnswerUpdateModel, secondFactorAuthenticationToken, rbaBrowserEmailTemplate, rbaCityEmailTemplate, rbaCountryEmailTemplate, rbaIpEmailTemplate).Result;
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

var accessToken = "accessToken"; //Required
var isVoiceOtp = false; //Optional
var apiResponse = new MultiFactorAuthenticationApi().MFAConfigureByAccessToken(accessToken, isVoiceOtp).Result;
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

var accessToken = "accessToken"; //Required
var apiResponse = new MultiFactorAuthenticationApi().MFABackupCodeByAccessToken(accessToken).Result;
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

var accessToken = "accessToken"; //Required
var apiResponse = new MultiFactorAuthenticationApi().MFAResetBackupCodeByAccessToken(accessToken).Result;
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

var accessToken = "accessToken"; //Required
var emailId = "emailId"; //Required
var emailTemplate2FA = "emailTemplate2FA"; //Optional
var apiResponse = new MultiFactorAuthenticationApi().MFAEmailOtpByAccessToken(accessToken, emailId, emailTemplate2FA).Result;
MFA Resend Otp (GET)

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

var secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required
var smsTemplate2FA = "smsTemplate2FA"; //Optional
var isVoiceOtp = false; //Optional
var apiResponse = new MultiFactorAuthenticationApi().MFAResendOTP(secondFactorAuthenticationToken, smsTemplate2FA, isVoiceOtp).Result;
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

var uid = "uid"; //Required
var apiResponse = new MultiFactorAuthenticationApi().MFABackupCodeByUid(uid).Result;
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

var uid = "uid"; //Required
var apiResponse = new MultiFactorAuthenticationApi().MFAResetBackupCodeByUid(uid).Result;
MFA Reset Authenticator by Token (DELETE)

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

var accessToken = "accessToken"; //Required
var googleAuthenticator = true; //Required
var apiResponse = new MultiFactorAuthenticationApi().MFAResetAuthenticatorByToken(accessToken, googleAuthenticator).Result;
MFA Reset SMS Authenticator by Token (DELETE)

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

var accessToken = "accessToken"; //Required
var otpAuthenticator = true; //Required
var apiResponse = new MultiFactorAuthenticationApi().MFAResetSMSAuthByToken(accessToken, otpAuthenticator).Result;
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

var accessToken = "accessToken"; //Required
var apiResponse = new MultiFactorAuthenticationApi().MFAResetEmailOtpAuthenticatorByAccessToken(accessToken).Result;
MFA Reset Security Question Authenticator By Access Token (DELETE)

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

var accessToken = "accessToken"; //Required
var apiResponse = new MultiFactorAuthenticationApi().MFAResetSecurityQuestionAuthenticatorByAccessToken(accessToken).Result;
MFA Reset SMS Authenticator By UID (DELETE)

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

var otpAuthenticator = true; //Required
var uid = "uid"; //Required
var apiResponse = new MultiFactorAuthenticationApi().MFAResetSMSAuthenticatorByUid(otpAuthenticator, uid).Result;
MFA Reset Authenticator By UID (DELETE)

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

var authenticator = true; //Required
var uid = "uid"; //Required
var apiResponse = new MultiFactorAuthenticationApi().MFAResetAuthenticatorByUid(authenticator, uid).Result;
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

var uid = "uid"; //Required
var apiResponse = new MultiFactorAuthenticationApi().MFAResetEmailOtpAuthenticatorByUid(uid).Result;
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

var uid = "uid"; //Required
var apiResponse = new MultiFactorAuthenticationApi().MFAResetSecurityQuestionAuthenticatorByUid(uid).Result;

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

Reset PIN By ResetToken (PUT)

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

ResetPINByResetToken resetPINByResetToken = new ResetPINByResetToken{
PIN ="<PIN>",
ResetToken ="<ResetToken>"
}; //Required
var apiResponse = new PINAuthenticationApi().ResetPINByResetToken(resetPINByResetToken).Result;
Reset PIN By SecurityAnswer And Email (PUT)

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

ResetPINBySecurityQuestionAnswerAndEmailModel resetPINBySecurityQuestionAnswerAndEmailModel = new ResetPINBySecurityQuestionAnswerAndEmailModel{
Email ="<Email>",
PIN ="<PIN>",
SecurityAnswer = new Dictionary<String,String>{
["QuestionID"] = "Answer"
}
}; //Required
var apiResponse = new PINAuthenticationApi().ResetPINByEmailAndSecurityAnswer(resetPINBySecurityQuestionAnswerAndEmailModel).Result;
Reset PIN By SecurityAnswer And Username (PUT)

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

ResetPINBySecurityQuestionAnswerAndUsernameModel resetPINBySecurityQuestionAnswerAndUsernameModel = new ResetPINBySecurityQuestionAnswerAndUsernameModel{
PIN ="<PIN>",
SecurityAnswer = new Dictionary<String,String>{
["QuestionID"] = "Answer"
},
Username ="<Username>"
}; //Required
var apiResponse = new PINAuthenticationApi().ResetPINByUsernameAndSecurityAnswer(resetPINBySecurityQuestionAnswerAndUsernameModel).Result;
Reset PIN By SecurityAnswer And Phone (PUT)

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

ResetPINBySecurityQuestionAnswerAndPhoneModel resetPINBySecurityQuestionAnswerAndPhoneModel = new ResetPINBySecurityQuestionAnswerAndPhoneModel{
Phone ="<Phone>",
PIN ="<PIN>",
SecurityAnswer = new Dictionary<String,String>{
["QuestionID"] = "Answer"
}
}; //Required
var apiResponse = new PINAuthenticationApi().ResetPINByPhoneAndSecurityAnswer(resetPINBySecurityQuestionAnswerAndPhoneModel).Result;
Change PIN By Token (PUT)

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

var accessToken = "accessToken"; //Required
ChangePINModel changePINModel = new ChangePINModel{
NewPIN ="<NewPIN>",
OldPIN ="<OldPIN>"
}; //Required
var apiResponse = new PINAuthenticationApi().ChangePINByAccessToken(accessToken, changePINModel).Result;
Reset PIN by Phone and OTP (PUT)

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

ResetPINByPhoneAndOTPModel resetPINByPhoneAndOTPModel = new ResetPINByPhoneAndOTPModel{
Otp ="<Otp>",
Phone ="<Phone>",
PIN ="<PIN>"
}; //Required
var apiResponse = new PINAuthenticationApi().ResetPINByPhoneAndOtp(resetPINByPhoneAndOTPModel).Result;
Reset PIN by Email and OTP (PUT)

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

ResetPINByEmailAndOtpModel resetPINByEmailAndOtpModel = new ResetPINByEmailAndOtpModel{
Email ="<Email>",
Otp ="<Otp>",
PIN ="<PIN>"
}; //Required
var apiResponse = new PINAuthenticationApi().ResetPINByEmailAndOtp(resetPINByEmailAndOtpModel).Result;
Reset PIN by Username and OTP (PUT)

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

ResetPINByUsernameAndOtpModel resetPINByUsernameAndOtpModel = new ResetPINByUsernameAndOtpModel{
Otp ="<Otp>",
PIN ="<PIN>",
Username ="<Username>"
}; //Required
var apiResponse = new PINAuthenticationApi().ResetPINByUsernameAndOtp(resetPINByUsernameAndOtpModel).Result;
PIN Login (POST)

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

LoginByPINModel loginByPINModel = new LoginByPINModel{
PIN ="<PIN>"
}; //Required
var sessionToken = "sessionToken"; //Required
var apiResponse = new PINAuthenticationApi().PINLogin(loginByPINModel, sessionToken).Result;
Forgot PIN By Email (POST)

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

ForgotPINLinkByEmailModel forgotPINLinkByEmailModel = new ForgotPINLinkByEmailModel{
Email ="<Email>"
}; //Required
var emailTemplate = "emailTemplate"; //Optional
var resetPINUrl = "resetPINUrl"; //Optional
var apiResponse = new PINAuthenticationApi().SendForgotPINEmailByEmail(forgotPINLinkByEmailModel, emailTemplate, resetPINUrl).Result;
Forgot PIN By UserName (POST)

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

ForgotPINLinkByUserNameModel forgotPINLinkByUserNameModel = new ForgotPINLinkByUserNameModel{
UserName ="<UserName>"
}; //Required
var emailTemplate = "emailTemplate"; //Optional
var resetPINUrl = "resetPINUrl"; //Optional
var apiResponse = new PINAuthenticationApi().SendForgotPINEmailByUsername(forgotPINLinkByUserNameModel, emailTemplate, resetPINUrl).Result;
Forgot PIN By Phone (POST)

This API sends the OTP to specified phone number More Info

ForgotPINOtpByPhoneModel forgotPINOtpByPhoneModel = new ForgotPINOtpByPhoneModel{
Phone ="<Phone>"
}; //Required
var smsTemplate = "smsTemplate"; //Optional
var isVoiceOtp = false; //Optional
var apiResponse = new PINAuthenticationApi().SendForgotPINSMSByPhone(forgotPINOtpByPhoneModel, smsTemplate, isVoiceOtp).Result;
Set PIN By PinAuthToken (POST)

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

PINRequiredModel pinRequiredModel = new PINRequiredModel{
PIN ="<PIN>"
}; //Required
var pinAuthToken = "pinAuthToken"; //Required
var apiResponse = new PINAuthenticationApi().SetPINByPinAuthToken(pinRequiredModel, pinAuthToken).Result;
Invalidate PIN Session Token (GET)

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

var sessionToken = "sessionToken"; //Required
var apiResponse = new PINAuthenticationApi().InValidatePinSessionToken(sessionToken).Result;

ReAuthentication API

List of APIs in this Section:
PUT : Validate MFA by OTP
PUT : Validate MFA by Backup Code
PUT : Validate MFA by Password
PUT : MFA Re-authentication by PIN
PUT : MFA Re-authentication by Email OTP
PUT : MFA Step-Up Authentication by Authenticator Code
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

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

var accessToken = "accessToken"; //Required
ReauthByOtpModel reauthByOtpModel = new ReauthByOtpModel{
Otp ="<Otp>"
}; //Required
var apiResponse = new ReAuthenticationApi().MFAReAuthenticateByOTP(accessToken, reauthByOtpModel).Result;
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

var accessToken = "accessToken"; //Required
ReauthByBackupCodeModel reauthByBackupCodeModel = new ReauthByBackupCodeModel{
BackupCode ="<BackupCode>"
}; //Required
var apiResponse = new ReAuthenticationApi().MFAReAuthenticateByBackupCode(accessToken, reauthByBackupCodeModel).Result;
Validate MFA by Password (PUT)

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

var accessToken = "accessToken"; //Required
PasswordEventBasedAuthModelWithLockout passwordEventBasedAuthModelWithLockout = new PasswordEventBasedAuthModelWithLockout{
Password ="<Password>"
}; //Required
var smsTemplate2FA = "smsTemplate2FA"; //Optional
var apiResponse = new ReAuthenticationApi().MFAReAuthenticateByPassword(accessToken, passwordEventBasedAuthModelWithLockout, smsTemplate2FA).Result;
MFA Re-authentication by PIN (PUT)

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

var accessToken = "accessToken"; //Required
PINAuthEventBasedAuthModelWithLockout pinAuthEventBasedAuthModelWithLockout = new PINAuthEventBasedAuthModelWithLockout{
PIN ="<PIN>"
}; //Required
var smsTemplate2FA = "smsTemplate2FA"; //Optional
var apiResponse = new ReAuthenticationApi().VerifyPINAuthentication(accessToken, pinAuthEventBasedAuthModelWithLockout, smsTemplate2FA).Result;
MFA Re-authentication by Email OTP (PUT)

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

var accessToken = "accessToken"; //Required
ReauthByEmailOtpModel reauthByEmailOtpModel = new ReauthByEmailOtpModel{
EmailId="emailId",
Otp="otp"
}; //Required
var apiResponse = new ReAuthenticationApi().ReAuthValidateEmailOtp(accessToken, reauthByEmailOtpModel).Result;
MFA Step-Up Authentication by Authenticator Code (PUT)

This API is used to validate the triggered MFA authentication flow with the Authenticator Code. More Info

var accessToken = "accessToken"; //Required
MultiFactorAuthModelByAuthenticatorCode multiFactorAuthModelByAuthenticatorCode = new MultiFactorAuthModelByAuthenticatorCode{
  AuthenticatorCode ="<AuthenticatorCode>"
}; //Required
var apiResponse = new ReAuthenticationApi().MFAReAuthenticateByAuthenticatorCode(accessToken, multiFactorAuthModelByAuthenticatorCode).Result;
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

EventBasedMultiFactorToken eventBasedMultiFactorToken = new EventBasedMultiFactorToken{
SecondFactorValidationToken ="<SecondFactorValidationToken>"
}; //Required
var uid = "uid"; //Required
var apiResponse = new ReAuthenticationApi().VerifyMultiFactorOtpReauthentication(eventBasedMultiFactorToken, uid).Result;
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

EventBasedMultiFactorToken eventBasedMultiFactorToken = new EventBasedMultiFactorToken{
SecondFactorValidationToken ="<SecondFactorValidationToken>"
}; //Required
var uid = "uid"; //Required
var apiResponse = new ReAuthenticationApi().VerifyMultiFactorPasswordReauthentication(eventBasedMultiFactorToken, uid).Result;
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

EventBasedMultiFactorToken eventBasedMultiFactorToken = new EventBasedMultiFactorToken{
SecondFactorValidationToken ="<SecondFactorValidationToken>"
}; //Required
var uid = "uid"; //Required
var apiResponse = new ReAuthenticationApi().VerifyMultiFactorPINReauthentication(eventBasedMultiFactorToken, uid).Result;
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

var accessToken = "accessToken"; //Required
SecurityQuestionAnswerUpdateModel securityQuestionAnswerUpdateModel = new SecurityQuestionAnswerUpdateModel
{
SecurityQuestionAnswer = new List<SecurityQuestionModel> {
new SecurityQuestionModel
{
QuestionId = "db7****8a73e4******bd9****8c20",
Answer = "<answer>"
}
}
}; //Required
var apiResponse = new ReAuthenticationApi().ReAuthBySecurityQuestion(accessToken, securityQuestionAnswerUpdateModel).Result;
Multi Factor Re-Authenticate (GET)

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

var accessToken = "accessToken"; //Required
var smsTemplate2FA = "smsTemplate2FA"; //Optional
var isVoiceOtp = false; //Optional
var apiResponse = new ReAuthenticationApi().MFAReAuthenticate(accessToken, smsTemplate2FA, isVoiceOtp).Result;
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

var accessToken = "accessToken"; //Required
var emailId = "emailId"; //Required
var emailTemplate2FA = "emailTemplate2FA"; //Optional
var apiResponse = new ReAuthenticationApi().ReAuthSendEmailOtp(accessToken, emailId, emailTemplate2FA).Result;

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

Update Consent By Access Token (PUT)

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

var accessToken = "accessToken"; //Required
ConsentUpdateModel consentUpdateModel = new ConsentUpdateModel{
Consents = new List<ConsentDataModel>{
new ConsentDataModel{
ConsentOptionId ="<ConsentOptionId>",
IsAccepted = true
}}
}; //Required
var apiResponse = new ConsentManagementApi().UpdateConsentProfileByAccessToken(accessToken, consentUpdateModel).Result;
Consent By ConsentToken (POST)

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

var consentToken = "consentToken"; //Required
ConsentSubmitModel consentSubmitModel = new ConsentSubmitModel{
Data = new List<ConsentDataModel>{
new ConsentDataModel{
ConsentOptionId ="<ConsentOptionId>",
IsAccepted = true
}},
Events = new List<ConsentEventModel>{
new ConsentEventModel{
Event ="<Event>",
IsCustom = true
}}
}; //Required
var apiResponse = new ConsentManagementApi().SubmitConsentByConsentToken(consentToken, consentSubmitModel).Result;
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

var accessToken = "accessToken"; //Required
ConsentSubmitModel consentSubmitModel = new ConsentSubmitModel{
Data = new List<ConsentDataModel>{
new ConsentDataModel{
ConsentOptionId ="<ConsentOptionId>",
IsAccepted = true
}},
Events = new List<ConsentEventModel>{
new ConsentEventModel{
Event ="<Event>",
IsCustom = true
}}
}; //Required
var apiResponse = new ConsentManagementApi().SubmitConsentByAccessToken(accessToken, consentSubmitModel).Result;
Get Consent Logs By Uid (GET)

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

var uid = "uid"; //Required
var apiResponse = new ConsentManagementApi().GetConsentLogsByUid(uid).Result;
Get Consent Log by Access Token (GET)

This API is used to fetch consent logs. More Info

var accessToken = "accessToken"; //Required
var apiResponse = new ConsentManagementApi().GetConsentLogs(accessToken).Result;
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

var accessToken = "accessToken"; //Required
var @event = "@event"; //Required
var isCustom = true; //Required
var apiResponse = new ConsentManagementApi().VerifyConsentByAccessToken(accessToken, @event, isCustom).Result;

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

Smart Login Verify Token (GET)

This API verifies the provided token for Smart Login More Info

var verificationToken = "verificationToken"; //Required
var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
var apiResponse = new SmartLoginApi().SmartLoginTokenVerification(verificationToken, welcomeEmailTemplate).Result;
Smart Login By Email (GET)

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

var clientGuid = "clientGuid"; //Required
var email = "email"; //Required
var redirectUrl = "redirectUrl"; //Optional
var smartLoginEmailTemplate = "smartLoginEmailTemplate"; //Optional
var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
var apiResponse = new SmartLoginApi().SmartLoginByEmail(clientGuid, email, redirectUrl, smartLoginEmailTemplate, welcomeEmailTemplate).Result;
Smart Login By Username (GET)

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

var clientGuid = "clientGuid"; //Required
var username = "username"; //Required
var redirectUrl = "redirectUrl"; //Optional
var smartLoginEmailTemplate = "smartLoginEmailTemplate"; //Optional
var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
var apiResponse = new SmartLoginApi().SmartLoginByUserName(clientGuid, username, redirectUrl, smartLoginEmailTemplate, welcomeEmailTemplate).Result;
Smart Login Ping (GET)

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

var clientGuid = "clientGuid"; //Required
string fields = null; //Optional
var apiResponse = new SmartLoginApi().SmartLoginPing(clientGuid, fields).Result;

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

One Touch OTP Verification (PUT)

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

var otp = "otp"; //Required
var phone = "phone"; //Required
string fields = null; //Optional
var smsTemplate = "smsTemplate"; //Optional
var apiResponse = new OneTouchLoginApi().OneTouchLoginOTPVerification(otp, phone, fields, smsTemplate).Result;
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

OneTouchLoginByEmailModel oneTouchLoginByEmailModel = new OneTouchLoginByEmailModel{
Clientguid ="<Clientguid>",
Email ="<Email>",
G_recaptcha_response ="<G-recaptcha-response>"
}; //Required
var oneTouchLoginEmailTemplate = "oneTouchLoginEmailTemplate"; //Optional
var redirecturl = "redirecturl"; //Optional
var welcomeemailtemplate = "welcomeemailtemplate"; //Optional
var apiResponse = new OneTouchLoginApi().OneTouchLoginByEmail(oneTouchLoginByEmailModel, oneTouchLoginEmailTemplate, redirecturl, welcomeemailtemplate).Result;
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

OneTouchLoginByPhoneModel oneTouchLoginByPhoneModel = new OneTouchLoginByPhoneModel{
G_recaptcha_response ="<G-recaptcha-response>",
Phone ="<Phone>"
}; //Required
var smsTemplate = "smsTemplate"; //Optional
var isVoiceOtp = false; //Optional
var apiResponse = new OneTouchLoginApi().OneTouchLoginByPhone(oneTouchLoginByPhoneModel, smsTemplate, isVoiceOtp).Result;
One Touch Email Verification (GET)

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

var verificationToken = "verificationToken"; //Required
var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
var apiResponse = new OneTouchLoginApi().OneTouchEmailVerification(verificationToken, welcomeEmailTemplate).Result;
One Touch Login Ping (GET)

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

var clientGuid = "clientGuid"; //Required
string fields = null; //Optional
var apiResponse = new OneTouchLoginApi().OneTouchLoginPing(clientGuid, fields).Result;

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

Passwordless Login Phone Verification (PUT)

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

PasswordLessLoginOtpModel passwordLessLoginOtpModel = new PasswordLessLoginOtpModel{
Otp ="<Otp>",
Phone ="<Phone>"
}; //Required
string fields = null; //Optional
var smsTemplate = "smsTemplate"; //Optional
var isVoiceOtp = false; //Optional
var apiResponse = new PasswordLessLoginApi().PasswordlessLoginPhoneVerification(passwordLessLoginOtpModel, fields, smsTemplate, isVoiceOtp).Result;
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

PasswordLessLoginByEmailAndOtpModel passwordLessLoginByEmailAndOtpModel = new PasswordLessLoginByEmailAndOtpModel{
  Otp ="<Otp>",
  Email ="<Email>"
}; //Required
string fields = null; //Optional
var apiResponse = new PasswordLessLoginApi().PasswordlessLoginVerificationByEmailAndOTP(passwordLessLoginByEmailAndOtpModel, fields).Result;
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

PasswordLessLoginByUserNameAndOtpModel passwordLessLoginByUserNameAndOtpModel = new PasswordLessLoginByUserNameAndOtpModel{
  Otp ="<Otp>",
  UserName ="<UserName>"
}; //Required
string fields = null; //Optional
var apiResponse = new PasswordLessLoginApi().PasswordlessLoginVerificationByUserNameAndOTP(passwordLessLoginByUserNameAndOtpModel, fields).Result;
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

var phone = "phone"; //Required
var smsTemplate = "smsTemplate"; //Optional
var isVoiceOtp = false; //Optional
var apiResponse = new PasswordLessLoginApi().PasswordlessLoginByPhone(phone, smsTemplate, isVoiceOtp).Result;
Passwordless Login By Email (GET)

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

var email = "email"; //Required
var passwordLessLoginTemplate = "passwordLessLoginTemplate"; //Optional
var verificationUrl = "verificationUrl"; //Optional
var apiResponse = new PasswordLessLoginApi().PasswordlessLoginByEmail(email, passwordLessLoginTemplate, verificationUrl).Result;
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

var username = "username"; //Required
var passwordLessLoginTemplate = "passwordLessLoginTemplate"; //Optional
var verificationUrl = "verificationUrl"; //Optional
var apiResponse = new PasswordLessLoginApi().PasswordlessLoginByUserName(username, passwordLessLoginTemplate, verificationUrl).Result;
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

var verificationToken = "verificationToken"; //Required
string fields = null; //Optional
var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional
var apiResponse = new PasswordLessLoginApi().PasswordlessLoginVerification(verificationToken, fields, welcomeEmailTemplate).Result;

Configuration API

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

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

var apiResponse = new ConfigurationApi().GetConfigurations().Result;
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

var timeDifference = 0; //Optional
var apiResponse = new ConfigurationApi().GetServerInfo(timeDifference).Result;

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

Assign Roles by UID (PUT)

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

AccountRolesModel accountRolesModel = new AccountRolesModel{
Roles = new List<String>{"Roles"}
}; //Required
var uid = "uid"; //Required
var apiResponse = new RoleApi().AssignRolesByUid(accountRolesModel, uid).Result;
Upsert Context (PUT)

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

AccountRoleContextModel accountRoleContextModel = new AccountRoleContextModel{
RoleContext = new List<RoleContextRoleModel>{
new RoleContextRoleModel{
AdditionalPermissions = new List<String>{"AdditionalPermissions"},
Context ="<Context>",
Expiration ="<Expiration>",
Roles = new List<String>{"Roles"}
}}
}; //Required
var uid = "uid"; //Required
var apiResponse = new RoleApi().UpdateRoleContextByUid(accountRoleContextModel, uid).Result;
Add Permissions to Role (PUT)

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

PermissionsModel permissionsModel = new PermissionsModel{
Permissions = new List<String>{"Permissions"}
}; //Required
var role = "role"; //Required
var apiResponse = new RoleApi().AddRolePermissions(permissionsModel, role).Result;
Roles Create (POST)

This API creates a role with permissions. More Info

RolesModel rolesModel = new RolesModel{
Roles = new List<RoleModel>{
new RoleModel{
Name ="<Name>",
Permissions = new Dictionary<String,Boolean>{
["Permission_name"] = true
}
}}
}; //Required
var apiResponse = new RoleApi().CreateRoles(rolesModel).Result;
Roles by UID (GET)

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

var uid = "uid"; //Required
var apiResponse = new RoleApi().GetRolesByUid(uid).Result;
Get Context with Roles and Permissions (GET)

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

var uid = "uid"; //Required
var apiResponse = new RoleApi().GetRoleContextByUid(uid).Result;
Role Context profile (GET)

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

var contextName = "contextName"; //Required
var apiResponse = new RoleApi().GetRoleContextByContextName(contextName).Result;
Roles List (GET)

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

var apiResponse = new RoleApi().GetRolesList().Result;
Unassign Roles by UID (DELETE)

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

AccountRolesModel accountRolesModel = new AccountRolesModel{
Roles = new List<String>{"Roles"}
}; //Required
var uid = "uid"; //Required
var apiResponse = new RoleApi().UnassignRolesByUid(accountRolesModel, uid).Result;
Delete Role Context (DELETE)

This API Deletes the specified Role Context More Info

var contextName = "contextName"; //Required
var uid = "uid"; //Required
var apiResponse = new RoleApi().DeleteRoleContextByUid(contextName, uid).Result;
Delete Role from Context (DELETE)

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

var contextName = "contextName"; //Required
RoleContextRemoveRoleModel roleContextRemoveRoleModel = new RoleContextRemoveRoleModel{
Roles = new List<String>{"Roles"}
}; //Required
var uid = "uid"; //Required
var apiResponse = new RoleApi().DeleteRolesFromRoleContextByUid(contextName, roleContextRemoveRoleModel, uid).Result;
Delete Additional Permission from Context (DELETE)

This API Deletes Additional Permissions from Context. More Info

var contextName = "contextName"; //Required
RoleContextAdditionalPermissionRemoveRoleModel roleContextAdditionalPermissionRemoveRoleModel = new RoleContextAdditionalPermissionRemoveRoleModel{
AdditionalPermissions = new List<String>{"AdditionalPermissions"}
}; //Required
var uid = "uid"; //Required
var apiResponse = new RoleApi().DeleteAdditionalPermissionFromRoleContextByUid(contextName, roleContextAdditionalPermissionRemoveRoleModel, uid).Result;
Account Delete Role (DELETE)

This API is used to delete the role. More Info

var role = "role"; //Required
var apiResponse = new RoleApi().DeleteRole(role).Result;
Remove Permissions (DELETE)

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

PermissionsModel permissionsModel = new PermissionsModel{
Permissions = new List<String>{"Permissions"}
}; //Required
var role = "role"; //Required
var apiResponse = new RoleApi().RemoveRolePermissions(permissionsModel, role).Result;

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

Risk Based Authentication Login by Email (POST)

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

EmailAuthenticationModel emailAuthenticationModel = new EmailAuthenticationModel{
Email ="<Email>",
Password ="<Password>"
}; //Required
var emailTemplate = "emailTemplate"; //Optional
string fields = null; //Optional
var loginUrl = "loginUrl"; //Optional
var passwordDelegation = true; //Optional
var passwordDelegationApp = "passwordDelegationApp"; //Optional
var rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional
var rbaBrowserSmsTemplate = "rbaBrowserSmsTemplate"; //Optional
var rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional
var rbaCitySmsTemplate = "rbaCitySmsTemplate"; //Optional
var rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional
var rbaCountrySmsTemplate = "rbaCountrySmsTemplate"; //Optional
var rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional
var rbaIpSmsTemplate = "rbaIpSmsTemplate"; //Optional
var rbaOneclickEmailTemplate = "rbaOneclickEmailTemplate"; //Optional
var rbaOTPSmsTemplate = "rbaOTPSmsTemplate"; //Optional
var smsTemplate = "smsTemplate"; //Optional
var verificationUrl = "verificationUrl"; //Optional
var apiResponse = new RiskBasedAuthenticationApi().RBALoginByEmail(emailAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl).Result;
Risk Based Authentication Login by Username (POST)

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

UserNameAuthenticationModel userNameAuthenticationModel = new UserNameAuthenticationModel{
Password ="<Password>",
Username ="<Username>"
}; //Required
var emailTemplate = "emailTemplate"; //Optional
string fields = null; //Optional
var loginUrl = "loginUrl"; //Optional
var passwordDelegation = true; //Optional
var passwordDelegationApp = "passwordDelegationApp"; //Optional
var rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional
var rbaBrowserSmsTemplate = "rbaBrowserSmsTemplate"; //Optional
var rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional
var rbaCitySmsTemplate = "rbaCitySmsTemplate"; //Optional
var rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional
var rbaCountrySmsTemplate = "rbaCountrySmsTemplate"; //Optional
var rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional
var rbaIpSmsTemplate = "rbaIpSmsTemplate"; //Optional
var rbaOneclickEmailTemplate = "rbaOneclickEmailTemplate"; //Optional
var rbaOTPSmsTemplate = "rbaOTPSmsTemplate"; //Optional
var smsTemplate = "smsTemplate"; //Optional
var verificationUrl = "verificationUrl"; //Optional
var apiResponse = new RiskBasedAuthenticationApi().RBALoginByUserName(userNameAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl).Result;
Risk Based Authentication Phone Login (POST)

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

PhoneAuthenticationModel phoneAuthenticationModel = new PhoneAuthenticationModel{
Password ="<Password>",
Phone ="<Phone>"
}; //Required
var emailTemplate = "emailTemplate"; //Optional
string fields = null; //Optional
var loginUrl = "loginUrl"; //Optional
var passwordDelegation = true; //Optional
var passwordDelegationApp = "passwordDelegationApp"; //Optional
var rbaBrowserEmailTemplate = "rbaBrowserEmailTemplate"; //Optional
var rbaBrowserSmsTemplate = "rbaBrowserSmsTemplate"; //Optional
var rbaCityEmailTemplate = "rbaCityEmailTemplate"; //Optional
var rbaCitySmsTemplate = "rbaCitySmsTemplate"; //Optional
var rbaCountryEmailTemplate = "rbaCountryEmailTemplate"; //Optional
var rbaCountrySmsTemplate = "rbaCountrySmsTemplate"; //Optional
var rbaIpEmailTemplate = "rbaIpEmailTemplate"; //Optional
var rbaIpSmsTemplate = "rbaIpSmsTemplate"; //Optional
var rbaOneclickEmailTemplate = "rbaOneclickEmailTemplate"; //Optional
var rbaOTPSmsTemplate = "rbaOTPSmsTemplate"; //Optional
var smsTemplate = "smsTemplate"; //Optional
var verificationUrl = "verificationUrl"; //Optional
var apiResponse = new RiskBasedAuthenticationApi().RBALoginByPhone(phoneAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl).Result;

Sott API

List of APIs in this Section:
GET : Generate SOTT

Generate SOTT (GET)

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

var timeDifference = 0; //Optional
var apiResponse = new SottApi().GenerateSott(timeDifference).Result;

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
GET : Get Access Token via Custom JWT Token

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

var fbAccessToken = "fbAccessToken"; //Required
var socialAppName = "socialAppName"; //Optional
var apiResponse = new NativeSocialApi().GetAccessTokenByFacebookAccessToken(fbAccessToken, socialAppName).Result;
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

var twAccessToken = "twAccessToken"; //Required
var twTokenSecret = "twTokenSecret"; //Required
var socialAppName = "socialAppName"; //Optional
var apiResponse = new NativeSocialApi().GetAccessTokenByTwitterAccessToken(twAccessToken, twTokenSecret, socialAppName).Result;
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

var googleAccessToken = "googleAccessToken"; //Required
var clientId = "clientId"; //Optional
var refreshToken = "refreshToken"; //Optional
var socialAppName = "socialAppName"; //Optional
var apiResponse = new NativeSocialApi().GetAccessTokenByGoogleAccessToken(googleAccessToken, clientId, refreshToken, socialAppName).Result;
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

var idToken = "idToken"; //Required
var apiResponse = new NativeSocialApi().GetAccessTokenByGoogleJWTAccessToken(idToken).Result;
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

var lnAccessToken = "lnAccessToken"; //Required
var socialAppName = "socialAppName"; //Optional
var apiResponse = new NativeSocialApi().GetAccessTokenByLinkedinAccessToken(lnAccessToken, socialAppName).Result;
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

var fsAccessToken = "fsAccessToken"; //Required
var apiResponse = new NativeSocialApi().GetAccessTokenByFoursquareAccessToken(fsAccessToken).Result;
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

var code = "code"; //Required
var socialAppName = "socialAppName"; //Optional
var apiResponse = new NativeSocialApi().GetAccessTokenByAppleIdCode(code, socialAppName).Result;
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

var code = "code"; //Required
var apiResponse = new NativeSocialApi().GetAccessTokenByWeChatCode(code).Result;
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

var googleAuthcode = "googleAuthcode"; //Required
var socialAppName = "socialAppName"; //Optional
var apiResponse = new NativeSocialApi().GetAccessTokenByGoogleAuthCode(googleAuthcode,socialAppName).Result;
Get Access Token via Custom JWT Token (GET)

This API is used to retrieve a LoginRadius access token by passing in a valid custom JWT token. More Info

var idToken = "idToken"; //Required
var providername = "providername"; //Required
var apiResponse = new NativeSocialApi().AccessTokenViaCustomJWTToken(idToken, providername).Result;

WebHook API

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

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

WebHookSubscribeModel webHookSubscribeModel = new WebHookSubscribeModel{
Event ="<Event>",
TargetUrl ="<TargetUrl>"
}; //Required
var apiResponse = new WebHookApi().WebHookSubscribe(webHookSubscribeModel).Result;
Webhook Subscribed URLs (GET)

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

var @event = "@event"; //Required
var apiResponse = new WebHookApi().GetWebHookSubscribedURLs(@event).Result;
Webhook Test (GET)

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

var apiResponse = new WebHookApi().WebhookTest().Result;
WebHook Unsubscribe (DELETE)

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

WebHookSubscribeModel webHookSubscribeModel = new WebHookSubscribeModel{
Event ="<Event>",
TargetUrl ="<TargetUrl>"
}; //Required
var apiResponse = new WebHookApi().WebHookUnsubscribe(webHookSubscribeModel).Result;

SlidingToken API

List of APIs in this Section:
GET : Get Sliding Access Token

(GET)

This API is used to get access token and refresh token with the expired/nonexpired access token. More Info

var accessToken = "accessToken"; //Required
var apiResponse = new SlidingTokenApi().SlidingAccessToken(accessToken).Result;

JWT Token Validate

This is the inbuilt SDK JWT Token Validate method and we are using the JwtSecurityTokenHandler for this.The JwtSecurityTokenHandler class in the System.IdentityModel.Tokens.Jwt (opens new window)package will handle the low-level details of validating a JWT.

This method will return an instance of JwtSecurityToken if the token is valid. But in the case of any type error the method return System.Exception in the same class.

Note:- This method is supported only .NET 45 or later / .NetStandard 2.0 or later

JwtValidationParameters jwtParameters = new JwtValidationParameters
{
  JwtToken = "",
  Secret = ""
};

var jwt = new JwtTokenValidation().validateJwtToken(jwtParameters);
  if(jwt.Error != null) {

    // write your code here
  }

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 util function.

LoginRadiusSecureOneTimeToken _sott = new LoginRadiusSecureOneTimeToken();

// You can pass the start and end time interval and the SOTT will be valid for this time duration, StartTime and EndTime are optional but if passing the value then both value need to be passed.

var sott = new SottRequest
{

StartTime = "2017-05-15 07:10:42", // Valid Start Date with Date and time

EndTime="2017-05-15 07:20:42", // Valid End Date with Date and time

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

TimeDifference="10" // (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.
};

var apiKey = ""; //(Optional) LoginRadius Api Key.

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

var 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.

//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.  


var generatedSott=_sott.GetSott(sott,apiKey,apiSecret,getLrServerTime);

Demo

We have configured a sample ASP.net project with extended social profile data, webhook Apis, Account APis. You can get a copy of our demo project at GitHub.