Skip to content

Commit

Permalink
Merge pull request #18 from LoginRadius/dev_release_version_11.6.0
Browse files Browse the repository at this point in the history
Release Version 11.6.0
  • Loading branch information
indrasen715 authored Jul 2, 2024
2 parents d3040ad + 2d37482 commit 0f5b719
Show file tree
Hide file tree
Showing 34 changed files with 1,035 additions and 351 deletions.
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,63 @@
> **LoginRadius .NET 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://docs.loginradius.com/api/v2/sdk-libraries/aspnet)


# Version 11.6.0

Release on **July 02, 2024**

## Added following APIs:
- `MFAValidateAuthenticatorCode`
- `MFAVerifyAuthenticatorCode`
- `RevokeAllRefreshToken `
- `MultipurposeEmailTokenGeneration`
- `MultipurposeSMSOTPGeneration`
- `MFAReAuthenticateByAuthenticatorCode`
- `AuthSendVerificationEmailForLinkingSocialProfiles `
- `SlidingAccessToken`
- `AccessTokenViaCustomJWTToken`
- `MFAResetAuthenticatorByToken`
- `MFAResetAuthenticatorByUid`

## Enhancements
- Added `isVoiceOtp` parameter in `ResetPhoneIDVerificationByUid` API
- Added `isVoiceOtp` parameter in `MFAConfigureByAccessToken` API
- Added `isVoiceOtp` and `options` parameter in `MFAUpdatePhoneNumberByToken` API
- Added `isVoiceOtp`, `emailTemplate2FA` and `options` parameter in `MFALoginByEmail` API
- Added `isVoiceOtp` and `emailTemplate2FA` parameter in `MFALoginByUserName` API
- Added `isVoiceOtp` , `emailTemplate2FA` and `options` parameter in `MFALoginByPhone` API
- Added `isVoiceOtp` and `options` parameter in `MFAUpdatePhoneNumber` API
- Added `isVoiceOtp` parameter in `MFAResendOTP` API
- Added `isVoiceOtp` parameter in `MFAReAuthenticate` API
- Added `isVoiceOtp` and `options` parameter in `UpdateProfileByAccessToken` API
- Added `isVoiceOtp` parameter in `UserRegistrationByEmail` API
- Added `isVoiceOtp` parameter in `UserRegistrationByCaptcha` API
- Added `isVoiceOtp` parameter in `OneTouchLoginByPhone` API
- Added `isVoiceOtp` parameter in `PasswordlessLoginPhoneVerification` API
- Added `isVoiceOtp` parameter in `PasswordlessLoginByPhone` API
- Added `isVoiceOtp` parameter in `ForgotPasswordByPhoneOTP` API
- Added `isVoiceOtp` parameter in `PhoneVerificationByOTP` API
- Added `isVoiceOtp` parameter in `PhoneVerificationOTPByAccessToken` API
- Added `isVoiceOtp` parameter in `PhoneResendVerificationOTP` API
- Added `isVoiceOtp` parameter in `UpdatePhoneNumber` API
- Added `isVoiceOtp` and `emailTemplate` parameter in `UserRegistrationByPhone` API
- Added `isVoiceOtp` parameter in `SendForgotPINSMSByPhone` API
- Added `uuid` parameter in `VerifyEmail` API

## Removed the following parameter

-`smsTemplate2FA` parameter in `MFAConfigureByAccessToken` API



## Removed (Deprecated) APIs:
- `MFAValidateGoogleAuthCode`
- `MFAReAuthenticateByGoogleAuth`
- `MFAResetGoogleAuthByToken `
- `MFAResetGoogleAuthenticatorByUid`
- `MFAUpdateByAccessToken`


# Version 11.5.0

Release on **January 23, 2023**
Expand Down
402 changes: 261 additions & 141 deletions README.md

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions Samples/dot-net-demo/dot-net-demo/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ public IActionResult LRMfaLogin([FromBody] EmailLoginModel emailLoginModel)
return Json(apiresponse.Response);
}

