Skip to content

Commit

Permalink
- Released SDK Version 11.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
giriraj12000 committed Mar 5, 2021
1 parent fe0ae6b commit 824fe98
Show file tree
Hide file tree
Showing 50 changed files with 865 additions and 706 deletions.
Empty file modified .nuget/NuGet.Config
100755 → 100644
Empty file.
9 changes: 9 additions & 0 deletions CHANGELOG.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
> **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.0.0
Release on **March 05, 2021**

## Enhancements

- Updated all API Methods in async/await to solving thread performance or scalability problems.
- Added new JWT Token Validate Method in SDK.

# Version 10.0.0
Release on **September 30, 2019**

Expand Down
Empty file modified LICENSE
100755 → 100644
Empty file.
456 changes: 238 additions & 218 deletions README.md
100755 → 100644

Large diffs are not rendered by default.

69 changes: 39 additions & 30 deletions Samples/dot-net-demo/dot-net-demo/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ public IActionResult Profile()
[HttpPost]
public IActionResult LRLogin([FromBody] EmailLoginModel emailLoginModel)
{

string fields = null;
EmailAuthenticationModel log = new EmailAuthenticationModel
{
Email = emailLoginModel.Email,
Password = emailLoginModel.Password
};
var apiresponse = new AuthenticationApi().LoginByEmail(log, fields);
var apiresponse = new AuthenticationApi().LoginByEmail(log, fields).Result;

if (apiresponse.RestException != null)
{
Expand All @@ -59,7 +60,8 @@ public IActionResult LRLogin([FromBody] EmailLoginModel emailLoginModel)

public IActionResult LRMfaLogin([FromBody] EmailLoginModel emailLoginModel)
{
var apiresponse = new MultiFactorAuthenticationApi().MFALoginByEmail(emailLoginModel.Email, emailLoginModel.Password);
var apiresponse = new MultiFactorAuthenticationApi().MFALoginByEmail(emailLoginModel.Email, emailLoginModel.Password).Result;

if (apiresponse.RestException != null)
{
return StatusCode(400, Json(apiresponse.RestException));
Expand All @@ -69,7 +71,7 @@ public IActionResult LRMfaLogin([FromBody] EmailLoginModel emailLoginModel)

public IActionResult LRMfaAuth([FromBody] GoogleAuthenticatorModel googleAuth, [FromQuery(Name = "multi_factor_auth_token")] String secondFactorAuthToken)
{
var apiresponse = new MultiFactorAuthenticationApi().MFAValidateGoogleAuthCode(googleAuth.googleauthenticatorcode, secondFactorAuthToken);
var apiresponse = new MultiFactorAuthenticationApi().MFAValidateGoogleAuthCode(googleAuth.googleauthenticatorcode, secondFactorAuthToken).Result;
if (apiresponse.RestException != null)
{
return StatusCode(400, Json(apiresponse.RestException));
Expand All @@ -79,7 +81,8 @@ public IActionResult LRMfaAuth([FromBody] GoogleAuthenticatorModel googleAuth, [

public IActionResult LRPwlessLogin([FromQuery(Name = "email")] String email, [FromQuery(Name = "verification_url")] String verificationUrl)
{
var apiresponse = new PasswordLessLoginApi().PasswordlessLoginByEmail(email, "", verificationUrl);
var apiresponse = new PasswordLessLoginApi().PasswordlessLoginByEmail(email, "", verificationUrl).Result;

if (apiresponse.RestException != null)
{
return StatusCode(400, Json(apiresponse.RestException));
Expand All @@ -89,7 +92,7 @@ public IActionResult LRPwlessLogin([FromQuery(Name = "email")] String email, [Fr

public IActionResult LRPwlessAuth([FromQuery(Name = "verification_token")] String verificationToken)
{
var apiresponse = new PasswordLessLoginApi().PasswordlessLoginVerification(verificationToken);
var apiresponse = new PasswordLessLoginApi().PasswordlessLoginVerification(verificationToken).Result;

if (apiresponse.RestException != null)
{
Expand All @@ -105,8 +108,8 @@ public IActionResult LRRegister([FromBody] AuthUserRegistrationModel identityCre
{
TimeDifference = "50"
};
var apiresponse = new AuthenticationApi().UserRegistrationByEmail(identityCreateModel, _sott.GetSott(sott), null,null, verificationUrl,null);
var apiresponse = new AuthenticationApi().UserRegistrationByEmail(identityCreateModel, _sott.GetSott(sott), null,null, verificationUrl,null).Result;

if (apiresponse.RestException != null)
{
return StatusCode(400, Json(apiresponse.RestException));
Expand All @@ -116,7 +119,7 @@ public IActionResult LRRegister([FromBody] AuthUserRegistrationModel identityCre

public IActionResult LRVerifyEmail([FromQuery(Name = "verification_token")] String verificationToken)
{
var apiresponse = new AuthenticationApi().VerifyEmail(verificationToken, "google.ca", "");
var apiresponse = new AuthenticationApi().VerifyEmail(verificationToken, "google.ca", "").Result;

if (apiresponse.RestException != null)
{
Expand All @@ -127,8 +130,8 @@ public IActionResult LRVerifyEmail([FromQuery(Name = "verification_token")] Stri

public IActionResult LRForgotPassword([FromBody] ForgotPasswordModel forgotPassModel, [FromQuery(Name = "reset_password_url")] String resetPasswordUrl)
{
var apiresponse = new AuthenticationApi().ForgotPassword(forgotPassModel.Email, resetPasswordUrl, "");

var apiresponse = new AuthenticationApi().ForgotPassword(forgotPassModel.Email, resetPasswordUrl, "").Result;
if (apiresponse.RestException != null)
{
return StatusCode(400, Json(apiresponse.RestException));
Expand All @@ -143,7 +146,7 @@ public IActionResult LRResetPasswordEmail([FromBody] ResetPasswordModel resetPas
Password = resetPasswordModel.password,
ResetToken = resetPasswordModel.resettoken
};
var apiresponse = new AuthenticationApi().ResetPasswordByResetToken(reset);
var apiresponse = new AuthenticationApi().ResetPasswordByResetToken(reset).Result;

if (apiresponse.RestException != null)
{
Expand All @@ -154,7 +157,7 @@ public IActionResult LRResetPasswordEmail([FromBody] ResetPasswordModel resetPas

public IActionResult LRChangePassword([FromBody] ChangePasswordModel changePasswordModel, [FromQuery(Name = "auth")] String accessToken)
{
var apiresponse = new AuthenticationApi().ChangePassword(accessToken, changePasswordModel.newPassword, changePasswordModel.oldPassword);
var apiresponse = new AuthenticationApi().ChangePassword(accessToken, changePasswordModel.newPassword, changePasswordModel.oldPassword).Result;

if (apiresponse.RestException != null)
{
Expand All @@ -165,8 +168,9 @@ public IActionResult LRChangePassword([FromBody] ChangePasswordModel changePassw

public IActionResult LRSetPassword([FromBody] SetPasswordModel setPasswordModel, [FromQuery(Name = "uid")] String uid)
{
var apiresponse = new AccountApi().SetAccountPasswordByUid(setPasswordModel.Password, uid);
if (apiresponse.RestException != null)
var apiresponse = new AccountApi().SetAccountPasswordByUid(setPasswordModel.Password, uid).Result;

if (apiresponse.RestException != null)
{
return StatusCode(400, Json(apiresponse.RestException));
}
Expand All @@ -175,7 +179,7 @@ public IActionResult LRSetPassword([FromBody] SetPasswordModel setPasswordModel,

public IActionResult LRUpdate([FromBody] AccountUserProfileUpdateModel updateModel, [FromQuery(Name = "uid")] String uid)
{
var apiresponse = new AccountApi().UpdateAccountByUid(updateModel, uid);
var apiresponse = new AccountApi().UpdateAccountByUid(updateModel, uid).Result;
if (apiresponse.RestException != null)
{
return StatusCode(400, Json(apiresponse.RestException));
Expand All @@ -185,7 +189,8 @@ public IActionResult LRUpdate([FromBody] AccountUserProfileUpdateModel updateMod

public IActionResult LRCreateCustomObject([FromBody] dynamic customObject, [FromQuery(Name = "auth")] String accessToken, [FromQuery(Name = "object_name")] String objectName)
{
var apiresponse = new CustomObjectApi().CreateCustomObjectByToken(accessToken, objectName, customObject);
var apiresponse = new CustomObjectApi().CreateCustomObjectByToken(accessToken, objectName, customObject).Result;

if (apiresponse.RestException != null)
{
return StatusCode(400, Json(apiresponse.RestException));
Expand All @@ -195,8 +200,8 @@ public IActionResult LRCreateCustomObject([FromBody] dynamic customObject, [From

public IActionResult LRUpdateCustomObject([FromBody] dynamic customObject, [FromQuery(Name = "auth")] String accessToken, [FromQuery(Name = "object_name")] String objectName, [FromQuery(Name = "object_id")] String objectId)
{
var apiresponse = new CustomObjectApi().UpdateCustomObjectByToken(accessToken, objectName, objectId, customObject);

var apiresponse = new CustomObjectApi().UpdateCustomObjectByToken(accessToken, objectName, objectId, customObject).Result;

if (apiresponse.RestException != null)
{
Expand All @@ -207,8 +212,8 @@ public IActionResult LRUpdateCustomObject([FromBody] dynamic customObject, [From

public IActionResult LRDeleteCustomObject([FromQuery(Name = "auth")] String accessToken, [FromQuery(Name = "object_name")] String objectName, [FromQuery(Name = "object_id")] String objectId)
{
var apiresponse = new CustomObjectApi().DeleteCustomObjectByToken(accessToken, objectName, objectId);
var apiresponse = new CustomObjectApi().DeleteCustomObjectByToken(accessToken, objectName, objectId).Result;

if (apiresponse.RestException != null)
{
return StatusCode(400, Json(apiresponse.RestException));
Expand All @@ -218,7 +223,8 @@ public IActionResult LRDeleteCustomObject([FromQuery(Name = "auth")] String acce

public IActionResult LRGetCustomObject([FromQuery(Name = "auth")] String accessToken, [FromQuery(Name = "object_name")] String objectName)
{
var apiresponse = new CustomObjectApi().GetCustomObjectByToken(accessToken, objectName);
var apiresponse = new CustomObjectApi().GetCustomObjectByToken(accessToken, objectName).Result;

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

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

if (apiresponse.RestException != null)
{
return StatusCode(400, Json(apiresponse.RestException));
Expand All @@ -238,7 +245,8 @@ public IActionResult LRMfaResetGoogle([FromQuery(Name = "auth")] String accessTo

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

if (apiresponse.RestException != null)
{
return StatusCode(400, Json(apiresponse.RestException));
Expand All @@ -248,7 +256,8 @@ public IActionResult LRMfaValidate([FromQuery(Name = "auth")] String accessToken

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

if (apiresponse.RestException != null)
{
return StatusCode(400, Json(apiresponse.RestException));
Expand All @@ -258,7 +267,7 @@ public IActionResult LRMfaEnableGoogle([FromBody] GoogleAuthenticatorModel googl

public IActionResult LRGetRoles()
{
var apiresponse = new RoleApi().GetRolesList();
var apiresponse = new RoleApi().GetRolesList().Result;
if (apiresponse.RestException != null)
{
return StatusCode(400, Json(apiresponse.RestException));
Expand All @@ -268,7 +277,7 @@ public IActionResult LRGetRoles()

public IActionResult LRGetRole([FromQuery(Name = "uid")] String uid)
{
var apiresponse = new RoleApi().GetRolesByUid(uid);
var apiresponse = new RoleApi().GetRolesByUid(uid).Result;
if (apiresponse.RestException != null)
{
return StatusCode(400, Json(apiresponse.RestException));
Expand All @@ -278,7 +287,7 @@ public IActionResult LRGetRole([FromQuery(Name = "uid")] String uid)

public IActionResult LRCreateRole([FromBody] RolesModel rolePermissions)
{
var apiresponse = new RoleApi().CreateRoles(rolePermissions);
var apiresponse = new RoleApi().CreateRoles(rolePermissions).Result;

if (apiresponse.RestException != null)
{
Expand All @@ -289,7 +298,7 @@ public IActionResult LRCreateRole([FromBody] RolesModel rolePermissions)

public IActionResult LRDeleteRole([FromQuery(Name = "role")] String roleName)
{
var apiresponse = new RoleApi().DeleteRole(roleName);
var apiresponse = new RoleApi().DeleteRole(roleName).Result;
if (apiresponse.RestException != null)
{
return StatusCode(400, Json(apiresponse.RestException));
Expand All @@ -299,7 +308,7 @@ public IActionResult LRDeleteRole([FromQuery(Name = "role")] String roleName)

public IActionResult LRAssignRole([FromQuery(Name = "uid")] String uid, [FromBody] AccountRolesModel roles)
{
var apiresponse = new RoleApi().AssignRolesByUid(roles, uid);
var apiresponse = new RoleApi().AssignRolesByUid(roles, uid).Result;
if (apiresponse.RestException != null)
{
return StatusCode(400, Json(apiresponse.RestException));
Expand All @@ -309,7 +318,7 @@ public IActionResult LRAssignRole([FromQuery(Name = "uid")] String uid, [FromBod

public IActionResult LRGetProfile([FromQuery(Name = "auth")] String accessToken)
{
var apiresponse = new AuthenticationApi().GetProfileByAccessToken(accessToken);
var apiresponse = new AuthenticationApi().GetProfileByAccessToken(accessToken).Result;
if (apiresponse.RestException != null)
{
return StatusCode(400, Json(apiresponse.RestException));
Expand Down
Empty file modified Source/.nuget/NuGet.Config
100755 → 100644
Empty file.
Empty file modified Source/LoginRadiusSDK.V2.sln
100755 → 100644
Empty file.
Loading

0 comments on commit 824fe98

Please sign in to comment.