LoginRadius Customer Identity and Access Management SDK for Java
LoginRadius Java Customer Registration wrapper provides access to LoginRadius Identity Management Platform API.
LoginRadius is an Identity Management Platform that simplifies user registration along with securing data. LoginRadius Platform simplifies and secures your user registration process and makes authentication easy, increases conversion with Social Login that combines 30 major social media 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 easily in your database.
LoginRadius centralizes it all in one place, making it easy to manage and access. Easy to 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.
LoginRadius is now using Maven which is used to automatically download your dependencies and adjust itself. At the present the jars are available from a public maven repository.
Use the following dependency in your project:
<dependency>
<groupId>com.loginradius.sdk</groupId>
<artifactId>java-sdk</artifactId>
<version>11.0.0</version>
</dependency>
The jars are also available here. Select the directory for the latest version and download the jar files needed.
Disclaimer
This library is meant to help you with a quick implementation of the LoginRadius platform and also to serve as a reference point for the LoginRadius API. Keep in mind that it is an open-source library, which makes it you are easy and free to download and customize the library functions based on your specific application needs and helps to do some innovation with your ideas.
This documentation presumes you have worked through the client-side implementation to setup your LoginRadius User Registration interfaces that will service the initial registration and login process. Details on this can be found in the getting started guide.
Use the following dependency in your project:
You can also compile the source by running the following commands. This will generate the javadocs in java-sdk/target/apidocs
$ git clone https://github.com/LoginRadius/java-sdk.git
$ cd java-sdk
$ mvn install
# Requires maven, download from http://maven.apache.org/download.html
$ mvn dependency:copy-dependencies
# This will generate all dependencies here: java-sdk/target/dependency
The jars are also available at Maven.
Select the directory for the latest version and download the jar files.
Before using the SDK, you need to initialize the SDK with the help of following code: API Key and secret of your LoginRadius site. You can get one from here
LoginRadiusSDK.Initialize init = new LoginRadiusSDK.Initialize();
init.setApiKey("<your-loginradius-api-key>");
init.setApiSecret("<your-loginradius-api-secret>");
When initializing the SDK, optionally specify a custom domain.
init.setCustomDomain("<CUSTOM-DOMAIN>");
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 does not tamper during transit when someone calls our APIs.
init.setRequestSigning(true);
The User Registration system relies on two identifiers which you can retrieve as follows:
Pass the token returned in the User Registration login response to the code behind. You can use a javascript function in the login and sociallogin onSuccess functions. Additional details on setting up and configuring your interface is available here. You can set the action in the redirect function to the desired servlet or .jsp.
function redirect(token) {
var form = document.createElement("form");
form.method = "POST";
form.action = "Profile.jsp";
var _token = document.createElement("input");
_token.type = "hidden";
_token.name = "token";
_token.value = token;
form.appendChild(_token);
document.body.appendChild(form);
form.submit();
}
Sott class that uses 256-bit AES encryption which is not supported by Java out of the box,
Before calling the class of SOTT you need to install the JCE unlimited strength jars in the security folder.
- To apply the policy files:
- Download the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files from Oracle.
Be sure to download the correct policy file updates for your version of Java:
Java 6 http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html
java 7 http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
java 8 http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
2. Uncompress and extract the downloaded file. The download includes a Readme.txt and two .jar files with the same names as the existing policy files.
3. Locate the two existing policy files:
local_policy.jar
US_export_policy.jar
On UNIX, look in /lib/security/
On Windows, look in C:/Program Files/Java/jre/lib/security/
4. Replace the existing policy files with the unlimited strength policy files you extracted.
-
After complete the configuration, use below code to get the SOTT.
-
By default, the SOTT expiration time will be 10 minutes if you use the below code.
Sott sott = new Sott();
String sottResponse = sott.getSott(null);
- If you want to validate your SOTT for long term then pass required timedifference in minutes.
- We recommend to use the below way to validate SOTT for a long term because it uses the server time not your system local time.
ConfigurationApi config = new ConfigurationApi();
config.getServerInfo(50, new AsyncHandler < ServiceInfoModel > () {
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ServiceInfoModel service) {
try {
String sottResponse = Sott.getSott(service);
System.out.println("sott = " + sottResponse);
} catch (Exception e) {
e.printStackTrace();
}
}
});
List of APIs in this Section:
- PUT : Auth Update Profile by Token
- PUT : Auth Unlock Account by Access Token
- PUT : Auth Verify Email By OTP
- PUT : Auth Reset Password by Security Answer and Email
- PUT : Auth Reset Password by Security Answer and Phone
- PUT : Auth Reset Password by Security Answer and UserName
- PUT : Auth Reset Password by Reset Token
- PUT : Auth Reset Password by OTP
- PUT : Auth Reset Password by OTP and UserName
- PUT : Auth Change Password
- PUT : Auth Set or Change UserName
- PUT : Auth Resend Email Verification
- POST : Auth Add Email
- POST : Auth Login by Email
- POST : Auth Login by Username
- POST : Auth Forgot Password
- POST : Auth Link Social Identities
- POST : Auth Link Social Identities By Ping
- POST : Auth User Registration by Email
- POST : Auth User Registration By Captcha
- GET : Get Security Questions By Email
- GET : Get Security Questions By UserName
- GET : Get Security Questions By Phone
- GET : Get Security Questions By Access Token
- GET : Auth Validate Access token
- GET : Access Token Invalidate
- GET : Access Token Info
- GET : Auth Read all Profiles by Token
- GET : Auth Send Welcome Email
- GET : Auth Delete Account
- GET : Auth Check Email Availability
- GET : Auth Verify Email
- GET : Auth Check UserName Availability
- GET : Auth Privacy Policy Accept
- GET : Auth Privacy Policy History By Access Token
- DELETE : Auth Delete Account with Email Confirmation
- DELETE : Auth Remove Email
- DELETE : Auth Unlink Social Identities
String accessToken = "<accessToken>"; //Required
UserProfileUpdateModel userProfileUpdateModel = new UserProfileUpdateModel(); //Required
userProfileUpdateModel.setFirstName("firstName");
userProfileUpdateModel.setLastName("lastName");
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.updateProfileByAccessToken(accessToken, userProfileUpdateModel, emailTemplate, fields, smsTemplate, verificationUrl , new AsyncHandler<UserProfilePostResponse<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<Identity> response) {
System.out.println(response.getIsPosted());
}
});
String accessToken = "<accessToken>"; //Required
UnlockProfileModel unlockProfileModel = new UnlockProfileModel(); //Required
unlockProfileModel.setG_Recaptcha_Response("g-recaptcha-response");
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.unlockAccountByToken(accessToken, unlockProfileModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
EmailVerificationByOtpModel emailVerificationByOtpModel = new EmailVerificationByOtpModel(); //Required
emailVerificationByOtpModel.setEmail("email");
emailVerificationByOtpModel.setOtp("otp");
String fields = null; //Optional
String url = "<url>"; //Optional
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.verifyEmailByOTP( emailVerificationByOtpModel, fields, url, welcomeEmailTemplate , new AsyncHandler<UserProfilePostResponse<EmailVerificationData<Identity>>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<EmailVerificationData<Identity>> response) {
System.out.println(response.getIsPosted());
}
});
ResetPasswordBySecurityAnswerAndEmailModel resetPasswordBySecurityAnswerAndEmailModel = new ResetPasswordBySecurityAnswerAndEmailModel(); //Required
resetPasswordBySecurityAnswerAndEmailModel.setEmail("email");
resetPasswordBySecurityAnswerAndEmailModel.setPassword("password");
Map<String,String> securityAnswer= new HashMap<String,String> ();
securityAnswer.put("<security-qustion-id>", "<security-answer>" );
resetPasswordBySecurityAnswerAndEmailModel.setSecurityAnswer(securityAnswer);
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.resetPasswordBySecurityAnswerAndEmail( resetPasswordBySecurityAnswerAndEmailModel , new AsyncHandler<UserProfilePostResponse<AccessTokenBase>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<AccessTokenBase> response) {
System.out.println(response.getIsPosted());
}
});
ResetPasswordBySecurityAnswerAndPhoneModel resetPasswordBySecurityAnswerAndPhoneModel = new ResetPasswordBySecurityAnswerAndPhoneModel(); //Required
resetPasswordBySecurityAnswerAndPhoneModel.setPassword("password");
resetPasswordBySecurityAnswerAndPhoneModel.setPhone("phone");
Map<String,String> securityAnswer= new HashMap<String,String> ();
securityAnswer.put("<security-qustion-id>", "<security-answer>" );
resetPasswordBySecurityAnswerAndPhoneModel.setSecurityAnswer(securityAnswer);
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.resetPasswordBySecurityAnswerAndPhone( resetPasswordBySecurityAnswerAndPhoneModel , new AsyncHandler<UserProfilePostResponse<AccessTokenBase>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<AccessTokenBase> response) {
System.out.println(response.getIsPosted());
}
});
ResetPasswordBySecurityAnswerAndUserNameModel resetPasswordBySecurityAnswerAndUserNameModel = new ResetPasswordBySecurityAnswerAndUserNameModel(); //Required
resetPasswordBySecurityAnswerAndUserNameModel.setPassword("password");
Map<String,String> securityAnswer= new HashMap<String,String> ();
securityAnswer.put("<security-qustion-id>", "<security-answer>" );
resetPasswordBySecurityAnswerAndUserNameModel.setSecurityAnswer(securityAnswer);
resetPasswordBySecurityAnswerAndUserNameModel.setUserName("userName");
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.resetPasswordBySecurityAnswerAndUserName( resetPasswordBySecurityAnswerAndUserNameModel , new AsyncHandler<UserProfilePostResponse<AccessTokenBase>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<AccessTokenBase> response) {
System.out.println(response.getIsPosted());
}
});
ResetPasswordByResetTokenModel resetPasswordByResetTokenModel = new ResetPasswordByResetTokenModel(); //Required
resetPasswordByResetTokenModel.setPassword("password");
resetPasswordByResetTokenModel.setResetToken("resetToken");
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.resetPasswordByResetToken( resetPasswordByResetTokenModel , new AsyncHandler<UserProfilePostResponse<AccessTokenBase>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<AccessTokenBase> response) {
System.out.println(response.getIsPosted());
}
});
ResetPasswordByEmailAndOtpModel resetPasswordByEmailAndOtpModel = new ResetPasswordByEmailAndOtpModel(); //Required
resetPasswordByEmailAndOtpModel.setEmail("email");
resetPasswordByEmailAndOtpModel.setOtp("otp");
resetPasswordByEmailAndOtpModel.setPassword("password");
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.resetPasswordByEmailOTP( resetPasswordByEmailAndOtpModel , new AsyncHandler<UserProfilePostResponse<AccessTokenBase>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<AccessTokenBase> response) {
System.out.println(response.getIsPosted());
}
});
ResetPasswordByUserNameModel resetPasswordByUserNameModel = new ResetPasswordByUserNameModel(); //Required
resetPasswordByUserNameModel.setOtp("otp");
resetPasswordByUserNameModel.setPassword("password");
resetPasswordByUserNameModel.setUserName("userName");
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.resetPasswordByOTPAndUserName( resetPasswordByUserNameModel , new AsyncHandler<UserProfilePostResponse<AccessTokenBase>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<AccessTokenBase> response) {
System.out.println(response.getIsPosted());
}
});
String accessToken = "<accessToken>"; //Required
String newPassword = "<newPassword>"; //Required
String oldPassword = "<oldPassword>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.changePassword(accessToken, newPassword, oldPassword , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String accessToken = "<accessToken>"; //Required
String username = "<username>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.setOrChangeUserName(accessToken, username , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String email = "<email>"; //Required
String emailTemplate = "<emailTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.authResendEmailVerification(email, emailTemplate, verificationUrl , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String accessToken = "<accessToken>"; //Required
String email = "<email>"; //Required
String type = "<type>"; //Required
String emailTemplate = "<emailTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.addEmail(accessToken, email, type, emailTemplate, verificationUrl , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
EmailAuthenticationModel emailAuthenticationModel = new EmailAuthenticationModel(); //Required
emailAuthenticationModel.setEmail("email");
emailAuthenticationModel.setPassword("password");
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String loginUrl = "<loginUrl>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.loginByEmail( emailAuthenticationModel, emailTemplate, fields, loginUrl, verificationUrl , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
UserNameAuthenticationModel userNameAuthenticationModel = new UserNameAuthenticationModel(); //Required
userNameAuthenticationModel.setPassword("password");
userNameAuthenticationModel.setUsername("username");
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String loginUrl = "<loginUrl>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.loginByUserName( userNameAuthenticationModel, emailTemplate, fields, loginUrl, verificationUrl , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
String email = "<email>"; //Required
String resetPasswordUrl = "<resetPasswordUrl>"; //Required
String emailTemplate = "<emailTemplate>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.forgotPassword(email, resetPasswordUrl, emailTemplate , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String accessToken = "<accessToken>"; //Required
String candidateToken = "<candidateToken>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.linkSocialIdentities(accessToken, candidateToken , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String accessToken = "<accessToken>"; //Required
String clientGuid = "<clientGuid>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.linkSocialIdentitiesByPing(accessToken, clientGuid , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
AuthUserRegistrationModel authUserRegistrationModel = new AuthUserRegistrationModel(); //Required
List<EmailModel> email = new ArrayList < EmailModel >();
EmailModel emailModel = new EmailModel();
emailModel.setType("type");
emailModel.setValue("value");
email.add(emailModel);
authUserRegistrationModel.setEmail(email);
authUserRegistrationModel.setFirstName("firstName");
authUserRegistrationModel.setLastName("lastName");
authUserRegistrationModel.setPassword("password");
String sott = "<sott>"; //Required
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String options = "<options>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.userRegistrationByEmail( authUserRegistrationModel, sott, emailTemplate, fields, options, verificationUrl, welcomeEmailTemplate , new AsyncHandler<UserProfilePostResponse<AccessToken<Identity>>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<AccessToken<Identity>> response) {
System.out.println(response.getIsPosted());
}
});
AuthUserRegistrationModelWithCaptcha authUserRegistrationModelWithCaptcha = new AuthUserRegistrationModelWithCaptcha(); //Required
List<EmailModel> email = new ArrayList < EmailModel >();
EmailModel emailModel = new EmailModel();
emailModel.setType("type");
emailModel.setValue("value");
email.add(emailModel);
authUserRegistrationModelWithCaptcha.setEmail(email);
authUserRegistrationModelWithCaptcha.setFirstName("firstName");
authUserRegistrationModelWithCaptcha.setG_Recaptcha_Response("g-recaptcha-response");
authUserRegistrationModelWithCaptcha.setLastName("lastName");
authUserRegistrationModelWithCaptcha.setPassword("password");
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String options = "<options>"; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.userRegistrationByCaptcha( authUserRegistrationModelWithCaptcha, emailTemplate, fields, options, smsTemplate, verificationUrl, welcomeEmailTemplate , new AsyncHandler<UserProfilePostResponse<AccessToken<Identity>>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<AccessToken<Identity>> response) {
System.out.println(response.getIsPosted());
}
});
String email = "<email>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getSecurityQuestionsByEmail(email , new AsyncHandler<SecurityQuestions[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(SecurityQuestions[] response) {
System.out.println(response[0].getQuestion());
}
});
String userName = "<userName>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getSecurityQuestionsByUserName(userName , new AsyncHandler<SecurityQuestions[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(SecurityQuestions[] response) {
System.out.println(response[0].getQuestion());
}
});
String phone = "<phone>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getSecurityQuestionsByPhone(phone , new AsyncHandler<SecurityQuestions[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(SecurityQuestions[] response) {
System.out.println(response[0].getQuestion());
}
});
String accessToken = "<accessToken>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getSecurityQuestionsByAccessToken(accessToken , new AsyncHandler<SecurityQuestions[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(SecurityQuestions[] response) {
System.out.println(response[0].getQuestion());
}
});
String accessToken = "<accessToken>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.authValidateAccessToken(accessToken , new AsyncHandler<AccessTokenBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
String accessToken = "<accessToken>"; //Required
Boolean preventRefresh = true; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.authInValidateAccessToken(accessToken, preventRefresh , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String accessToken = "<accessToken>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getAccessTokenInfo(accessToken , new AsyncHandler<TokenInfoResponseModel> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(TokenInfoResponseModel response) {
System.out.println(response.getAccess_Token());
}
});
String accessToken = "<accessToken>"; //Required
String fields = null; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getProfileByAccessToken(accessToken, fields , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
String accessToken = "<accessToken>"; //Required
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.sendWelcomeEmail(accessToken, welcomeEmailTemplate , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String deletetoken = "<deletetoken>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.deleteAccountByDeleteToken(deletetoken , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String email = "<email>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.checkEmailAvailability(email , new AsyncHandler<ExistResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ExistResponse response) {
System.out.println(response.getIsExist());
}
});
String verificationToken = "<verificationToken>"; //Required
String fields = null; //Optional
String url = "<url>"; //Optional
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.verifyEmail(verificationToken, fields, url, welcomeEmailTemplate , new AsyncHandler<UserProfilePostResponse<EmailVerificationData<Identity>>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<EmailVerificationData<Identity>> response) {
System.out.println(response.getIsPosted());
}
});
String username = "<username>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.checkUserNameAvailability(username , new AsyncHandler<ExistResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ExistResponse response) {
System.out.println(response.getIsExist());
}
});
String accessToken = "<accessToken>"; //Required
String fields = null; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.acceptPrivacyPolicy(accessToken, fields , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
String accessToken = "<accessToken>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.getPrivacyPolicyHistoryByAccessToken(accessToken , new AsyncHandler<PrivacyPolicyHistoryResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PrivacyPolicyHistoryResponse response) {
System.out.println(response.getCurrent().getVersion());
}
});
String accessToken = "<accessToken>"; //Required
String deleteUrl = "<deleteUrl>"; //Optional
String emailTemplate = "<emailTemplate>"; //Optional
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.deleteAccountWithEmailConfirmation(accessToken, deleteUrl, emailTemplate , new AsyncHandler<DeleteRequestAcceptResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteRequestAcceptResponse response) {
System.out.println(response.getIsDeleteRequestAccepted());
}
});
String accessToken = "<accessToken>"; //Required
String email = "<email>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.removeEmail(accessToken, email , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
String accessToken = "<accessToken>"; //Required
String provider = "<provider>"; //Required
String providerId = "<providerId>"; //Required
AuthenticationApi authenticationApi = new AuthenticationApi();
authenticationApi.unlinkSocialIdentities(accessToken, provider, providerId , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
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
- POST : Account Create
- POST : Forgot Password token
- POST : Email Verification token
- GET : Get Privacy Policy History By Uid
- GET : Account Profiles by Email
- GET : Account Profiles by Username
- GET : Account Profile by Phone ID
- GET : Account Profiles by UID
- GET : Account Password
- GET : Access Token based on UID or User impersonation API
- GET : Refresh Access Token by Refresh Token
- GET : Revoke Refresh Token
- GET : Account Identities by Email
- DELETE : Account Delete
- DELETE : Account Remove Email
- DELETE : Delete User Profiles By Email
AccountUserProfileUpdateModel accountUserProfileUpdateModel = new AccountUserProfileUpdateModel(); //Required
accountUserProfileUpdateModel.setFirstName("firstName");
accountUserProfileUpdateModel.setLastName("lastName");
String uid = "<uid>"; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.updateAccountByUid( accountUserProfileUpdateModel, uid, fields , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
String phone = "<phone>"; //Required
String uid = "<uid>"; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.updatePhoneIDByUid(phone, uid, fields , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
String password = "<password>"; //Required
String uid = "<uid>"; //Required
AccountApi accountApi = new AccountApi();
accountApi.setAccountPasswordByUid(password, uid , new AsyncHandler<UserPasswordHash> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserPasswordHash response) {
System.out.println(response.getPasswordHash());
}
});
String uid = "<uid>"; //Required
String emailTemplate = "<emailTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
AccountApi accountApi = new AccountApi();
accountApi.invalidateAccountEmailVerification(uid, emailTemplate, verificationUrl , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String uid = "<uid>"; //Required
String smsTemplate = "<smsTemplate>"; //Optional
AccountApi accountApi = new AccountApi();
accountApi.resetPhoneIDVerificationByUid(uid, smsTemplate , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
UpsertEmailModel upsertEmailModel = new UpsertEmailModel(); //Required
List<EmailModel> email = new ArrayList < EmailModel >();
EmailModel emailModel = new EmailModel();
emailModel.setType("type");
emailModel.setValue("value");
email.add(emailModel);
upsertEmailModel.setEmail(email);
String uid = "<uid>"; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.upsertEmail( upsertEmailModel, uid, fields , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
In order to use this API, you need to format a JSON request body with all of the mandatory fields [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-create)
AccountCreateModel accountCreateModel = new AccountCreateModel(); //Required
List<EmailModel> email = new ArrayList < EmailModel >();
EmailModel emailModel = new EmailModel();
emailModel.setType("type");
emailModel.setValue("value");
email.add(emailModel);
accountCreateModel.setEmail(email);
accountCreateModel.setFirstName("firstName");
accountCreateModel.setLastName("lastName");
accountCreateModel.setPassword("password");
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.createAccount( accountCreateModel, fields , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
String email = "<email>"; //Required
String emailTemplate = "<emailTemplate>"; //Optional
String resetPasswordUrl = "<resetPasswordUrl>"; //Optional
Boolean sendEmail = true; //Optional
AccountApi accountApi = new AccountApi();
accountApi.getForgotPasswordToken(email, emailTemplate, resetPasswordUrl, sendEmail , new AsyncHandler<ForgotPasswordResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ForgotPasswordResponse response) {
System.out.println(response.getForgotToken());
}
});
String email = "<email>"; //Required
AccountApi accountApi = new AccountApi();
accountApi.getEmailVerificationToken(email , new AsyncHandler<EmailVerificationTokenResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(EmailVerificationTokenResponse response) {
System.out.println(response.getVerificationToken());
}
});
String uid = "<uid>"; //Required
AccountApi accountApi = new AccountApi();
accountApi.getPrivacyPolicyHistoryByUid(uid , new AsyncHandler<PrivacyPolicyHistoryResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PrivacyPolicyHistoryResponse response) {
System.out.println(response.getCurrent().getVersion());
}
});
String email = "<email>"; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.getAccountProfileByEmail(email, fields , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
String userName = "<userName>"; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.getAccountProfileByUserName(userName, fields , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
String phone = "<phone>"; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.getAccountProfileByPhone(phone, fields , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
String uid = "<uid>"; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.getAccountProfileByUid(uid, fields , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
String uid = "<uid>"; //Required
AccountApi accountApi = new AccountApi();
accountApi.getAccountPasswordHashByUid(uid , new AsyncHandler<UserPasswordHash> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserPasswordHash response) {
System.out.println(response.getPasswordHash());
}
});
String uid = "<uid>"; //Required
AccountApi accountApi = new AccountApi();
accountApi.getAccessTokenByUid(uid , new AsyncHandler<AccessTokenBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
String refreshToken = "<refreshToken>"; //Required
AccountApi accountApi = new AccountApi();
accountApi.refreshAccessTokenByRefreshToken(refreshToken , new AsyncHandler<AccessTokenBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
String refreshToken = "<refreshToken>"; //Required
AccountApi accountApi = new AccountApi();
accountApi.revokeRefreshToken(refreshToken , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
String email = "<email>"; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.getAccountIdentitiesByEmail(email, fields , new AsyncHandler<ListReturn<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListReturn<Identity> response) {
System.out.println(response.getData().get(0).getUid());
}
});
String uid = "<uid>"; //Required
AccountApi accountApi = new AccountApi();
accountApi.deleteAccountByUid(uid , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
String email = "<email>"; //Required
String uid = "<uid>"; //Required
String fields = null; //Optional
AccountApi accountApi = new AccountApi();
accountApi.removeEmail(email, uid, fields , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
String email = "<email>"; //Required
AccountApi accountApi = new AccountApi();
accountApi.accountDeleteByEmail(email , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
List of APIs in this Section:
- POST : Post Message API
- POST : Status Posting
- POST : Trackable Status Posting
- 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
- GET : Album
- GET : Get Albums with cursor
- GET : Audio
- GET : Get Audio With Cursor
- GET : Check In
- GET : Get CheckIns With Cursor
- GET : Contact
- GET : Event
- GET : Get Events With Cursor
- GET : Following
- GET : Get Followings With Cursor
- GET : Group
- GET : Get Groups With Cursor
- GET : Like
- GET : Get Likes With Cursor
- GET : Mention
- GET : Page
- GET : Photo
- GET : Get Post
- GET : Get Trackable Status Stats
- GET : Trackable Status Fetching
- GET : User Profile
- GET : Refresh User Profile
- GET : Video
Supported Providers: Twitter, LinkedIn
The Message API is used to post messages to the user?s contacts. This is one of the APIs that makes up the LoginRadius Friend Invite System. After using the Contact API, you can send messages to the retrieved contacts. This API requires setting permissions in your LoginRadius Dashboard.
GET & POST Message API work the same way except the API method is different [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/post-message-api)
String accessToken = "<accessToken>"; //Required
String message = "<message>"; //Required
String subject = "<subject>"; //Required
String to = "<to>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.postMessage(accessToken, message, subject, to , new AsyncHandler<PostMethodResponseBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostMethodResponseBase response) {
System.out.println(response.getIsPosted());
}
});
Supported Providers: Facebook, Twitter, LinkedIn [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/status-posting/)
String accessToken = "<accessToken>"; //Required
String caption = "<caption>"; //Required
String description = "<description>"; //Required
String imageurl = "<imageurl>"; //Required
String status = "<status>"; //Required
String title = "<title>"; //Required
String url = "<url>"; //Required
String shorturl = "<shorturl>"; //Optional
SocialApi socialApi = new SocialApi();
socialApi.statusPosting(accessToken, caption, description, imageurl, status, title, url, shorturl , new AsyncHandler<PostMethodResponse<ShortUrlResponse>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostMethodResponse<ShortUrlResponse> response) {
System.out.println(response.getIsPosted());
}
});
The Trackable Status API is used to update the status on the user's wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications.
POST Input Parameter Format: application/x-www-form-urlencoded [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/trackable-status-posting/)
String accessToken = "<accessToken>"; //Required
StatusModel statusModel = new StatusModel(); //Required
statusModel.setCaption("caption");
statusModel.setDescription("description");
statusModel.setImageurl("imageurl");
statusModel.setStatus("status");
statusModel.setTitle("title");
statusModel.setUrl("url");
SocialApi socialApi = new SocialApi();
socialApi.trackableStatusPosting(accessToken, statusModel , new AsyncHandler<StatusUpdateResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(StatusUpdateResponse response) {
System.out.println(response.getId());
}
});
String token = "<token>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.exchangeAccessToken(token , new AsyncHandler<AccessTokenBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
Supported Providers : Facebook,Yahoo,Google,Twitter, Linkedin.
Contact LoginRadius support team to enable this API. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/refresh-token)
String accessToken = "<accessToken>"; //Required
Integer expiresIn = 0; //Optional
Boolean isWeb = true; //Optional
SocialApi socialApi = new SocialApi();
socialApi.refreshAccessToken(accessToken, expiresIn, isWeb , new AsyncHandler<AccessTokenBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.validateAccessToken(accessToken , new AsyncHandler<AccessTokenBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.inValidateAccessToken(accessToken , new AsyncHandler<PostMethodResponseBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostMethodResponseBase response) {
System.out.println(response.getIsPosted());
}
});
String token = "<token>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getActiveSession(token , new AsyncHandler<UserActiveSession> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserActiveSession response) {
System.out.println(response.getData().get(0).getAccessToken());
}
});
String accountId = "<accountId>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getActiveSessionByAccountID(accountId , new AsyncHandler<UserActiveSession> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserActiveSession response) {
System.out.println(response.getData().get(0).getAccessToken());
}
});
String profileId = "<profileId>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getActiveSessionByProfileID(profileId , new AsyncHandler<UserActiveSession> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserActiveSession response) {
System.out.println(response.getData().get(0).getAccessToken());
}
});
This API returns the photo albums associated with the passed in access tokens Social Profile. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/album/)
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getAlbums(accessToken , new AsyncHandler<Album[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Album[] response) {
System.out.println(response[0].getCoverImageUrl());
}
});
This API returns the photo albums associated with the passed in access tokens Social Profile. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/album/)
String accessToken = "<accessToken>"; //Required
String nextCursor = "<nextCursor>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getAlbumsWithCursor(accessToken, nextCursor , new AsyncHandler<CursorResponse<Album>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CursorResponse<Album> response) {
System.out.println(response.getData().get(0).getCoverImageUrl());
}
});
Supported Providers: Live, Vkontakte [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/audio)
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getAudios(accessToken , new AsyncHandler<Audio[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Audio[] response) {
System.out.println(response[0].getArtist());
}
});
Supported Providers: Live, Vkontakte [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/audio)
String accessToken = "<accessToken>"; //Required
String nextCursor = "<nextCursor>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getAudiosWithCursor(accessToken, nextCursor , new AsyncHandler<CursorResponse<Audio>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CursorResponse<Audio> response) {
System.out.println(response.getData().get(0).getArtist());
}
});
Supported Providers: Facebook, Foursquare, Vkontakte [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/check-in)
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getCheckIns(accessToken , new AsyncHandler<CheckIn[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CheckIn[] response) {
System.out.println(response[0].getAddress());
}
});
Supported Providers: Facebook, Foursquare, Vkontakte [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/check-in)
String accessToken = "<accessToken>"; //Required
String nextCursor = "<nextCursor>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getCheckInsWithCursor(accessToken, nextCursor , new AsyncHandler<CursorResponse<CheckIn>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CursorResponse<CheckIn> response) {
System.out.println(response.getData().get(0).getAddress());
}
});
Note: Facebook restricts access to the list of friends that is returned. When using the Contacts API with Facebook you will only receive friends that have accepted some permissions with your app.
Supported Providers: Facebook, Foursquare, Google, LinkedIn, Live, Twitter, Vkontakte, Yahoo [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/contact)
String accessToken = "<accessToken>"; //Required
String nextCursor = "<nextCursor>"; //Optional
SocialApi socialApi = new SocialApi();
socialApi.getContacts(accessToken, nextCursor , new AsyncHandler<CursorResponse<Contact>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CursorResponse<Contact> response) {
System.out.println(response.getData().get(0).getCountry());
}
});
Supported Providers: Facebook, Live [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/event)
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getEvents(accessToken , new AsyncHandler<Events[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Events[] response) {
System.out.println(response[0].getDescription());
}
});
Supported Providers: Facebook, Live [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/event)
String accessToken = "<accessToken>"; //Required
String nextCursor = "<nextCursor>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getEventsWithCursor(accessToken, nextCursor , new AsyncHandler<CursorResponse<Events>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CursorResponse<Events> response) {
System.out.println(response.getData().get(0).getDescription());
}
});
Supported Providers: Twitter [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/following)
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getFollowings(accessToken , new AsyncHandler<Contact[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Contact[] response) {
System.out.println(response[0].getCountry());
}
});
Supported Providers: Twitter [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/following)
String accessToken = "<accessToken>"; //Required
String nextCursor = "<nextCursor>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getFollowingsWithCursor(accessToken, nextCursor , new AsyncHandler<CursorResponse<Contact>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CursorResponse<Contact> response) {
System.out.println(response.getData().get(0).getCountry());
}
});
Supported Providers: Facebook, Vkontakte [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/group)
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getGroups(accessToken , new AsyncHandler<Group[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Group[] response) {
System.out.println(response[0].getCountry());
}
});
Supported Providers: Facebook, Vkontakte [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/group)
String accessToken = "<accessToken>"; //Required
String nextCursor = "<nextCursor>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getGroupsWithCursor(accessToken, nextCursor , new AsyncHandler<CursorResponse<Group>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CursorResponse<Group> response) {
System.out.println(response.getData().get(0).getCountry());
}
});
Supported Providers: Facebook [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/like)
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getLikes(accessToken , new AsyncHandler<Like[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Like[] response) {
System.out.println(response[0].getCategory());
}
});
Supported Providers: Facebook [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/like)
String accessToken = "<accessToken>"; //Required
String nextCursor = "<nextCursor>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getLikesWithCursor(accessToken, nextCursor , new AsyncHandler<CursorResponse<Like>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CursorResponse<Like> response) {
System.out.println(response.getData().get(0).getCategory());
}
});
Supported Providers: Twitter [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/mention)
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getMentions(accessToken , new AsyncHandler<Status[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Status[] response) {
System.out.println(response[0].getDateTime());
}
});
Supported Providers: Facebook, LinkedIn [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/page)
String accessToken = "<accessToken>"; //Required
String pageName = "<pageName>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getPage(accessToken, pageName , new AsyncHandler<Page> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Page response) {
System.out.println(response.getAbout());
}
});
Supported Providers: Facebook, Foursquare, Google, Live, Vkontakte [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/photo)
String accessToken = "<accessToken>"; //Required
String albumId = "<albumId>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getPhotos(accessToken, albumId , new AsyncHandler<Photo[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Photo[] response) {
System.out.println(response[0].getAlbumId());
}
});
Supported Providers: Facebook [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/post)
String accessToken = "<accessToken>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getPosts(accessToken , new AsyncHandler<Post[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Post[] response) {
System.out.println(response[0].getID());
}
});
The Trackable Status API is used to update the status on the user's wall and return an Post ID value. It is commonly referred to as Permission based sharing or Push notifications. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/get-trackable-status-stats/)
String accessToken = "<accessToken>"; //Required
String caption = "<caption>"; //Required
String description = "<description>"; //Required
String imageurl = "<imageurl>"; //Required
String status = "<status>"; //Required
String title = "<title>"; //Required
String url = "<url>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getTrackableStatusStats(accessToken, caption, description, imageurl, status, title, url , new AsyncHandler<StatusUpdateResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(StatusUpdateResponse response) {
System.out.println(response.getId());
}
});
This API is used to retrieve a tracked post based on the passed in post ID value. This API requires setting permissions in your LoginRadius Dashboard.
Note: To utilize this API you need to find the ID for the post you want to track, which might require using Trackable Status Posting API first. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/trackable-status-fetching/)
String postId = "<postId>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.trackableStatusFetching(postId , new AsyncHandler<StatusUpdateStats> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(StatusUpdateStats response) {
System.out.println(response.getComments());
}
});
Supported Providers: All [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/user-profile)
String accessToken = "<accessToken>"; //Required
String fields = null; //Optional
SocialApi socialApi = new SocialApi();
socialApi.getSocialUserProfile(accessToken, fields , new AsyncHandler<UserProfile> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfile response) {
System.out.println(response.getFirstName());
}
});
String accessToken = "<accessToken>"; //Required
String fields = null; //Optional
SocialApi socialApi = new SocialApi();
socialApi.getRefreshedSocialUserProfile(accessToken, fields , new AsyncHandler<UserProfile> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfile response) {
System.out.println(response.getFirstName());
}
});
Supported Providers: Facebook, Google, Live, Vkontakte [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/video)
String accessToken = "<accessToken>"; //Required
String nextCursor = "<nextCursor>"; //Required
SocialApi socialApi = new SocialApi();
socialApi.getVideos(accessToken, nextCursor , new AsyncHandler<CursorResponse<Video>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(CursorResponse<Video> response) {
System.out.println(response.getData().get(0).getCreatedDate());
}
});
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
String accessToken = "<accessToken>"; //Required
String objectName = "<objectName>"; //Required
String objectRecordId = "<objectRecordId>"; //Required
JsonObject json = new JsonObject(); //Required
json.addProperty("field1", "Store my field1 value");
CustomObjectUpdateOperationType updateType = CustomObjectUpdateOperationType.PartialReplace; //Optional
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.updateCustomObjectByToken(accessToken, objectName, objectRecordId, json, updateType , new AsyncHandler<UserCustomObjectData> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserCustomObjectData response) {
System.out.println(response.getCustomObject());
}
});
String objectName = "<objectName>"; //Required
String objectRecordId = "<objectRecordId>"; //Required
JsonObject json = new JsonObject(); //Required
json.addProperty("field1", "Store my field1 value");
String uid = "<uid>"; //Required
CustomObjectUpdateOperationType updateType = CustomObjectUpdateOperationType.PartialReplace; //Optional
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.updateCustomObjectByUid(objectName, objectRecordId, json, uid, updateType , new AsyncHandler<UserCustomObjectData> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserCustomObjectData response) {
System.out.println(response.getCustomObject());
}
});
String accessToken = "<accessToken>"; //Required
String objectName = "<objectName>"; //Required
JsonObject json = new JsonObject(); //Required
json.addProperty("field1", "Store my field1 value");
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.createCustomObjectByToken(accessToken, objectName, json , new AsyncHandler<UserCustomObjectData> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserCustomObjectData response) {
System.out.println(response.getCustomObject());
}
});
String objectName = "<objectName>"; //Required
JsonObject json = new JsonObject(); //Required
json.addProperty("field1", "Store my field1 value");
String uid = "<uid>"; //Required
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.createCustomObjectByUid(objectName, json, uid , new AsyncHandler<UserCustomObjectData> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserCustomObjectData response) {
System.out.println(response.getCustomObject());
}
});
String accessToken = "<accessToken>"; //Required
String objectName = "<objectName>"; //Required
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.getCustomObjectByToken(accessToken, objectName , new AsyncHandler<ListData<UserCustomObjectData>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListData<UserCustomObjectData> response) {
System.out.println(response.getCount());
}
});
String accessToken = "<accessToken>"; //Required
String objectName = "<objectName>"; //Required
String objectRecordId = "<objectRecordId>"; //Required
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.getCustomObjectByRecordIDAndToken(accessToken, objectName, objectRecordId , new AsyncHandler<UserCustomObjectData> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserCustomObjectData response) {
System.out.println(response.getCustomObject());
}
});
String objectName = "<objectName>"; //Required
String uid = "<uid>"; //Required
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.getCustomObjectByUid(objectName, uid , new AsyncHandler<ListData<UserCustomObjectData>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListData<UserCustomObjectData> response) {
System.out.println(response.getCount());
}
});
String objectName = "<objectName>"; //Required
String objectRecordId = "<objectRecordId>"; //Required
String uid = "<uid>"; //Required
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.getCustomObjectByRecordID(objectName, objectRecordId, uid , new AsyncHandler<UserCustomObjectData> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserCustomObjectData response) {
System.out.println(response.getCustomObject());
}
});
String accessToken = "<accessToken>"; //Required
String objectName = "<objectName>"; //Required
String objectRecordId = "<objectRecordId>"; //Required
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.deleteCustomObjectByToken(accessToken, objectName, objectRecordId , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
String objectName = "<objectName>"; //Required
String objectRecordId = "<objectRecordId>"; //Required
String uid = "<uid>"; //Required
CustomObjectApi customObjectApi = new CustomObjectApi();
customObjectApi.deleteCustomObjectByRecordID(objectName, objectRecordId, uid , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
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
ResetPasswordByOTPModel resetPasswordByOTPModel = new ResetPasswordByOTPModel(); //Required
resetPasswordByOTPModel.setOtp("otp");
resetPasswordByOTPModel.setPassword("password");
resetPasswordByOTPModel.setPhone("phone");
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.resetPasswordByPhoneOTP( resetPasswordByOTPModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String otp = "<otp>"; //Required
String phone = "<phone>"; //Required
String fields = null; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.phoneVerificationByOTP(otp, phone, fields, smsTemplate , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
String accessToken = "<accessToken>"; //Required
String otp = "<otp>"; //Required
String smsTemplate = "<smsTemplate>"; //Optional
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.phoneVerificationOTPByAccessToken(accessToken, otp, smsTemplate , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String accessToken = "<accessToken>"; //Required
String phone = "<phone>"; //Required
String smsTemplate = "<smsTemplate>"; //Optional
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.updatePhoneNumber(accessToken, phone, smsTemplate , new AsyncHandler<UserProfilePostResponse<SMSResponseData>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<SMSResponseData> response) {
System.out.println(response.getIsPosted());
}
});
PhoneAuthenticationModel phoneAuthenticationModel = new PhoneAuthenticationModel(); //Required
phoneAuthenticationModel.setPassword("password");
phoneAuthenticationModel.setPhone("phone");
String fields = null; //Optional
String loginUrl = "<loginUrl>"; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.loginByPhone( phoneAuthenticationModel, fields, loginUrl, smsTemplate , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
String phone = "<phone>"; //Required
String smsTemplate = "<smsTemplate>"; //Optional
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.forgotPasswordByPhoneOTP(phone, smsTemplate , new AsyncHandler<UserProfilePostResponse<SMSResponseData>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<SMSResponseData> response) {
System.out.println(response.getIsPosted());
}
});
String phone = "<phone>"; //Required
String smsTemplate = "<smsTemplate>"; //Optional
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.phoneResendVerificationOTP(phone, smsTemplate , new AsyncHandler<UserProfilePostResponse<SMSResponseData>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<SMSResponseData> response) {
System.out.println(response.getIsPosted());
}
});
String accessToken = "<accessToken>"; //Required
String phone = "<phone>"; //Required
String smsTemplate = "<smsTemplate>"; //Optional
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.phoneResendVerificationOTPByToken(accessToken, phone, smsTemplate , new AsyncHandler<UserProfilePostResponse<SMSResponseData>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<SMSResponseData> response) {
System.out.println(response.getIsPosted());
}
});
AuthUserRegistrationModel authUserRegistrationModel = new AuthUserRegistrationModel(); //Required
authUserRegistrationModel.setFirstName("firstName");
authUserRegistrationModel.setLastName("lastName");
authUserRegistrationModel.setPassword("password");
authUserRegistrationModel.setPhoneId("phoneId");
String sott = "<sott>"; //Required
String fields = null; //Optional
String options = "<options>"; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.userRegistrationByPhone( authUserRegistrationModel, sott, fields, options, smsTemplate, verificationUrl, welcomeEmailTemplate , new AsyncHandler<UserProfilePostResponse<AccessToken<Identity>>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<AccessToken<Identity>> response) {
System.out.println(response.getIsPosted());
}
});
String phone = "<phone>"; //Required
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.checkPhoneNumberAvailability(phone , new AsyncHandler<ExistResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ExistResponse response) {
System.out.println(response.getIsExist());
}
});
String accessToken = "<accessToken>"; //Required
PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi();
phoneAuthenticationApi.removePhoneIDByAccessToken(accessToken , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
List of APIs in this Section:
- PUT : Update MFA Setting
- PUT : Update MFA by Access Token
- PUT : MFA Update Phone Number by Token
- PUT : MFA Validate OTP
- PUT : MFA Validate Google Auth Code
- PUT : MFA Validate Backup code
- PUT : MFA Update Phone Number
- POST : MFA Email Login
- POST : MFA UserName Login
- POST : MFA Phone Login
- GET : MFA Validate Access Token
- GET : MFA Backup Code by Access Token
- GET : Reset Backup Code 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 : MFA Reset SMS Authenticator By UID
- DELETE : MFA Reset Google Authenticator By UID
String accessToken = "<accessToken>"; //Required
MultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout = new MultiFactorAuthModelWithLockout(); //Required
multiFactorAuthModelWithLockout.setOtp("otp");
String fields = null; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaUpdateSetting(accessToken, multiFactorAuthModelWithLockout, fields , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
String accessToken = "<accessToken>"; //Required
MultiFactorAuthModelByGoogleAuthenticatorCode multiFactorAuthModelByGoogleAuthenticatorCode = new MultiFactorAuthModelByGoogleAuthenticatorCode(); //Required
multiFactorAuthModelByGoogleAuthenticatorCode.setGoogleAuthenticatorCode("googleAuthenticatorCode");
String fields = null; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaUpdateByAccessToken(accessToken, multiFactorAuthModelByGoogleAuthenticatorCode, fields, smsTemplate , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
String accessToken = "<accessToken>"; //Required
String phoneNo2FA = "<phoneNo2FA>"; //Required
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaUpdatePhoneNumberByToken(accessToken, phoneNo2FA, smsTemplate2FA , new AsyncHandler<SMSResponseData> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(SMSResponseData response) {
System.out.println(response.getAccountSid());
}
});
MultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout = new MultiFactorAuthModelWithLockout(); //Required
multiFactorAuthModelWithLockout.setOtp("otp");
String secondFactorAuthenticationToken = "<secondFactorAuthenticationToken>"; //Required
String fields = null; //Optional
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaValidateOTPByPhone( multiFactorAuthModelWithLockout, secondFactorAuthenticationToken, fields, smsTemplate2FA , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
String googleAuthenticatorCode = "<googleAuthenticatorCode>"; //Required
String secondFactorAuthenticationToken = "<secondFactorAuthenticationToken>"; //Required
String fields = null; //Optional
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaValidateGoogleAuthCode(googleAuthenticatorCode, secondFactorAuthenticationToken, fields, smsTemplate2FA , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
MultiFactorAuthModelByBackupCode multiFactorAuthModelByBackupCode = new MultiFactorAuthModelByBackupCode(); //Required
multiFactorAuthModelByBackupCode.setBackupCode("backupCode");
String secondFactorAuthenticationToken = "<secondFactorAuthenticationToken>"; //Required
String fields = null; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaValidateBackupCode( multiFactorAuthModelByBackupCode, secondFactorAuthenticationToken, fields , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
String phoneNo2FA = "<phoneNo2FA>"; //Required
String secondFactorAuthenticationToken = "<secondFactorAuthenticationToken>"; //Required
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaUpdatePhoneNumber(phoneNo2FA, secondFactorAuthenticationToken, smsTemplate2FA , new AsyncHandler<SMSResponseData> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(SMSResponseData response) {
System.out.println(response.getAccountSid());
}
});
String email = "<email>"; //Required
String password = "<password>"; //Required
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String loginUrl = "<loginUrl>"; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaLoginByEmail(email, password, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl , new AsyncHandler<MultiFactorAuthenticationResponse<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(MultiFactorAuthenticationResponse<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
String password = "<password>"; //Required
String username = "<username>"; //Required
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String loginUrl = "<loginUrl>"; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaLoginByUserName(password, username, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl , new AsyncHandler<MultiFactorAuthenticationResponse<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(MultiFactorAuthenticationResponse<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
String password = "<password>"; //Required
String phone = "<phone>"; //Required
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String loginUrl = "<loginUrl>"; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaLoginByPhone(password, phone, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl , new AsyncHandler<MultiFactorAuthenticationResponse<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(MultiFactorAuthenticationResponse<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
String accessToken = "<accessToken>"; //Required
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaConfigureByAccessToken(accessToken, smsTemplate2FA , new AsyncHandler<MultiFactorAuthenticationSettingsResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(MultiFactorAuthenticationSettingsResponse response) {
System.out.println(response.getIsGoogleAuthenticatorVerified());
}
});
String accessToken = "<accessToken>"; //Required
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaBackupCodeByAccessToken(accessToken , new AsyncHandler<BackupCodeResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(BackupCodeResponse response) {
System.out.println(response.getBackUpCodes());
}
});
String accessToken = "<accessToken>"; //Required
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaResetBackupCodeByAccessToken(accessToken , new AsyncHandler<BackupCodeResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(BackupCodeResponse response) {
System.out.println(response.getBackUpCodes());
}
});
String secondFactorAuthenticationToken = "<secondFactorAuthenticationToken>"; //Required
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaResendOTP(secondFactorAuthenticationToken, smsTemplate2FA , new AsyncHandler<SMSResponseData> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(SMSResponseData response) {
System.out.println(response.getAccountSid());
}
});
String uid = "<uid>"; //Required
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaBackupCodeByUid(uid , new AsyncHandler<BackupCodeResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(BackupCodeResponse response) {
System.out.println(response.getBackUpCodes());
}
});
String uid = "<uid>"; //Required
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaResetBackupCodeByUid(uid , new AsyncHandler<BackupCodeResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(BackupCodeResponse response) {
System.out.println(response.getBackUpCodes());
}
});
String accessToken = "<accessToken>"; //Required
Boolean googleauthenticator = true; //Required
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaResetGoogleAuthByToken(accessToken, googleauthenticator , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
String accessToken = "<accessToken>"; //Required
Boolean otpauthenticator = true; //Required
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaResetSMSAuthByToken(accessToken, otpauthenticator , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
Boolean otpauthenticator = true; //Required
String uid = "<uid>"; //Required
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaResetSMSAuthenticatorByUid(otpauthenticator, uid , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
Boolean googleauthenticator = true; //Required
String uid = "<uid>"; //Required
MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi();
multiFactorAuthenticationApi.mfaResetGoogleAuthenticatorByUid(googleauthenticator, uid , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
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
ResetPINByResetToken resetPINByResetToken = new ResetPINByResetToken(); //Required
resetPINByResetToken.setPIN("pin");
resetPINByResetToken.setResetToken("resetToken");
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.resetPINByResetToken( resetPINByResetToken , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
ResetPINBySecurityQuestionAnswerAndEmailModel resetPINBySecurityQuestionAnswerAndEmailModel = new ResetPINBySecurityQuestionAnswerAndEmailModel(); //Required
resetPINBySecurityQuestionAnswerAndEmailModel.setEmail("email");
resetPINBySecurityQuestionAnswerAndEmailModel.setPIN("pin");
Map<String,String> securityAnswer= new HashMap<String,String> ();
securityAnswer.put("<security-qustion-id>", "<security-answer>" );
resetPINBySecurityQuestionAnswerAndEmailModel.setSecurityAnswer(securityAnswer);
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.resetPINByEmailAndSecurityAnswer( resetPINBySecurityQuestionAnswerAndEmailModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
ResetPINBySecurityQuestionAnswerAndUsernameModel resetPINBySecurityQuestionAnswerAndUsernameModel = new ResetPINBySecurityQuestionAnswerAndUsernameModel(); //Required
resetPINBySecurityQuestionAnswerAndUsernameModel.setPIN("pin");
Map<String,String> securityAnswer= new HashMap<String,String> ();
securityAnswer.put("<security-qustion-id>", "<security-answer>" );
resetPINBySecurityQuestionAnswerAndUsernameModel.setSecurityAnswer(securityAnswer);
resetPINBySecurityQuestionAnswerAndUsernameModel.setUsername("username");
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.resetPINByUsernameAndSecurityAnswer( resetPINBySecurityQuestionAnswerAndUsernameModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
ResetPINBySecurityQuestionAnswerAndPhoneModel resetPINBySecurityQuestionAnswerAndPhoneModel = new ResetPINBySecurityQuestionAnswerAndPhoneModel(); //Required
resetPINBySecurityQuestionAnswerAndPhoneModel.setPhone("phone");
resetPINBySecurityQuestionAnswerAndPhoneModel.setPIN("pin");
Map<String,String> securityAnswer= new HashMap<String,String> ();
securityAnswer.put("<security-qustion-id>", "<security-answer>" );
resetPINBySecurityQuestionAnswerAndPhoneModel.setSecurityAnswer(securityAnswer);
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.resetPINByPhoneAndSecurityAnswer( resetPINBySecurityQuestionAnswerAndPhoneModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String accessToken = "<accessToken>"; //Required
ChangePINModel changePINModel = new ChangePINModel(); //Required
changePINModel.setNewPIN("newPIN");
changePINModel.setOldPIN("oldPIN");
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.changePINByAccessToken(accessToken, changePINModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
ResetPINByPhoneAndOTPModel resetPINByPhoneAndOTPModel = new ResetPINByPhoneAndOTPModel(); //Required
resetPINByPhoneAndOTPModel.setOtp("otp");
resetPINByPhoneAndOTPModel.setPhone("phone");
resetPINByPhoneAndOTPModel.setPIN("pin");
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.resetPINByPhoneAndOtp( resetPINByPhoneAndOTPModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
ResetPINByEmailAndOtpModel resetPINByEmailAndOtpModel = new ResetPINByEmailAndOtpModel(); //Required
resetPINByEmailAndOtpModel.setEmail("email");
resetPINByEmailAndOtpModel.setOtp("otp");
resetPINByEmailAndOtpModel.setPIN("pin");
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.resetPINByEmailAndOtp( resetPINByEmailAndOtpModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
ResetPINByUsernameAndOtpModel resetPINByUsernameAndOtpModel = new ResetPINByUsernameAndOtpModel(); //Required
resetPINByUsernameAndOtpModel.setOtp("otp");
resetPINByUsernameAndOtpModel.setPIN("pin");
resetPINByUsernameAndOtpModel.setUsername("username");
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.resetPINByUsernameAndOtp( resetPINByUsernameAndOtpModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
LoginByPINModel loginByPINModel = new LoginByPINModel(); //Required
loginByPINModel.setPIN("pin");
String sessionToken = "<sessionToken>"; //Required
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.pinLogin( loginByPINModel, sessionToken , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
ForgotPINLinkByEmailModel forgotPINLinkByEmailModel = new ForgotPINLinkByEmailModel(); //Required
forgotPINLinkByEmailModel.setEmail("email");
String emailTemplate = "<emailTemplate>"; //Optional
String resetPINUrl = "<resetPINUrl>"; //Optional
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.sendForgotPINEmailByEmail( forgotPINLinkByEmailModel, emailTemplate, resetPINUrl , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
ForgotPINLinkByUserNameModel forgotPINLinkByUserNameModel = new ForgotPINLinkByUserNameModel(); //Required
forgotPINLinkByUserNameModel.setUserName("userName");
String emailTemplate = "<emailTemplate>"; //Optional
String resetPINUrl = "<resetPINUrl>"; //Optional
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.sendForgotPINEmailByUsername( forgotPINLinkByUserNameModel, emailTemplate, resetPINUrl , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
ForgotPINOtpByPhoneModel forgotPINOtpByPhoneModel = new ForgotPINOtpByPhoneModel(); //Required
forgotPINOtpByPhoneModel.setPhone("phone");
String smsTemplate = "<smsTemplate>"; //Optional
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.sendForgotPINSMSByPhone( forgotPINOtpByPhoneModel, smsTemplate , new AsyncHandler<UserProfilePostResponse<SMSResponseData>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<SMSResponseData> response) {
System.out.println(response.getIsPosted());
}
});
PINRequiredModel pinRequiredModel = new PINRequiredModel(); //Required
pinRequiredModel.setPIN("pin");
String pinAuthToken = "<pinAuthToken>"; //Required
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.setPINByPinAuthToken( pinRequiredModel, pinAuthToken , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
String sessionToken = "<sessionToken>"; //Required
PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi();
pinAuthenticationApi.inValidatePinSessionToken(sessionToken , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
List of APIs in this Section:
- PUT : Validate MFA by OTP
- PUT : Validate MFA by Backup Code
- PUT : Validate MFA by Google Authenticator Code
- PUT : Validate MFA by Password
- PUT : MFA Re-authentication by PIN
- POST : Verify Multifactor OTP Authentication
- POST : Verify Multifactor Password Authentication
- POST : Verify Multifactor PIN Authentication
- GET : Multi Factor Re-Authenticate
String accessToken = "<accessToken>"; //Required
ReauthByOtpModel reauthByOtpModel = new ReauthByOtpModel(); //Required
reauthByOtpModel.setOtp("otp");
ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi();
reAuthenticationApi.mfaReAuthenticateByOTP(accessToken, reauthByOtpModel , new AsyncHandler<EventBasedMultiFactorAuthenticationToken> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(EventBasedMultiFactorAuthenticationToken response) {
System.out.println(response.getExpireIn());
}
});
String accessToken = "<accessToken>"; //Required
ReauthByBackupCodeModel reauthByBackupCodeModel = new ReauthByBackupCodeModel(); //Required
reauthByBackupCodeModel.setBackupCode("backupCode");
ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi();
reAuthenticationApi.mfaReAuthenticateByBackupCode(accessToken, reauthByBackupCodeModel , new AsyncHandler<EventBasedMultiFactorAuthenticationToken> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(EventBasedMultiFactorAuthenticationToken response) {
System.out.println(response.getExpireIn());
}
});
String accessToken = "<accessToken>"; //Required
ReauthByGoogleAuthenticatorCodeModel reauthByGoogleAuthenticatorCodeModel = new ReauthByGoogleAuthenticatorCodeModel(); //Required
reauthByGoogleAuthenticatorCodeModel.setGoogleAuthenticatorCode("googleAuthenticatorCode");
ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi();
reAuthenticationApi.mfaReAuthenticateByGoogleAuth(accessToken, reauthByGoogleAuthenticatorCodeModel , new AsyncHandler<EventBasedMultiFactorAuthenticationToken> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(EventBasedMultiFactorAuthenticationToken response) {
System.out.println(response.getExpireIn());
}
});
String accessToken = "<accessToken>"; //Required
PasswordEventBasedAuthModelWithLockout passwordEventBasedAuthModelWithLockout = new PasswordEventBasedAuthModelWithLockout(); //Required
passwordEventBasedAuthModelWithLockout.setPassword("password");
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi();
reAuthenticationApi.mfaReAuthenticateByPassword(accessToken, passwordEventBasedAuthModelWithLockout, smsTemplate2FA , new AsyncHandler<EventBasedMultiFactorAuthenticationToken> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(EventBasedMultiFactorAuthenticationToken response) {
System.out.println(response.getExpireIn());
}
});
String accessToken = "<accessToken>"; //Required
PINAuthEventBasedAuthModelWithLockout pinAuthEventBasedAuthModelWithLockout = new PINAuthEventBasedAuthModelWithLockout(); //Required
pinAuthEventBasedAuthModelWithLockout.setPIN("pin");
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi();
reAuthenticationApi.verifyPINAuthentication(accessToken, pinAuthEventBasedAuthModelWithLockout, smsTemplate2FA , new AsyncHandler<EventBasedMultiFactorAuthenticationToken> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(EventBasedMultiFactorAuthenticationToken response) {
System.out.println(response.getExpireIn());
}
});
EventBasedMultiFactorToken eventBasedMultiFactorToken = new EventBasedMultiFactorToken(); //Required
eventBasedMultiFactorToken.setSecondFactorValidationToken("secondFactorValidationToken");
String uid = "<uid>"; //Required
ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi();
reAuthenticationApi.verifyMultiFactorOtpReauthentication( eventBasedMultiFactorToken, uid , new AsyncHandler<PostValidationResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostValidationResponse response) {
System.out.println(response.getIsValid());
}
});
EventBasedMultiFactorToken eventBasedMultiFactorToken = new EventBasedMultiFactorToken(); //Required
eventBasedMultiFactorToken.setSecondFactorValidationToken("secondFactorValidationToken");
String uid = "<uid>"; //Required
ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi();
reAuthenticationApi.verifyMultiFactorPasswordReauthentication( eventBasedMultiFactorToken, uid , new AsyncHandler<PostValidationResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostValidationResponse response) {
System.out.println(response.getIsValid());
}
});
EventBasedMultiFactorToken eventBasedMultiFactorToken = new EventBasedMultiFactorToken(); //Required
eventBasedMultiFactorToken.setSecondFactorValidationToken("secondFactorValidationToken");
String uid = "<uid>"; //Required
ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi();
reAuthenticationApi.verifyMultiFactorPINReauthentication( eventBasedMultiFactorToken, uid , new AsyncHandler<PostValidationResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostValidationResponse response) {
System.out.println(response.getIsValid());
}
});
String accessToken = "<accessToken>"; //Required
String smsTemplate2FA = "<smsTemplate2FA>"; //Optional
ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi();
reAuthenticationApi.mfaReAuthenticate(accessToken, smsTemplate2FA , new AsyncHandler<MultiFactorAuthenticationSettingsResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(MultiFactorAuthenticationSettingsResponse response) {
System.out.println(response.getIsGoogleAuthenticatorVerified());
}
});
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
String accessToken = "<accessToken>"; //Required
ConsentUpdateModel consentUpdateModel = new ConsentUpdateModel(); //Required
List<ConsentDataModel> consents = new ArrayList < ConsentDataModel >();
ConsentDataModel consentDataModel = new ConsentDataModel();
consentDataModel.setConsentOptionId("consentOptionId");
consentDataModel.setIsAccepted(true);
consents.add(consentDataModel);
consentUpdateModel.setConsents(consents);
ConsentManagementApi consentManagementApi = new ConsentManagementApi();
consentManagementApi.updateConsentProfileByAccessToken(accessToken, consentUpdateModel , new AsyncHandler<ConsentProfile> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ConsentProfile response) {
System.out.println(response.getAcceptedConsentVersions().get(0).getVersion());
}
});
String consentToken = "<consentToken>"; //Required
ConsentSubmitModel consentSubmitModel = new ConsentSubmitModel(); //Required
List<ConsentDataModel> data = new ArrayList < ConsentDataModel >();
ConsentDataModel consentDataModel = new ConsentDataModel();
consentDataModel.setConsentOptionId("consentOptionId");
consentDataModel.setIsAccepted(true);
data.add(consentDataModel);
consentSubmitModel.setData(data);
List<ConsentEventModel> events = new ArrayList < ConsentEventModel >();
ConsentEventModel consentEventModel = new ConsentEventModel();
consentEventModel.setEvent("event");
consentEventModel.setIsCustom(true);
events.add(consentEventModel);
consentSubmitModel.setEvents(events);
ConsentManagementApi consentManagementApi = new ConsentManagementApi();
consentManagementApi.submitConsentByConsentToken(consentToken, consentSubmitModel , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
String accessToken = "<accessToken>"; //Required
ConsentSubmitModel consentSubmitModel = new ConsentSubmitModel(); //Required
List<ConsentDataModel> data = new ArrayList < ConsentDataModel >();
ConsentDataModel consentDataModel = new ConsentDataModel();
consentDataModel.setConsentOptionId("consentOptionId");
consentDataModel.setIsAccepted(true);
data.add(consentDataModel);
consentSubmitModel.setData(data);
List<ConsentEventModel> events = new ArrayList < ConsentEventModel >();
ConsentEventModel consentEventModel = new ConsentEventModel();
consentEventModel.setEvent("event");
consentEventModel.setIsCustom(true);
events.add(consentEventModel);
consentSubmitModel.setEvents(events);
ConsentManagementApi consentManagementApi = new ConsentManagementApi();
consentManagementApi.submitConsentByAccessToken(accessToken, consentSubmitModel , new AsyncHandler<Identity> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(Identity response) {
System.out.println(response.getUid());
}
});
String uid = "<uid>"; //Required
ConsentManagementApi consentManagementApi = new ConsentManagementApi();
consentManagementApi.getConsentLogsByUid(uid , new AsyncHandler<ConsentLogsResponseModel> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ConsentLogsResponseModel response) {
System.out.println(response.getConsentLogs().get(0).getId());
}
});
String accessToken = "<accessToken>"; //Required
ConsentManagementApi consentManagementApi = new ConsentManagementApi();
consentManagementApi.getConsentLogs(accessToken , new AsyncHandler<ConsentLogsResponseModel> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ConsentLogsResponseModel response) {
System.out.println(response.getConsentLogs().get(0).getId());
}
});
String accessToken = "<accessToken>"; //Required
String event = "<event>"; //Required
Boolean isCustom = true; //Required
ConsentManagementApi consentManagementApi = new ConsentManagementApi();
consentManagementApi.verifyConsentByAccessToken(accessToken, event, isCustom , new AsyncHandler<ConsentProfileValidResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ConsentProfileValidResponse response) {
System.out.println(response.getConsentProfile().getConsents().get(0).getConsentOptionId());
}
});
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
String verificationToken = "<verificationToken>"; //Required
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
SmartLoginApi smartLoginApi = new SmartLoginApi();
smartLoginApi.smartLoginTokenVerification(verificationToken, welcomeEmailTemplate , new AsyncHandler<VerifiedResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(VerifiedResponse response) {
System.out.println(response.getIsPosted());
}
});
String clientGuid = "<clientGuid>"; //Required
String email = "<email>"; //Required
String redirectUrl = "<redirectUrl>"; //Optional
String smartLoginEmailTemplate = "<smartLoginEmailTemplate>"; //Optional
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
SmartLoginApi smartLoginApi = new SmartLoginApi();
smartLoginApi.smartLoginByEmail(clientGuid, email, redirectUrl, smartLoginEmailTemplate, welcomeEmailTemplate , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String clientGuid = "<clientGuid>"; //Required
String username = "<username>"; //Required
String redirectUrl = "<redirectUrl>"; //Optional
String smartLoginEmailTemplate = "<smartLoginEmailTemplate>"; //Optional
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
SmartLoginApi smartLoginApi = new SmartLoginApi();
smartLoginApi.smartLoginByUserName(clientGuid, username, redirectUrl, smartLoginEmailTemplate, welcomeEmailTemplate , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String clientGuid = "<clientGuid>"; //Required
String fields = null; //Optional
SmartLoginApi smartLoginApi = new SmartLoginApi();
smartLoginApi.smartLoginPing(clientGuid, fields , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
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
String otp = "<otp>"; //Required
String phone = "<phone>"; //Required
String fields = null; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
OneTouchLoginApi oneTouchLoginApi = new OneTouchLoginApi();
oneTouchLoginApi.oneTouchLoginOTPVerification(otp, phone, fields, smsTemplate , new AsyncHandler<AccessToken<UserProfile>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<UserProfile> response) {
System.out.println(response.getAccess_Token());
}
});
OneTouchLoginByEmailModel oneTouchLoginByEmailModel = new OneTouchLoginByEmailModel(); //Required
oneTouchLoginByEmailModel.setClientguid("clientguid");
oneTouchLoginByEmailModel.setEmail("email");
oneTouchLoginByEmailModel.setG_Recaptcha_Response("g-recaptcha-response");
String oneTouchLoginEmailTemplate = "<oneTouchLoginEmailTemplate>"; //Optional
String redirecturl = "<redirecturl>"; //Optional
String welcomeemailtemplate = "<welcomeemailtemplate>"; //Optional
OneTouchLoginApi oneTouchLoginApi = new OneTouchLoginApi();
oneTouchLoginApi.oneTouchLoginByEmail( oneTouchLoginByEmailModel, oneTouchLoginEmailTemplate, redirecturl, welcomeemailtemplate , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
OneTouchLoginByPhoneModel oneTouchLoginByPhoneModel = new OneTouchLoginByPhoneModel(); //Required
oneTouchLoginByPhoneModel.setG_Recaptcha_Response("g-recaptcha-response");
oneTouchLoginByPhoneModel.setPhone("phone");
String smsTemplate = "<smsTemplate>"; //Optional
OneTouchLoginApi oneTouchLoginApi = new OneTouchLoginApi();
oneTouchLoginApi.oneTouchLoginByPhone( oneTouchLoginByPhoneModel, smsTemplate , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String verificationToken = "<verificationToken>"; //Required
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
OneTouchLoginApi oneTouchLoginApi = new OneTouchLoginApi();
oneTouchLoginApi.oneTouchEmailVerification(verificationToken, welcomeEmailTemplate , new AsyncHandler<VerifiedResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(VerifiedResponse response) {
System.out.println(response.getIsPosted());
}
});
String clientGuid = "<clientGuid>"; //Required
String fields = null; //Optional
OneTouchLoginApi oneTouchLoginApi = new OneTouchLoginApi();
oneTouchLoginApi.oneTouchLoginPing(clientGuid, fields , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
List of APIs in this Section:
- PUT : Passwordless Login Phone Verification
- GET : Passwordless Login by Phone
- GET : Passwordless Login By Email
- GET : Passwordless Login By UserName
- GET : Passwordless Login Verification
PasswordLessLoginOtpModel passwordLessLoginOtpModel = new PasswordLessLoginOtpModel(); //Required
passwordLessLoginOtpModel.setOtp("otp");
passwordLessLoginOtpModel.setPhone("phone");
String fields = null; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
PasswordLessLoginApi passwordLessLoginApi = new PasswordLessLoginApi();
passwordLessLoginApi.passwordlessLoginPhoneVerification( passwordLessLoginOtpModel, fields, smsTemplate , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
String phone = "<phone>"; //Required
String smsTemplate = "<smsTemplate>"; //Optional
PasswordLessLoginApi passwordLessLoginApi = new PasswordLessLoginApi();
passwordLessLoginApi.passwordlessLoginByPhone(phone, smsTemplate , new AsyncHandler<GetResponse<SMSResponseData>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(GetResponse<SMSResponseData> response) {
System.out.println(response.getData().getSid());
}
});
String email = "<email>"; //Required
String passwordLessLoginTemplate = "<passwordLessLoginTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
PasswordLessLoginApi passwordLessLoginApi = new PasswordLessLoginApi();
passwordLessLoginApi.passwordlessLoginByEmail(email, passwordLessLoginTemplate, verificationUrl , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String username = "<username>"; //Required
String passwordLessLoginTemplate = "<passwordLessLoginTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
PasswordLessLoginApi passwordLessLoginApi = new PasswordLessLoginApi();
passwordLessLoginApi.passwordlessLoginByUserName(username, passwordLessLoginTemplate, verificationUrl , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String verificationToken = "<verificationToken>"; //Required
String fields = null; //Optional
String welcomeEmailTemplate = "<welcomeEmailTemplate>"; //Optional
PasswordLessLoginApi passwordLessLoginApi = new PasswordLessLoginApi();
passwordLessLoginApi.passwordlessLoginVerification(verificationToken, fields, welcomeEmailTemplate , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
List of APIs in this Section:
- GET : Get Server Time
- GET : Get Configurations
Integer timeDifference = 0; //Optional
ConfigurationApi configurationApi = new ConfigurationApi();
configurationApi.getServerInfo(timeDifference , new AsyncHandler<ServiceInfoModel> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ServiceInfoModel response) {
System.out.println(response.getCurrentTime());
}
});
ConfigurationApi configurationApi = new ConfigurationApi();
configurationApi.getConfigurations(new AsyncHandler<ConfigResponseModel>() {
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ConfigResponseModel response) {
System.out.println(response.getAppName());
}
});
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
AccountRolesModel accountRolesModel = new AccountRolesModel(); //Required
List<String> roles = new ArrayList < String >();
roles.add("roles");
accountRolesModel.setRoles(roles);
String uid = "<uid>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.assignRolesByUid( accountRolesModel, uid , new AsyncHandler<com.loginradius.sdk.models.responsemodels.otherobjects.AccountRolesModel> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(com.loginradius.sdk.models.responsemodels.otherobjects.AccountRolesModel response) {
System.out.println(response.getRoles());
}
});
AccountRoleContextModel accountRoleContextModel = new AccountRoleContextModel(); //Required
List<RoleContextRoleModel> roleContext = new ArrayList < RoleContextRoleModel >();
RoleContextRoleModel roleContextRoleModel = new RoleContextRoleModel();
List<String> additionalPermissions = new ArrayList < String > ();
additionalPermissions.add("additionalPermissions");
roleContextRoleModel.setAdditionalPermissions(additionalPermissions);
roleContextRoleModel.setContext("context");
roleContextRoleModel.setExpiration("expiration");
List<String> roles = new ArrayList < String > ();
roles.add("roles");
roleContextRoleModel.setRoles(roles);
roleContext.add(roleContextRoleModel);
accountRoleContextModel.setRoleContext(roleContext);
String uid = "<uid>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.updateRoleContextByUid( accountRoleContextModel, uid , new AsyncHandler<ListReturn<RoleContext>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListReturn<RoleContext> response) {
System.out.println(response.getData().get(0).getAdditionalPermissions());
}
});
PermissionsModel permissionsModel = new PermissionsModel(); //Required
List<String> permissions = new ArrayList < String >();
permissions.add("permissions");
permissionsModel.setPermissions(permissions);
String role = "<role>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.addRolePermissions( permissionsModel, role , new AsyncHandler<com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel response) {
System.out.println(response.getName());
}
});
RolesModel rolesModel = new RolesModel(); //Required
List<com.loginradius.sdk.models.requestmodels.RoleModel> roles = new ArrayList < com.loginradius.sdk.models.requestmodels.RoleModel >();
RoleModel roleModel = new RoleModel();
roleModel.setName("name");
Map<String,Boolean> permissions= new HashMap<String,Boolean> ();
permissions.put( "Permission Name", true );
roleModel.setPermissions(permissions);
roles.add(roleModel);
rolesModel.setRoles(roles);
RoleApi roleApi = new RoleApi();
roleApi.createRoles( rolesModel , new AsyncHandler<ListData<com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListData<com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel> response) {
System.out.println(response.getCount());
}
});
String uid = "<uid>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.getRolesByUid(uid , new AsyncHandler<com.loginradius.sdk.models.responsemodels.otherobjects.AccountRolesModel> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(com.loginradius.sdk.models.responsemodels.otherobjects.AccountRolesModel response) {
System.out.println(response.getRoles());
}
});
String uid = "<uid>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.getRoleContextByUid(uid , new AsyncHandler<ListReturn<RoleContext>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListReturn<RoleContext> response) {
System.out.println(response.getData().get(0).getAdditionalPermissions());
}
});
String contextName = "<contextName>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.getRoleContextByContextName(contextName , new AsyncHandler<ListReturn<RoleContextResponseModel>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListReturn<RoleContextResponseModel> response) {
System.out.println(response.getData().get(0).getEmail().get(0).getValue());
}
});
RoleApi roleApi = new RoleApi();
roleApi.getRolesList( new AsyncHandler<ListData<com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListData<com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel> response) {
System.out.println(response.getCount());
}
});
AccountRolesModel accountRolesModel = new AccountRolesModel(); //Required
List<String> roles = new ArrayList < String >();
roles.add("roles");
accountRolesModel.setRoles(roles);
String uid = "<uid>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.unassignRolesByUid( accountRolesModel, uid , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
String contextName = "<contextName>"; //Required
String uid = "<uid>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.deleteRoleContextByUid(contextName, uid , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
String contextName = "<contextName>"; //Required
RoleContextRemoveRoleModel roleContextRemoveRoleModel = new RoleContextRemoveRoleModel(); //Required
List<String> roles = new ArrayList < String >();
roles.add("roles");
roleContextRemoveRoleModel.setRoles(roles);
String uid = "<uid>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.deleteRolesFromRoleContextByUid(contextName, roleContextRemoveRoleModel, uid , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
String contextName = "<contextName>"; //Required
RoleContextAdditionalPermissionRemoveRoleModel roleContextAdditionalPermissionRemoveRoleModel = new RoleContextAdditionalPermissionRemoveRoleModel(); //Required
List<String> additionalPermissions = new ArrayList < String >();
additionalPermissions.add("additionalPermissions");
roleContextAdditionalPermissionRemoveRoleModel.setAdditionalPermissions(additionalPermissions);
String uid = "<uid>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.deleteAdditionalPermissionFromRoleContextByUid(contextName, roleContextAdditionalPermissionRemoveRoleModel, uid , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
String role = "<role>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.deleteRole(role , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
PermissionsModel permissionsModel = new PermissionsModel(); //Required
List<String> permissions = new ArrayList < String >();
permissions.add("permissions");
permissionsModel.setPermissions(permissions);
String role = "<role>"; //Required
RoleApi roleApi = new RoleApi();
roleApi.removeRolePermissions( permissionsModel, role , new AsyncHandler<com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel response) {
System.out.println(response.getName());
}
});
List of APIs in this Section:
- PUT : Update Registration Data
- POST : Validate secret code
- POST : Add Registration Data
- GET : Auth Get Registration Data Server
- GET : Get Registration Data
- DELETE : Delete Registration Data
- DELETE : Delete All Records by Datasource
RegistrationDataUpdateModel registrationDataUpdateModel = new RegistrationDataUpdateModel(); //Required
registrationDataUpdateModel.setIsActive(true);
registrationDataUpdateModel.setKey("key");
registrationDataUpdateModel.setType("type");
registrationDataUpdateModel.setValue("value");
String recordId = "<recordId>"; //Required
CustomRegistrationDataApi customRegistrationDataApi = new CustomRegistrationDataApi();
customRegistrationDataApi.updateRegistrationData( registrationDataUpdateModel, recordId , new AsyncHandler<UserProfilePostResponse<RegistrationDataField>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(UserProfilePostResponse<RegistrationDataField> response) {
System.out.println(response.getIsPosted());
}
});
String code = "<code>"; //Required
String recordId = "<recordId>"; //Required
CustomRegistrationDataApi customRegistrationDataApi = new CustomRegistrationDataApi();
customRegistrationDataApi.validateRegistrationDataCode(code, recordId , new AsyncHandler<PostValidationResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostValidationResponse response) {
System.out.println(response.getIsValid());
}
});
RegistrationDataCreateModelList registrationDataCreateModelList = new RegistrationDataCreateModelList(); //Required
List<RegistrationDataCreateModel> data = new ArrayList < RegistrationDataCreateModel >();
RegistrationDataCreateModel registrationDataCreateModel = new RegistrationDataCreateModel();
registrationDataCreateModel.setCode("code");
registrationDataCreateModel.setIsActive(true);
registrationDataCreateModel.setKey("key");
registrationDataCreateModel.setParentId("parentId");
registrationDataCreateModel.setType("type");
registrationDataCreateModel.setValue("value");
data.add(registrationDataCreateModel);
registrationDataCreateModelList.setData(data);
CustomRegistrationDataApi customRegistrationDataApi = new CustomRegistrationDataApi();
customRegistrationDataApi.addRegistrationData( registrationDataCreateModelList , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String type = "<type>"; //Required
Integer limit = 0; //Optional
String parentId = "<parentId>"; //Optional
Integer skip = 0; //Optional
CustomRegistrationDataApi customRegistrationDataApi = new CustomRegistrationDataApi();
customRegistrationDataApi.authGetRegistrationData(type, limit, parentId, skip , new AsyncHandler<RegistrationDataField[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(RegistrationDataField[] response) {
System.out.println(response[0].getCode());
}
});
String type = "<type>"; //Required
Integer limit = 0; //Optional
String parentId = "<parentId>"; //Optional
Integer skip = 0; //Optional
CustomRegistrationDataApi customRegistrationDataApi = new CustomRegistrationDataApi();
customRegistrationDataApi.getRegistrationData(type, limit, parentId, skip , new AsyncHandler<RegistrationDataField[]> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(RegistrationDataField[] response) {
System.out.println(response[0].getCode());
}
});
String recordId = "<recordId>"; //Required
CustomRegistrationDataApi customRegistrationDataApi = new CustomRegistrationDataApi();
customRegistrationDataApi.deleteRegistrationData(recordId , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
String type = "<type>"; //Required
CustomRegistrationDataApi customRegistrationDataApi = new CustomRegistrationDataApi();
customRegistrationDataApi.deleteAllRecordsByDataSource(type , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
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
EmailAuthenticationModel emailAuthenticationModel = new EmailAuthenticationModel(); //Required
emailAuthenticationModel.setEmail("email");
emailAuthenticationModel.setPassword("password");
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String loginUrl = "<loginUrl>"; //Optional
Boolean passwordDelegation = true; //Optional
String passwordDelegationApp = "<passwordDelegationApp>"; //Optional
String rbaBrowserEmailTemplate = "<rbaBrowserEmailTemplate>"; //Optional
String rbaBrowserSmsTemplate = "<rbaBrowserSmsTemplate>"; //Optional
String rbaCityEmailTemplate = "<rbaCityEmailTemplate>"; //Optional
String rbaCitySmsTemplate = "<rbaCitySmsTemplate>"; //Optional
String rbaCountryEmailTemplate = "<rbaCountryEmailTemplate>"; //Optional
String rbaCountrySmsTemplate = "<rbaCountrySmsTemplate>"; //Optional
String rbaIpEmailTemplate = "<rbaIpEmailTemplate>"; //Optional
String rbaIpSmsTemplate = "<rbaIpSmsTemplate>"; //Optional
String rbaOneclickEmailTemplate = "<rbaOneclickEmailTemplate>"; //Optional
String rbaOTPSmsTemplate = "<rbaOTPSmsTemplate>"; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
RiskBasedAuthenticationApi riskBasedAuthenticationApi = new RiskBasedAuthenticationApi();
riskBasedAuthenticationApi.rbaLoginByEmail( emailAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
UserNameAuthenticationModel userNameAuthenticationModel = new UserNameAuthenticationModel(); //Required
userNameAuthenticationModel.setPassword("password");
userNameAuthenticationModel.setUsername("username");
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String loginUrl = "<loginUrl>"; //Optional
Boolean passwordDelegation = true; //Optional
String passwordDelegationApp = "<passwordDelegationApp>"; //Optional
String rbaBrowserEmailTemplate = "<rbaBrowserEmailTemplate>"; //Optional
String rbaBrowserSmsTemplate = "<rbaBrowserSmsTemplate>"; //Optional
String rbaCityEmailTemplate = "<rbaCityEmailTemplate>"; //Optional
String rbaCitySmsTemplate = "<rbaCitySmsTemplate>"; //Optional
String rbaCountryEmailTemplate = "<rbaCountryEmailTemplate>"; //Optional
String rbaCountrySmsTemplate = "<rbaCountrySmsTemplate>"; //Optional
String rbaIpEmailTemplate = "<rbaIpEmailTemplate>"; //Optional
String rbaIpSmsTemplate = "<rbaIpSmsTemplate>"; //Optional
String rbaOneclickEmailTemplate = "<rbaOneclickEmailTemplate>"; //Optional
String rbaOTPSmsTemplate = "<rbaOTPSmsTemplate>"; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
RiskBasedAuthenticationApi riskBasedAuthenticationApi = new RiskBasedAuthenticationApi();
riskBasedAuthenticationApi.rbaLoginByUserName( userNameAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
PhoneAuthenticationModel phoneAuthenticationModel = new PhoneAuthenticationModel(); //Required
phoneAuthenticationModel.setPassword("password");
phoneAuthenticationModel.setPhone("phone");
String emailTemplate = "<emailTemplate>"; //Optional
String fields = null; //Optional
String loginUrl = "<loginUrl>"; //Optional
Boolean passwordDelegation = true; //Optional
String passwordDelegationApp = "<passwordDelegationApp>"; //Optional
String rbaBrowserEmailTemplate = "<rbaBrowserEmailTemplate>"; //Optional
String rbaBrowserSmsTemplate = "<rbaBrowserSmsTemplate>"; //Optional
String rbaCityEmailTemplate = "<rbaCityEmailTemplate>"; //Optional
String rbaCitySmsTemplate = "<rbaCitySmsTemplate>"; //Optional
String rbaCountryEmailTemplate = "<rbaCountryEmailTemplate>"; //Optional
String rbaCountrySmsTemplate = "<rbaCountrySmsTemplate>"; //Optional
String rbaIpEmailTemplate = "<rbaIpEmailTemplate>"; //Optional
String rbaIpSmsTemplate = "<rbaIpSmsTemplate>"; //Optional
String rbaOneclickEmailTemplate = "<rbaOneclickEmailTemplate>"; //Optional
String rbaOTPSmsTemplate = "<rbaOTPSmsTemplate>"; //Optional
String smsTemplate = "<smsTemplate>"; //Optional
String verificationUrl = "<verificationUrl>"; //Optional
RiskBasedAuthenticationApi riskBasedAuthenticationApi = new RiskBasedAuthenticationApi();
riskBasedAuthenticationApi.rbaLoginByPhone( phoneAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl , new AsyncHandler<AccessToken<Identity>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessToken<Identity> response) {
System.out.println(response.getAccess_Token());
}
});
List of APIs in this Section:
- GET : Generate SOTT
Integer timeDifference = 0; //Optional
SottApi sottApi = new SottApi();
sottApi.generateSott(timeDifference , new AsyncHandler<SottResponseData> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(SottResponseData response) {
System.out.println(response.getExpiryTime());
}
});
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 Vkontakte Token
- GET : Access Token via Google AuthCode
String fbAccessToken = "<fbAccessToken>"; //Required
String socialAppName = "<socialAppName>"; //Optional
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByFacebookAccessToken(fbAccessToken, socialAppName , new AsyncHandler<AccessTokenBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
String twAccessToken = "<twAccessToken>"; //Required
String twTokenSecret = "<twTokenSecret>"; //Required
String socialAppName = "<socialAppName>"; //Optional
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByTwitterAccessToken(twAccessToken, twTokenSecret, socialAppName , new AsyncHandler<AccessTokenBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
String googleAccessToken = "<googleAccessToken>"; //Required
String clientId = "<clientId>"; //Optional
String refreshToken = "<refreshToken>"; //Optional
String socialAppName = "<socialAppName>"; //Optional
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByGoogleAccessToken(googleAccessToken, clientId, refreshToken, socialAppName , new AsyncHandler<AccessTokenBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
String idToken = "<idToken>"; //Required
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByGoogleJWTAccessToken(idToken , new AsyncHandler<AccessTokenBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
String lnAccessToken = "<lnAccessToken>"; //Required
String socialAppName = "<socialAppName>"; //Optional
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByLinkedinAccessToken(lnAccessToken, socialAppName , new AsyncHandler<AccessTokenBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
String fsAccessToken = "<fsAccessToken>"; //Required
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByFoursquareAccessToken(fsAccessToken , new AsyncHandler<AccessTokenBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
String code = "<code>"; //Required
String socialAppName = "<socialAppName>"; //Optional
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByAppleIdCode(code, socialAppName , new AsyncHandler<AccessTokenBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
String code = "<code>"; //Required
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByWeChatCode(code , new AsyncHandler<AccessTokenBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
String vkAccessToken = "<vkAccessToken>"; //Required
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByVkontakteAccessToken(vkAccessToken , new AsyncHandler<AccessTokenBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
String googleAuthcode = "<googleAuthcode>"; //Required
String socialAppName = "<socialAppName>"; //Optional
NativeSocialApi nativeSocialApi = new NativeSocialApi();
nativeSocialApi.getAccessTokenByGoogleAuthCode(googleAuthcode, socialAppName , new AsyncHandler<AccessTokenBase> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(AccessTokenBase response) {
System.out.println(response.getAccess_Token());
}
});
List of APIs in this Section:
- POST : Webhook Subscribe
- GET : Webhook Subscribed URLs
- GET : Webhook Test
- DELETE : WebHook Unsubscribe
WebHookSubscribeModel webHookSubscribeModel = new WebHookSubscribeModel(); //Required
webHookSubscribeModel.setEvent("event");
webHookSubscribeModel.setTargetUrl("targetUrl");
WebHookApi webHookApi = new WebHookApi();
webHookApi.webHookSubscribe( webHookSubscribeModel , new AsyncHandler<PostResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(PostResponse response) {
System.out.println(response.getIsPosted());
}
});
String event = "<event>"; //Required
WebHookApi webHookApi = new WebHookApi();
webHookApi.getWebHookSubscribedURLs(event , new AsyncHandler<ListData<com.loginradius.sdk.models.responsemodels.otherobjects.WebHookSubscribeModel>> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(ListData<com.loginradius.sdk.models.responsemodels.otherobjects.WebHookSubscribeModel> response) {
System.out.println(response.getCount());
}
});
WebHookApi webHookApi = new WebHookApi();
webHookApi.webhookTest( new AsyncHandler<EntityPermissionAcknowledgement> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(EntityPermissionAcknowledgement response) {
System.out.println(response.getIsAllowed());
}
});
WebHookSubscribeModel webHookSubscribeModel = new WebHookSubscribeModel(); //Required
webHookSubscribeModel.setEvent("event");
webHookSubscribeModel.setTargetUrl("targetUrl");
WebHookApi webHookApi = new WebHookApi();
webHookApi.webHookUnsubscribe( webHookSubscribeModel , new AsyncHandler<DeleteResponse> (){
@Override
public void onFailure(ErrorResponse errorResponse) {
System.out.println(errorResponse.getDescription());
}
@Override
public void onSuccess(DeleteResponse response) {
System.out.println(response.getIsDeleted());
}
});
We have a demo web application using the Java SDK, which includes the following features:
- Traditional email login
- Multi-Factor login
- Passwordless login
- Social login
- Register
- Email verification
- Forgot password
- Reset password
- Change password
- Set password
- Update account
- Account linking
- Custom object management
- Roles management
You can get a copy of our demo project at GitHub.
Terminal/Command Line:
- Install Java 8 here. Ensure
java -version
andjavac -version
runs properly - Install Maven
- Set your LoginRadius credentials on the client and server side:
- Client side:
src/main/resources/static/js/options.js
- Server side (note: do not set credentials as strings i.e. with quotes):
src/main/resources/application.properties
- Client side:
- Navigate to the demo directory, and run:
mvn spring-boot:run
- Demo will appear on
http://localhost:8080
IDE:
- Same steps as above, except run via the main file located in
src/main/java/com/demo/Application.java
. Right click -> Run
Please find the reference manual here.