Skip to content

Commit d523edc

Browse files
committed
Release Version 11.2.0
1 parent 0c32829 commit d523edc

24 files changed

+1733
-133
lines changed

CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
11
> **LoginRadius Java SDK Change Log** provides information regarding what has changed, more specifically what changes, improvements and bug fix has been made to the SDK. For more details please refer to the [LoginRadius API Documention(https://www.loginradius.com/docs/api/v2/deployment/sdk-libraries/java-library/)
22
3+
# Version 11.2.0
4+
Release on September 7, 2021
5+
6+
## Enhancements
7+
8+
- Updated Jquery with latest version(3.6.0) in SDK Demo
9+
10+
11+
## Added new multiple APIs for better user experience
12+
13+
- MFAEmailOtpByAccessToken
14+
- MFAValidateEmailOtpByAccessToken
15+
- MFAResetEmailOtpAuthenticatorByAccessToken
16+
- MFASecurityQuestionAnswerByAccessToken
17+
- MFAResetSecurityQuestionAuthenticatorByAccessToken
18+
- MFAEmailOTP
19+
- MFAValidateEmailOtp
20+
- MFASecurityQuestionAnswer
21+
- MFASecurityQuestionAnswerVerification
22+
- MFAResetEmailOtpAuthenticatorByUid
23+
- MFAResetSecurityQuestionAuthenticatorByUid
24+
- ReAuthValidateEmailOtp
25+
- ReAuthSendEmailOtp
26+
- ReAuthBySecurityQuestion
27+
28+
#### Added `EmailTemplate2FA` parameter in the following API
29+
- MFALoginByEmail
30+
- MFALoginByUserName
31+
- MFALoginByPhone
32+
33+
#### Added `RbaBrowserEmailTemplate`, `RbaCityEmailTemplate` ,`RbaCountryEmailTemplate` , `RbaIpEmailTemplate` parameter in the following API
34+
- MFAValidateOTPByPhone
35+
- MFAValidateGoogleAuthCode
36+
- MFAValidateBackupCode
37+
38+
#### Added `emailTemplate`, `verificationUrl` ,`welcomeEmailTemplate` parameter in the following API
39+
40+
- GetProfileByAccessToken
41+
42+
#### Removed `smsTemplate2FA ` parameter from the following API
43+
- mfaValidateGoogleAuthCode
44+
345
# Version 11.1.0
446
Release on April 21, 2021
547

LoginRadius-JavaSDK/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.loginradius.sdk</groupId>
88
<artifactId>java-sdk</artifactId>
9-
<version>11.1.0</version>
9+
<version>11.2.0</version>
1010
<name>LoginRadius-CustomerIdentity-JavaSDK</name>
1111
<description>LoginRadius Java SDK</description>
1212
<url>https://github.com/LoginRadius/java-sdk</url>

LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/MultiFactorAuthenticationApi.java

Lines changed: 576 additions & 14 deletions
Large diffs are not rendered by default.

LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/ReAuthenticationApi.java

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@
1818
import com.loginradius.sdk.models.requestmodels.PINAuthEventBasedAuthModelWithLockout;
1919
import com.loginradius.sdk.models.requestmodels.PasswordEventBasedAuthModelWithLockout;
2020
import com.loginradius.sdk.models.requestmodels.ReauthByBackupCodeModel;
21+
import com.loginradius.sdk.models.requestmodels.ReauthByEmailOtpModel;
2122
import com.loginradius.sdk.models.requestmodels.ReauthByGoogleAuthenticatorCodeModel;
2223
import com.loginradius.sdk.models.requestmodels.ReauthByOtpModel;
24+
import com.loginradius.sdk.models.requestmodels.SecurityQuestionAnswerUpdateModel;
2325
import com.loginradius.sdk.models.responsemodels.EventBasedMultiFactorAuthenticationToken;
2426
import com.loginradius.sdk.models.responsemodels.MultiFactorAuthenticationSettingsResponse;
27+
import com.loginradius.sdk.models.responsemodels.otherobjects.PostResponse;
2528
import com.loginradius.sdk.models.responsemodels.otherobjects.PostValidationResponse;
2629
import com.loginradius.sdk.util.AsyncHandler;
2730
import com.loginradius.sdk.util.ErrorResponse;
@@ -419,4 +422,134 @@ public void onFailure(ErrorResponse errorResponse) {
419422
}
420423
});
421424
}
425+
426+
// <summary>
427+
// This API is used to validate the triggered MFA authentication flow with an Email OTP.
428+
// </summary>
429+
// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param>
430+
// <param name="reauthByEmailOtpModel">payload</param>
431+
// <returns>Response containing Definition response of MFA reauthentication</returns>
432+
// 42.14
433+
434+
435+
public void reAuthValidateEmailOtp(String accessToken, ReauthByEmailOtpModel reauthByEmailOtpModel, final AsyncHandler<EventBasedMultiFactorAuthenticationToken> handler) {
436+
437+
if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) {
438+
throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken"));
439+
}
440+
441+
if (reauthByEmailOtpModel == null) {
442+
throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("reauthByEmailOtpModel"));
443+
}
444+
445+
Map<String, String> queryParameters = new HashMap<String, String>();
446+
queryParameters.put("access_token", accessToken);
447+
queryParameters.put("apiKey", LoginRadiusSDK.getApiKey());
448+
449+
String resourcePath = "identity/v2/auth/account/reauth/2fa/otp/email/verify";
450+
451+
LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(reauthByEmailOtpModel), new AsyncHandler<String>() {
452+
453+
@Override
454+
public void onSuccess(String response) {
455+
TypeToken<EventBasedMultiFactorAuthenticationToken> typeToken = new TypeToken<EventBasedMultiFactorAuthenticationToken>() {};
456+
EventBasedMultiFactorAuthenticationToken successResponse = JsonDeserializer.deserializeJson(response,typeToken);
457+
handler.onSuccess(successResponse);
458+
}
459+
460+
@Override
461+
public void onFailure(ErrorResponse errorResponse) {
462+
handler.onFailure(errorResponse);
463+
}
464+
});
465+
}
466+
467+
// <summary>
468+
// This API is used to send the MFA Email OTP to the email for Re-authentication
469+
// </summary>
470+
// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param>
471+
// <param name="emailId">EmailId</param>
472+
// <param name="emailTemplate2FA">EmailTemplate2FA</param>
473+
// <returns>Response containing Definition of Complete Validation data</returns>
474+
// 42.15
475+
476+
477+
public void reAuthSendEmailOtp(String accessToken, String emailId,
478+
String emailTemplate2FA, final AsyncHandler<PostResponse> handler) {
479+
480+
if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) {
481+
throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken"));
482+
}
483+
484+
if (LoginRadiusValidator.isNullOrWhiteSpace(emailId)) {
485+
throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("emailId"));
486+
}
487+
488+
Map<String, String> queryParameters = new HashMap<String, String>();
489+
queryParameters.put("access_token", accessToken);
490+
queryParameters.put("apiKey", LoginRadiusSDK.getApiKey());
491+
queryParameters.put("emailId", emailId);
492+
493+
if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate2FA)) {
494+
queryParameters.put("emailTemplate2FA", emailTemplate2FA);
495+
}
496+
497+
String resourcePath = "identity/v2/auth/account/reauth/2fa/otp/email";
498+
499+
LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler<String>() {
500+
501+
@Override
502+
public void onSuccess(String response) {
503+
TypeToken<PostResponse> typeToken = new TypeToken<PostResponse>() {};
504+
PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken);
505+
handler.onSuccess(successResponse);
506+
}
507+
508+
@Override
509+
public void onFailure(ErrorResponse errorResponse) {
510+
handler.onFailure(errorResponse);
511+
}
512+
});
513+
}
514+
515+
// <summary>
516+
// This API is used to validate the triggered MFA re-authentication flow with security questions answers.
517+
// </summary>
518+
// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param>
519+
// <param name="securityQuestionAnswerUpdateModel">payload</param>
520+
// <returns>Response containing Definition response of MFA reauthentication</returns>
521+
// 42.16
522+
523+
524+
public void reAuthBySecurityQuestion(String accessToken, SecurityQuestionAnswerUpdateModel securityQuestionAnswerUpdateModel, final AsyncHandler<EventBasedMultiFactorAuthenticationToken> handler) {
525+
526+
if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) {
527+
throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken"));
528+
}
529+
530+
if (securityQuestionAnswerUpdateModel == null) {
531+
throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("securityQuestionAnswerUpdateModel"));
532+
}
533+
534+
Map<String, String> queryParameters = new HashMap<String, String>();
535+
queryParameters.put("access_token", accessToken);
536+
queryParameters.put("apiKey", LoginRadiusSDK.getApiKey());
537+
538+
String resourcePath = "identity/v2/auth/account/reauth/2fa/securityquestionanswer/verify";
539+
540+
LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(securityQuestionAnswerUpdateModel), new AsyncHandler<String>() {
541+
542+
@Override
543+
public void onSuccess(String response) {
544+
TypeToken<EventBasedMultiFactorAuthenticationToken> typeToken = new TypeToken<EventBasedMultiFactorAuthenticationToken>() {};
545+
EventBasedMultiFactorAuthenticationToken successResponse = JsonDeserializer.deserializeJson(response,typeToken);
546+
handler.onSuccess(successResponse);
547+
}
548+
549+
@Override
550+
public void onFailure(ErrorResponse errorResponse) {
551+
handler.onFailure(errorResponse);
552+
}
553+
});
554+
}
422555
}

LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/AuthenticationApi.java

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
import com.loginradius.sdk.util.LoginRadiusSDK;
4646

4747

48-
4948
public class AuthenticationApi {
5049
private static Gson gson =new Gson();
5150

@@ -392,11 +391,14 @@ public void onFailure(ErrorResponse errorResponse) {
392391
// </summary>
393392
// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param>
394393
// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param>
394+
// <param name="emailTemplate"></param>
395+
// <param name="verificationUrl"></param>
396+
// <param name="welcomeEmailTemplate"></param>
395397
// <returns>Response containing Definition for Complete profile data</returns>
396398
// 5.2
397399

398400

399-
public void getProfileByAccessToken(String accessToken, String fields, final AsyncHandler<Identity> handler) {
401+
public void getProfileByAccessToken(String accessToken, String fields, String emailTemplate,String verificationUrl, String welcomeEmailTemplate, final AsyncHandler<Identity> handler) {
400402

401403
if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) {
402404
throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken"));
@@ -410,6 +412,18 @@ public void getProfileByAccessToken(String accessToken, String fields, final Asy
410412
queryParameters.put("fields", fields);
411413
}
412414

415+
if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) {
416+
queryParameters.put("emailTemplate", emailTemplate);
417+
}
418+
419+
if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) {
420+
queryParameters.put("verificationUrl", verificationUrl);
421+
}
422+
423+
if (!LoginRadiusValidator.isNullOrWhiteSpace(welcomeEmailTemplate)) {
424+
queryParameters.put("welcomeEmailTemplate", welcomeEmailTemplate);
425+
}
426+
413427
String resourcePath = "identity/v2/auth/account";
414428

415429
LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler<String>() {
@@ -656,13 +670,13 @@ public void onFailure(ErrorResponse errorResponse) {
656670
}
657671

658672
// <summary>
659-
//
673+
// This API is used to get a user's profile using the clientGuid parameter if no callback feature enabled
660674
// </summary>
661-
// <param name="clientGuid"></param>
662-
// <param name="emailTemplate"></param>
663-
// <param name="fields"></param>
664-
// <param name="verificationUrl"></param>
665-
// <param name="welcomeEmailTemplate"></param>
675+
// <param name="clientGuid">ClientGuid</param>
676+
// <param name="emailTemplate">EmailTemplate</param>
677+
// <param name="fields">Fields</param>
678+
// <param name="verificationUrl">VerificationUrl</param>
679+
// <param name="welcomeEmailTemplate">WelcomeEmailTemplate</param>
666680
// <returns>Response containing User Profile Data and access token</returns>
667681
// 5.16
668682

LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/PasswordLessLoginApi.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,10 @@ public void onFailure(ErrorResponse errorResponse) {
261261
}
262262

263263
// <summary>
264-
//
264+
// This API is used to verify the otp sent to the email when doing a passwordless login.
265265
// </summary>
266-
// <param name="passwordLessLoginByEmailAndOtpModel"></param>
267-
// <param name="fields"></param>
266+
// <param name="passwordLessLoginByEmailAndOtpModel">payload</param>
267+
// <param name="fields">Fields</param>
268268
// <returns>Response containing User Profile Data and access token</returns>
269269
// 9.23
270270

@@ -301,10 +301,10 @@ public void onFailure(ErrorResponse errorResponse) {
301301
}
302302

303303
// <summary>
304-
//
304+
// This API is used to verify the otp sent to the email when doing a passwordless login.
305305
// </summary>
306-
// <param name="passwordLessLoginByUserNameAndOtpModel"></param>
307-
// <param name="fields"></param>
306+
// <param name="passwordLessLoginByUserNameAndOtpModel">payload</param>
307+
// <param name="fields">Fields</param>
308308
// <returns>Response containing User Profile Data and access token</returns>
309309
// 9.24
310310

LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/social/SocialApi.java

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,46 +1324,6 @@ public void onFailure(ErrorResponse errorResponse) {
13241324
});
13251325
}
13261326

1327-
// <summary>
1328-
// The User Profile API is used to get social profile data from the user's social account after authentication.<br><br><b>Supported Providers:</b> All
1329-
// </summary>
1330-
// <param name="accessToken">Uniquely generated identifier key by LoginRadius that is activated after successful authentication.</param>
1331-
// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param>
1332-
// <returns>Response containing Definition for Complete UserProfile data</returns>
1333-
// 38.1
1334-
1335-
1336-
public void getSocialUserProfile(String accessToken, String fields, final AsyncHandler<UserProfile> handler) {
1337-
1338-
if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) {
1339-
throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken"));
1340-
}
1341-
1342-
Map<String, String> queryParameters = new HashMap<String, String>();
1343-
queryParameters.put("access_token", accessToken);
1344-
1345-
if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) {
1346-
queryParameters.put("fields", fields);
1347-
}
1348-
1349-
String resourcePath = "api/v2/userprofile";
1350-
1351-
LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler<String>() {
1352-
1353-
@Override
1354-
public void onSuccess(String response) {
1355-
TypeToken<UserProfile> typeToken = new TypeToken<UserProfile>() {};
1356-
UserProfile successResponse = JsonDeserializer.deserializeJson(response,typeToken);
1357-
handler.onSuccess(successResponse);
1358-
}
1359-
1360-
@Override
1361-
public void onFailure(ErrorResponse errorResponse) {
1362-
handler.onFailure(errorResponse);
1363-
}
1364-
});
1365-
}
1366-
13671327
// <summary>
13681328
// The User Profile API is used to get the latest updated social profile data from the user's social account after authentication. The social profile will be retrieved via oAuth and OpenID protocols. The data is normalized into LoginRadius' standard data format. This API should be called using the access token retrieved from the refresh access token API.
13691329
// </summary>

LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/helper/LoginRadiusRequest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@
88
import java.io.OutputStream;
99
import java.io.OutputStreamWriter;
1010
import java.io.UnsupportedEncodingException;
11+
import java.net.Authenticator;
1112
import java.net.HttpURLConnection;
13+
import java.net.InetSocketAddress;
1214
import java.net.MalformedURLException;
15+
import java.net.PasswordAuthentication;
16+
import java.net.Proxy;
1317
import java.net.SocketTimeoutException;
1418
import java.net.URL;
1519
import java.net.URLEncoder;
@@ -23,10 +27,6 @@
2327
import java.util.Map;
2428
import java.util.TimeZone;
2529
import java.util.zip.GZIPInputStream;
26-
import java.net.Proxy;
27-
import java.net.Authenticator;
28-
import java.net.InetSocketAddress;
29-
import java.net.PasswordAuthentication;
3030

3131
import javax.crypto.Mac;
3232
import javax.crypto.spec.SecretKeySpec;

0 commit comments

Comments
 (0)