public IActionResult LRMfaAuth([FromBody] GoogleAuthenticatorModel googleAuth, [FromQuery(Name = "multi_factor_auth_token")] String secondFactorAuthToken)
public IActionResult LRMfaAuth([FromBody] MultiFactorAuthModelByAuthenticatorCode multiFactorAuthModelByAuthenticatorCode, [FromQuery(Name = "multi_factor_auth_token")] String secondFactorAuthToken)
{
var apiresponse = new MultiFactorAuthenticationApi().MFAValidateGoogleAuthCode(googleAuth.googleauthenticatorcode, secondFactorAuthToken).Result;
var apiresponse = new MultiFactorAuthenticationApi().MFAValidateAuthenticatorCode(multiFactorAuthModelByAuthenticatorCode, secondFactorAuthToken).Result;

if (apiresponse.RestException != null)
{
return StatusCode(400, Json(apiresponse.RestException));
Expand Down Expand Up @@ -234,7 +235,7 @@ public IActionResult LRGetCustomObject([FromQuery(Name = "auth")] String accessT

public IActionResult LRMfaResetGoogle([FromQuery(Name = "auth")] String accessToken)
{
var apiresponse = new MultiFactorAuthenticationApi().MFAResetGoogleAuthByToken(accessToken, true).Result;
var apiresponse = new MultiFactorAuthenticationApi().MFAResetAuthenticatorByToken(accessToken, true).Result;

if (apiresponse.RestException != null)
{
Expand All @@ -245,7 +246,7 @@ public IActionResult LRMfaResetGoogle([FromQuery(Name = "auth")] String accessTo

public IActionResult LRMfaValidate([FromQuery(Name = "auth")] String accessToken)
{
var apiresponse = new MultiFactorAuthenticationApi().MFAConfigureByAccessToken(accessToken).Result;
var apiresponse = new MultiFactorAuthenticationApi().MFAConfigureByAccessToken(accessToken,false).Result;

if (apiresponse.RestException != null)
{
Expand All @@ -254,9 +255,9 @@ public IActionResult LRMfaValidate([FromQuery(Name = "auth")] String accessToken
return Json(apiresponse.Response);
}

public IActionResult LRMfaEnableGoogle([FromBody] GoogleAuthenticatorModel googleAuthenticatorCode, [FromQuery(Name = "auth")] String accessToken)
public IActionResult LRMfaEnableGoogle([FromBody] MultiFactorAuthModelByAuthenticatorCodeSecurityAnswer multiFactorAuthModelByAuthenticatorCodeSecurityAnswer, [FromQuery(Name = "auth")] String accessToken)
{
var apiresponse = new MultiFactorAuthenticationApi().MFAValidateGoogleAuthCode(accessToken, googleAuthenticatorCode.googleauthenticatorcode).Result;
var apiresponse = new MultiFactorAuthenticationApi().MFAVerifyAuthenticatorCode(accessToken, multiFactorAuthModelByAuthenticatorCodeSecurityAnswer).Result;

if (apiresponse.RestException != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<div class="right-elem multifactor-elem">
<h3>Configure MultiFactor</h3>
<div class="container">
<b>Reset Google Authenticator</b><br />
<b>Reset Authenticator</b><br />
<button id="btn-user-mfa-resetgoogle">Reset</button><br />
<span id="user-mfa-message"></span>
<br />
Expand Down
4 changes: 2 additions & 2 deletions Samples/dot-net-demo/dot-net-demo/wwwroot/js/indexControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ $("#btn-minimal-mfalogin-next").click(function () {
}
$("#minimal-mfalogin-next")
.html('<table><tbody><tr>' +
'<td>Google Authenticator Code: </td><td><input type="text" id="minimal-mfalogin-googlecode"></td>' +
'<td>Authenticator Code: </td><td><input type="text" id="minimal-mfalogin-googlecode"></td>' +
'</tr></tbody></table>' +
'<button id="btn-minimal-mfalogin-login">Login</button>');
multiFactorAuthToken = ret.SecondFactorAuthentication.SecondFactorAuthenticationToken;
Expand All @@ -103,7 +103,7 @@ $("#btn-minimal-mfalogin-next").click(function () {

$("#minimal-mfalogin-next").on('click', "#btn-minimal-mfalogin-login", function() {
data = {
"googleauthenticatorcode" : $("#minimal-mfalogin-googlecode").val()
"authenticatorcode" : $("#minimal-mfalogin-googlecode").val()
}

$.ajax({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ $("#btn-user-getcustomobj").click(function () {

$("#btn-user-mfa-resetgoogle").click(function() {
let data = {
"googleauthenticator": true
"authenticator": true
}

$.ajax({
Expand All @@ -248,7 +248,7 @@ $("#btn-user-mfa-resetgoogle").click(function() {
$("#user-mfa-message").attr("class", "error-message");
}
}).done(function() {
$("#user-mfa-message").text("Google Authenticator settings reset.");
$("#user-mfa-message").text("Authenticator settings reset.");
$("#user-mfa-message").attr("class", "success-message");
});
});
Expand Down
87 changes: 86 additions & 1 deletion Source/LoginRadiusSDK.V2/Api/Account/AccountApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,12 @@ public async Task<ApiResponse<AccessToken>> GetAccessTokenByUid(string uid)
/// </summary>
/// <param name="uid">UID, the unified identifier for each user account</param>
/// <param name="smsTemplate">SMS Template name</param>
/// <param name="isVoiceOtp">Boolean, pass true if you wish to trigger voice OTP</param>
/// <returns>Response containing Definition of Complete Validation data</returns>
/// 18.27

public async Task<ApiResponse<PostResponse>> ResetPhoneIDVerificationByUid(string uid, string smsTemplate = "")
public async Task<ApiResponse<PostResponse>> ResetPhoneIDVerificationByUid(string uid, string smsTemplate = "",
bool isVoiceOtp = false)
{
if (string.IsNullOrWhiteSpace(uid))
{
Expand All @@ -529,6 +531,10 @@ public async Task<ApiResponse<PostResponse>> ResetPhoneIDVerificationByUid(strin
{
queryParameters.Add("smsTemplate", smsTemplate);
}
if (isVoiceOtp != false)
{
queryParameters.Add("isVoiceOtp", isVoiceOtp.ToString());
}

var resourcePath = $"identity/v2/manage/account/{uid}/invalidatephone";

Expand Down Expand Up @@ -656,6 +662,57 @@ public async Task<ApiResponse<DeleteResponse>> RevokeRefreshToken(string refresh
return await ConfigureAndExecute<DeleteResponse>(HttpMethod.GET, resourcePath, queryParameters, null);
}
/// <summary>
/// The Revoke All Refresh Access Token API is used to revoke all refresh tokens for a specific user.
/// </summary>
/// <param name="uid">UID, the unified identifier for each user account</param>
/// <returns>Response containing Definition of Delete Request</returns>
/// 18.33

public async Task<ApiResponse<DeleteResponse>> RevokeAllRefreshToken(string uid)
{
if (string.IsNullOrWhiteSpace(uid))
{
throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid));
}
var queryParameters = new QueryParameters
{
{ "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] },
{ "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }
};

var resourcePath = $"identity/v2/manage/account/{uid}/access_token/refresh/revoke";

return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null);
}
/// <summary>
/// This API generate Email tokens and Email OTPs for Email verification, Add email, Forgot password, Delete user, Passwordless login, Forgot pin, One-touch login and Auto login.
/// </summary>
/// <param name="multiEmailToken">Model Class containing Definition of payload for Multipurpose Email Token Generation API</param>
/// <param name="tokentype">The identifier type for the token that we need to generate</param>
/// <returns>Response containing Definition for Complete MultiToken</returns>
/// 18.34

public async Task<ApiResponse<MultiToken>> MultipurposeEmailTokenGeneration(MultiEmailToken multiEmailToken, string tokentype)
{
if (multiEmailToken == null)
{
throw new ArgumentException(BaseConstants.ValidationMessage, nameof(multiEmailToken));
}
if (string.IsNullOrWhiteSpace(tokentype))
{
throw new ArgumentException(BaseConstants.ValidationMessage, nameof(tokentype));
}
var queryParameters = new QueryParameters
{
{ "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] },
{ "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }
};

var resourcePath = $"identity/v2/manage/account/emailtoken/{tokentype}";

return await ConfigureAndExecute<MultiToken>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(multiEmailToken));
}
/// <summary>
/// Note: This is intended for specific workflows where an email may be associated to multiple UIDs. This API is used to retrieve all of the identities (UID and Profiles), associated with a specified email in Cloud Storage.
/// </summary>
/// <param name="email">Email of the user</param>
Expand Down Expand Up @@ -737,5 +794,33 @@ public async Task<ApiResponse<PostResponse>> AccountUpdateUid(UpdateUidModel upd

return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(updateUidModel));
}

/// <summary>
/// This API generates SMS OTP for Add phone, Phone Id verification, Forgot password, Forgot pin, One-touch login, smart login and Passwordless login.
/// </summary>
/// <param name="MultiSmsOtp"></param>
/// <param name="smsotptype">The identifier type for the OTP that we need to generate</param>
/// <returns>Response containing Definition for Complete MultiToken</returns>
/// 18.44

public async Task<ApiResponse<MultiToken>> MultipurposeSMSOTPGeneration(MultiSmsOtp multiSmsOtp, string smsotptype)
{
if (multiSmsOtp == null)
{
throw new ArgumentException(BaseConstants.ValidationMessage, nameof(multiSmsOtp));
}
if (string.IsNullOrWhiteSpace(smsotptype))
{
throw new ArgumentException(BaseConstants.ValidationMessage, nameof(smsotptype));
}
var queryParameters = new QueryParameters();
queryParameters.Add("apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey]);
queryParameters.Add("apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret]);

var resourcePath = $"identity/v2/manage/account/smsotp/{smsotptype}";

return await ConfigureAndExecute<MultiToken>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(multiSmsOtp));
}

}
}
Loading

0 comments on commit 0f5b719

Please sign in to comment.