diff --git a/.nuget/NuGet.Config b/.nuget/NuGet.Config old mode 100755 new mode 100644 diff --git a/CHANGELOG.md b/CHANGELOG.md old mode 100755 new mode 100644 index a82a93f..283ae96 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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** diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 index e6f5b38..7d13862 --- a/README.md +++ b/README.md @@ -207,7 +207,7 @@ string fields = null; //Optional ; //Optional var smsTemplate = "smsTemplate"; //Optional var verificationUrl = "verificationUrl"; //Optional -var apiResponse = new AuthenticationApi().UpdateProfileByAccessToken(accessToken, userProfileUpdateModel, emailTemplate, fields, smsTemplate, verificationUrl); +var apiResponse = new AuthenticationApi().UpdateProfileByAccessToken(accessToken, userProfileUpdateModel, emailTemplate, fields, smsTemplate, verificationUrl).Result; ``` @@ -222,7 +222,7 @@ var accessToken = "accessToken"; //Required UnlockProfileModel unlockProfileModel = new UnlockProfileModel{ G_recaptcha_response ="" }; //Required -var apiResponse = new AuthenticationApi().UnlockAccountByToken(accessToken, unlockProfileModel); +var apiResponse = new AuthenticationApi().UnlockAccountByToken(accessToken, unlockProfileModel).Result; ``` @@ -240,7 +240,7 @@ Otp ="" string fields = null; //Optional var url = "url"; //Optional var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional -var apiResponse = new AuthenticationApi().VerifyEmailByOTP(emailVerificationByOtpModel, fields, url, welcomeEmailTemplate); +var apiResponse = new AuthenticationApi().VerifyEmailByOTP(emailVerificationByOtpModel, fields, url, welcomeEmailTemplate).Result; ``` @@ -258,7 +258,7 @@ SecurityAnswer = new Dictionary{ ["QuestionID"] = "Answer" } }; //Required -var apiResponse = new AuthenticationApi().ResetPasswordBySecurityAnswerAndEmail(resetPasswordBySecurityAnswerAndEmailModel); +var apiResponse = new AuthenticationApi().ResetPasswordBySecurityAnswerAndEmail(resetPasswordBySecurityAnswerAndEmailModel).Result; ``` @@ -276,7 +276,7 @@ SecurityAnswer = new Dictionary{ ["QuestionID"] = "Answer" } }; //Required -var apiResponse = new AuthenticationApi().ResetPasswordBySecurityAnswerAndPhone(resetPasswordBySecurityAnswerAndPhoneModel); +var apiResponse = new AuthenticationApi().ResetPasswordBySecurityAnswerAndPhone(resetPasswordBySecurityAnswerAndPhoneModel).Result; ``` @@ -294,7 +294,7 @@ SecurityAnswer = new Dictionary{ }, UserName ="" }; //Required -var apiResponse = new AuthenticationApi().ResetPasswordBySecurityAnswerAndUserName(resetPasswordBySecurityAnswerAndUserNameModel); +var apiResponse = new AuthenticationApi().ResetPasswordBySecurityAnswerAndUserName(resetPasswordBySecurityAnswerAndUserNameModel).Result; ``` @@ -309,7 +309,7 @@ ResetPasswordByResetTokenModel resetPasswordByResetTokenModel = new ResetPasswor Password ="", ResetToken ="" }; //Required -var apiResponse = new AuthenticationApi().ResetPasswordByResetToken(resetPasswordByResetTokenModel); +var apiResponse = new AuthenticationApi().ResetPasswordByResetToken(resetPasswordByResetTokenModel).Result; ``` @@ -325,7 +325,7 @@ Email ="", Otp ="", Password ="" }; //Required -var apiResponse = new AuthenticationApi().ResetPasswordByEmailOTP(resetPasswordByEmailAndOtpModel); +var apiResponse = new AuthenticationApi().ResetPasswordByEmailOTP(resetPasswordByEmailAndOtpModel).Result; ``` @@ -341,7 +341,7 @@ Otp ="", Password ="", UserName ="" }; //Required -var apiResponse = new AuthenticationApi().ResetPasswordByOTPAndUserName(resetPasswordByUserNameModel); +var apiResponse = new AuthenticationApi().ResetPasswordByOTPAndUserName(resetPasswordByUserNameModel).Result; ``` @@ -355,7 +355,7 @@ This API is used to change the accounts password based on the previous password var accessToken = "accessToken"; //Required var newPassword = "newPassword"; //Required var oldPassword = "oldPassword"; //Required -var apiResponse = new AuthenticationApi().ChangePassword(accessToken, newPassword, oldPassword); +var apiResponse = new AuthenticationApi().ChangePassword(accessToken, newPassword, oldPassword).Result; ``` @@ -368,7 +368,7 @@ This API is used to link up a social provider account with the specified account var accessToken = "accessToken"; //Required var candidateToken = "candidateToken"; //Required -var apiResponse = new AuthenticationApi().LinkSocialIdentities(accessToken, candidateToken); +var apiResponse = new AuthenticationApi().LinkSocialIdentities(accessToken, candidateToken).Result; ``` @@ -381,7 +381,7 @@ This API is used to set or change UserName by access token. [More Info](https:// var accessToken = "accessToken"; //Required var username = "username"; //Required -var apiResponse = new AuthenticationApi().SetOrChangeUserName(accessToken, username); +var apiResponse = new AuthenticationApi().SetOrChangeUserName(accessToken, username).Result; ``` @@ -395,7 +395,7 @@ This API resends the verification email to the user. [More Info](https://www.log var email = "email"; //Required var emailTemplate = "emailTemplate"; //Optional var verificationUrl = "verificationUrl"; //Optional -var apiResponse = new AuthenticationApi().AuthResendEmailVerification(email, emailTemplate, verificationUrl); +var apiResponse = new AuthenticationApi().AuthResendEmailVerification(email, emailTemplate, verificationUrl).Result; ``` @@ -411,7 +411,7 @@ var email = "email"; //Required var type = "type"; //Required var emailTemplate = "emailTemplate"; //Optional var verificationUrl = "verificationUrl"; //Optional -var apiResponse = new AuthenticationApi().AddEmail(accessToken, email, type, emailTemplate, verificationUrl); +var apiResponse = new AuthenticationApi().AddEmail(accessToken, email, type, emailTemplate, verificationUrl).Result; ``` @@ -430,7 +430,7 @@ var emailTemplate = "emailTemplate"; //Optional string fields = null; //Optional var loginUrl = "loginUrl"; //Optional var verificationUrl = "verificationUrl"; //Optional -var apiResponse = new AuthenticationApi().LoginByEmail(emailAuthenticationModel, emailTemplate, fields, loginUrl, verificationUrl); +var apiResponse = new AuthenticationApi().LoginByEmail(emailAuthenticationModel, emailTemplate, fields, loginUrl, verificationUrl).Result; ``` @@ -449,7 +449,7 @@ var emailTemplate = "emailTemplate"; //Optional string fields = null; //Optional var loginUrl = "loginUrl"; //Optional var verificationUrl = "verificationUrl"; //Optional -var apiResponse = new AuthenticationApi().LoginByUserName(userNameAuthenticationModel, emailTemplate, fields, loginUrl, verificationUrl); +var apiResponse = new AuthenticationApi().LoginByUserName(userNameAuthenticationModel, emailTemplate, fields, loginUrl, verificationUrl).Result; ``` @@ -463,7 +463,7 @@ This API is used to send the reset password url to a specified account. Note: If var email = "email"; //Required var resetPasswordUrl = "resetPasswordUrl"; //Required var emailTemplate = "emailTemplate"; //Optional -var apiResponse = new AuthenticationApi().ForgotPassword(email, resetPasswordUrl, emailTemplate); +var apiResponse = new AuthenticationApi().ForgotPassword(email, resetPasswordUrl, emailTemplate).Result; ``` @@ -490,7 +490,7 @@ string fields = null; //Optional var options = "options"; //Optional var verificationUrl = "verificationUrl"; //Optional var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional -var apiResponse = new AuthenticationApi().UserRegistrationByEmail(authUserRegistrationModel, sott, emailTemplate, fields, options, verificationUrl, welcomeEmailTemplate); +var apiResponse = new AuthenticationApi().UserRegistrationByEmail(authUserRegistrationModel, sott, emailTemplate, fields, options, verificationUrl, welcomeEmailTemplate).Result; ``` @@ -518,7 +518,7 @@ var options = "options"; //Optional var smsTemplate = "smsTemplate"; //Optional var verificationUrl = "verificationUrl"; //Optional var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional -var apiResponse = new AuthenticationApi().UserRegistrationByCaptcha(authUserRegistrationModelWithCaptcha, emailTemplate, fields, options, smsTemplate, verificationUrl, welcomeEmailTemplate); +var apiResponse = new AuthenticationApi().UserRegistrationByCaptcha(authUserRegistrationModelWithCaptcha, emailTemplate, fields, options, smsTemplate, verificationUrl, welcomeEmailTemplate).Result; ``` @@ -530,7 +530,7 @@ This API is used to retrieve the list of questions that are configured on the re ``` var email = "email"; //Required -var apiResponse = new AuthenticationApi().GetSecurityQuestionsByEmail(email); +var apiResponse = new AuthenticationApi().GetSecurityQuestionsByEmail(email).Result; ``` @@ -542,7 +542,7 @@ This API is used to retrieve the list of questions that are configured on the re ``` var userName = "userName"; //Required -var apiResponse = new AuthenticationApi().GetSecurityQuestionsByUserName(userName); +var apiResponse = new AuthenticationApi().GetSecurityQuestionsByUserName(userName).Result; ``` @@ -554,7 +554,7 @@ This API is used to retrieve the list of questions that are configured on the re ``` var phone = "phone"; //Required -var apiResponse = new AuthenticationApi().GetSecurityQuestionsByPhone(phone); +var apiResponse = new AuthenticationApi().GetSecurityQuestionsByPhone(phone).Result; ``` @@ -566,7 +566,7 @@ This API is used to retrieve the list of questions that are configured on the re ``` var accessToken = "accessToken"; //Required -var apiResponse = new AuthenticationApi().GetSecurityQuestionsByAccessToken(accessToken); +var apiResponse = new AuthenticationApi().GetSecurityQuestionsByAccessToken(accessToken).Result; ``` @@ -578,7 +578,7 @@ This api validates access token, if valid then returns a response with its expir ``` var accessToken = "accessToken"; //Required -var apiResponse = new AuthenticationApi().AuthValidateAccessToken(accessToken); +var apiResponse = new AuthenticationApi().AuthValidateAccessToken(accessToken).Result; ``` @@ -591,7 +591,7 @@ This api call invalidates the active access token or expires an access token's v var accessToken = "accessToken"; //Required var preventRefresh = true; //Optional -var apiResponse = new AuthenticationApi().AuthInValidateAccessToken(accessToken, preventRefresh); +var apiResponse = new AuthenticationApi().AuthInValidateAccessToken(accessToken, preventRefresh).Result; ``` @@ -603,7 +603,7 @@ This api call provide the active access token Information [More Info](https://ww ``` var accessToken = "accessToken"; //Required -var apiResponse = new AuthenticationApi().GetAccessTokenInfo(accessToken); +var apiResponse = new AuthenticationApi().GetAccessTokenInfo(accessToken).Result; ``` @@ -616,7 +616,7 @@ This API retrieves a copy of the user data based on the access_token. [More Info var accessToken = "accessToken"; //Required string fields = null; //Optional -var apiResponse = new AuthenticationApi().GetProfileByAccessToken(accessToken, fields); +var apiResponse = new AuthenticationApi().GetProfileByAccessToken(accessToken, fields).Result; ``` @@ -629,7 +629,7 @@ This API sends a welcome email [More Info](https://www.loginradius.com/docs/api/ var accessToken = "accessToken"; //Required var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional -var apiResponse = new AuthenticationApi().SendWelcomeEmail(accessToken, welcomeEmailTemplate); +var apiResponse = new AuthenticationApi().SendWelcomeEmail(accessToken, welcomeEmailTemplate).Result; ``` @@ -641,7 +641,7 @@ This API is used to delete an account by passing it a delete token. [More Info]( ``` var deleteToken = "deleteToken"; //Required -var apiResponse = new AuthenticationApi().DeleteAccountByDeleteToken(deleteToken); +var apiResponse = new AuthenticationApi().DeleteAccountByDeleteToken(deleteToken).Result; ``` @@ -653,7 +653,7 @@ This API is used to check the email exists or not on your site. [More Info](http ``` var email = "email"; //Required -var apiResponse = new AuthenticationApi().CheckEmailAvailability(email); +var apiResponse = new AuthenticationApi().CheckEmailAvailability(email).Result; ``` @@ -668,7 +668,7 @@ var verificationToken = "verificationToken"; //Required string fields = null; //Optional var url = "url"; //Optional var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional -var apiResponse = new AuthenticationApi().VerifyEmail(verificationToken, fields, url, welcomeEmailTemplate); +var apiResponse = new AuthenticationApi().VerifyEmail(verificationToken, fields, url, welcomeEmailTemplate).Result; ``` @@ -681,7 +681,7 @@ This API is called just after account linking API and it prevents the raas profi var accessToken = "accessToken"; //Required string fields = null; //Optional -var apiResponse = new AuthenticationApi().GetSocialIdentity(accessToken, fields); +var apiResponse = new AuthenticationApi().GetSocialIdentity(accessToken, fields).Result; ``` @@ -693,7 +693,7 @@ This API is used to check the UserName exists or not on your site. [More Info](h ``` var username = "username"; //Required -var apiResponse = new AuthenticationApi().CheckUserNameAvailability(username); +var apiResponse = new AuthenticationApi().CheckUserNameAvailability(username).Result; ``` @@ -706,7 +706,7 @@ This API is used to update the privacy policy stored in the user's profile by pr var accessToken = "accessToken"; //Required string fields = null; //Optional -var apiResponse = new AuthenticationApi().AcceptPrivacyPolicy(accessToken, fields); +var apiResponse = new AuthenticationApi().AcceptPrivacyPolicy(accessToken, fields).Result; ``` @@ -718,7 +718,7 @@ This API will return all the accepted privacy policies for the user by providing ``` var accessToken = "accessToken"; //Required -var apiResponse = new AuthenticationApi().GetPrivacyPolicyHistoryByAccessToken(accessToken); +var apiResponse = new AuthenticationApi().GetPrivacyPolicyHistoryByAccessToken(accessToken).Result; ``` @@ -732,7 +732,7 @@ This API will send a confirmation email for account deletion to the customer's e var accessToken = "accessToken"; //Required var deleteUrl = "deleteUrl"; //Optional var emailTemplate = "emailTemplate"; //Optional -var apiResponse = new AuthenticationApi().DeleteAccountWithEmailConfirmation(accessToken, deleteUrl, emailTemplate); +var apiResponse = new AuthenticationApi().DeleteAccountWithEmailConfirmation(accessToken, deleteUrl, emailTemplate).Result; ``` @@ -745,7 +745,7 @@ This API is used to remove additional emails from a user's account. [More Info]( var accessToken = "accessToken"; //Required var email = "email"; //Required -var apiResponse = new AuthenticationApi().RemoveEmail(accessToken, email); +var apiResponse = new AuthenticationApi().RemoveEmail(accessToken, email).Result; ``` @@ -759,7 +759,7 @@ This API is used to unlink up a social provider account with the specified accou var accessToken = "accessToken"; //Required var provider = "provider"; //Required var providerId = "providerId"; //Required -var apiResponse = new AuthenticationApi().UnlinkSocialIdentities(accessToken, provider, providerId); +var apiResponse = new AuthenticationApi().UnlinkSocialIdentities(accessToken, provider, providerId).Result; ``` @@ -812,7 +812,7 @@ LastName ="" var uid = "uid"; //Required string fields = null; //Optional ; //Optional -var apiResponse = new AccountApi().UpdateAccountByUid(accountUserProfileUpdateModel, uid, fields); +var apiResponse = new AccountApi().UpdateAccountByUid(accountUserProfileUpdateModel, uid, fields).Result; ``` @@ -826,7 +826,7 @@ This API is used to update the PhoneId by using the Uid's. Admin can update the var phone = "phone"; //Required var uid = "uid"; //Required string fields = null; //Optional -var apiResponse = new AccountApi().UpdatePhoneIDByUid(phone, uid, fields); +var apiResponse = new AccountApi().UpdatePhoneIDByUid(phone, uid, fields).Result; ``` @@ -839,7 +839,7 @@ This API is used to set the password of an account in Cloud Storage. [More Info] var password = "password"; //Required var uid = "uid"; //Required -var apiResponse = new AccountApi().SetAccountPasswordByUid(password, uid); +var apiResponse = new AccountApi().SetAccountPasswordByUid(password, uid).Result; ``` @@ -853,7 +853,7 @@ This API is used to invalidate the Email Verification status on an account. [Mor var uid = "uid"; //Required var emailTemplate = "emailTemplate"; //Optional var verificationUrl = "verificationUrl"; //Optional -var apiResponse = new AccountApi().InvalidateAccountEmailVerification(uid, emailTemplate, verificationUrl); +var apiResponse = new AccountApi().InvalidateAccountEmailVerification(uid, emailTemplate, verificationUrl).Result; ``` @@ -866,7 +866,7 @@ This API Allows you to reset the phone no verification of an end user’s accoun var uid = "uid"; //Required var smsTemplate = "smsTemplate"; //Optional -var apiResponse = new AccountApi().ResetPhoneIDVerificationByUid(uid, smsTemplate); +var apiResponse = new AccountApi().ResetPhoneIDVerificationByUid(uid, smsTemplate).Result; ``` @@ -886,7 +886,7 @@ Value ="" }; //Required var uid = "uid"; //Required string fields = null; //Optional -var apiResponse = new AccountApi().UpsertEmail(upsertEmailModel, uid, fields); +var apiResponse = new AccountApi().UpsertEmail(upsertEmailModel, uid, fields).Result; ``` @@ -901,7 +901,7 @@ UpdateUidModel updateUidModel = new UpdateUidModel{ NewUid ="" }; //Required var uid = "uid"; //Required -var apiResponse = new AccountApi().AccountUpdateUid(updateUidModel, uid); +var apiResponse = new AccountApi().AccountUpdateUid(updateUidModel, uid).Result; ``` @@ -923,7 +923,7 @@ LastName ="", Password ="" }; //Required string fields = null; //Optional -var apiResponse = new AccountApi().CreateAccount(accountCreateModel, fields); +var apiResponse = new AccountApi().CreateAccount(accountCreateModel, fields).Result; ``` @@ -938,7 +938,7 @@ var email = "email"; //Required var emailTemplate = "emailTemplate"; //Optional var resetPasswordUrl = "resetPasswordUrl"; //Optional var sendEmail = true; //Optional -var apiResponse = new AccountApi().GetForgotPasswordToken(email, emailTemplate, resetPasswordUrl, sendEmail); +var apiResponse = new AccountApi().GetForgotPasswordToken(email, emailTemplate, resetPasswordUrl, sendEmail).Result; ``` @@ -950,7 +950,7 @@ This API Returns an Email Verification token. [More Info](https://www.loginradiu ``` var email = "email"; //Required -var apiResponse = new AccountApi().GetEmailVerificationToken(email); +var apiResponse = new AccountApi().GetEmailVerificationToken(email).Result; ``` @@ -962,7 +962,7 @@ This API is used to retrieve all of the accepted Policies by the user, associate ``` var uid = "uid"; //Required -var apiResponse = new AccountApi().GetPrivacyPolicyHistoryByUid(uid); +var apiResponse = new AccountApi().GetPrivacyPolicyHistoryByUid(uid).Result; ``` @@ -975,7 +975,7 @@ This API is used to retrieve all of the profile data, associated with the specif var email = "email"; //Required string fields = null; //Optional -var apiResponse = new AccountApi().GetAccountProfileByEmail(email, fields); +var apiResponse = new AccountApi().GetAccountProfileByEmail(email, fields).Result; ``` @@ -988,7 +988,7 @@ This API is used to retrieve all of the profile data associated with the specifi var userName = "userName"; //Required string fields = null; //Optional -var apiResponse = new AccountApi().GetAccountProfileByUserName(userName, fields); +var apiResponse = new AccountApi().GetAccountProfileByUserName(userName, fields).Result; ``` @@ -1001,7 +1001,7 @@ This API is used to retrieve all of the profile data, associated with the accoun var phone = "phone"; //Required string fields = null; //Optional -var apiResponse = new AccountApi().GetAccountProfileByPhone(phone, fields); +var apiResponse = new AccountApi().GetAccountProfileByPhone(phone, fields).Result; ``` @@ -1014,7 +1014,7 @@ This API is used to retrieve all of the profile data, associated with the accoun var uid = "uid"; //Required string fields = null; //Optional -var apiResponse = new AccountApi().GetAccountProfileByUid(uid, fields); +var apiResponse = new AccountApi().GetAccountProfileByUid(uid, fields).Result; ``` @@ -1026,7 +1026,7 @@ This API use to retrive the hashed password of a specified account in Cloud Stor ``` var uid = "uid"; //Required -var apiResponse = new AccountApi().GetAccountPasswordHashByUid(uid); +var apiResponse = new AccountApi().GetAccountPasswordHashByUid(uid).Result; ``` @@ -1038,7 +1038,7 @@ The API is used to get LoginRadius access token based on UID. [More Info](https: ``` var uid = "uid"; //Required -var apiResponse = new AccountApi().GetAccessTokenByUid(uid); +var apiResponse = new AccountApi().GetAccessTokenByUid(uid).Result; ``` @@ -1050,7 +1050,7 @@ This API is used to refresh an access_token via it's associated refresh_token. [ ``` var refreshToken = "refreshToken"; //Required -var apiResponse = new AccountApi().RefreshAccessTokenByRefreshToken(refreshToken); +var apiResponse = new AccountApi().RefreshAccessTokenByRefreshToken(refreshToken).Result; ``` @@ -1062,7 +1062,7 @@ The Revoke Refresh Access Token API is used to revoke a refresh token or the Pro ``` var refreshToken = "refreshToken"; //Required -var apiResponse = new AccountApi().RevokeRefreshToken(refreshToken); +var apiResponse = new AccountApi().RevokeRefreshToken(refreshToken).Result; ``` @@ -1075,7 +1075,7 @@ Note: This is intended for specific workflows where an email may be associated t var email = "email"; //Required string fields = null; //Optional -var apiResponse = new AccountApi().GetAccountIdentitiesByEmail(email, fields); +var apiResponse = new AccountApi().GetAccountIdentitiesByEmail(email, fields).Result; ``` @@ -1087,7 +1087,7 @@ This API deletes the Users account and allows them to re-register for a new acco ``` var uid = "uid"; //Required -var apiResponse = new AccountApi().DeleteAccountByUid(uid); +var apiResponse = new AccountApi().DeleteAccountByUid(uid).Result; ``` @@ -1101,7 +1101,7 @@ Use this API to Remove emails from a user Account [More Info](https://www.loginr var email = "email"; //Required var uid = "uid"; //Required string fields = null; //Optional -var apiResponse = new AccountApi().RemoveEmail(email, uid, fields); +var apiResponse = new AccountApi().RemoveEmail(email, uid, fields).Result; ``` @@ -1113,7 +1113,7 @@ This API is used to delete all user profiles associated with an Email. [More Inf ``` var email = "email"; //Required -var apiResponse = new AccountApi().AccountDeleteByEmail(email); +var apiResponse = new AccountApi().AccountDeleteByEmail(email).Result; ``` @@ -1174,7 +1174,7 @@ var accessToken = "accessToken"; //Required var message = "message"; //Required var subject = "subject"; //Required var to = "to"; //Required -var apiResponse = new SocialApi().PostMessage(accessToken, message, subject, to); +var apiResponse = new SocialApi().PostMessage(accessToken, message, subject, to).Result; ``` @@ -1193,7 +1193,7 @@ var status = "status"; //Required var title = "title"; //Required var url = "url"; //Required var shorturl = "shorturl"; //Optional -var apiResponse = new SocialApi().StatusPosting(accessToken, caption, description, imageUrl, status, title, url, shorturl); +var apiResponse = new SocialApi().StatusPosting(accessToken, caption, description, imageUrl, status, title, url, shorturl).Result; ``` @@ -1213,7 +1213,7 @@ Status ="", Title ="", Url ="<Url>" }; //Required -var apiResponse = new SocialApi().TrackableStatusPosting(accessToken, statusModel); +var apiResponse = new SocialApi().TrackableStatusPosting(accessToken, statusModel).Result; ``` @@ -1225,7 +1225,7 @@ This API Is used to translate the Request Token returned during authentication i ``` var token = "token"; //Required -var apiResponse = new SocialApi().ExchangeAccessToken(token); +var apiResponse = new SocialApi().ExchangeAccessToken(token).Result; ``` @@ -1238,7 +1238,7 @@ The Refresh Access Token API is used to refresh the provider access token after var accessToken = "accessToken"; //Required var expiresIn = 0; //Optional -var apiResponse = new SocialApi().RefreshAccessToken(accessToken, expiresIn); +var apiResponse = new SocialApi().RefreshAccessToken(accessToken, expiresIn).Result; ``` @@ -1250,7 +1250,7 @@ This API validates access token, if valid then returns a response with its expir ``` var accessToken = "accessToken"; //Required -var apiResponse = new SocialApi().ValidateAccessToken(accessToken); +var apiResponse = new SocialApi().ValidateAccessToken(accessToken).Result; ``` @@ -1262,7 +1262,7 @@ This api invalidates the active access token or expires an access token validity ``` var accessToken = "accessToken"; //Required -var apiResponse = new SocialApi().InValidateAccessToken(accessToken); +var apiResponse = new SocialApi().InValidateAccessToken(accessToken).Result; ``` @@ -1274,7 +1274,7 @@ This api is use to get all active session by Access Token. [More Info](https://w ``` var token = "token"; //Required -var apiResponse = new SocialApi().GetActiveSession(token); +var apiResponse = new SocialApi().GetActiveSession(token).Result; ``` @@ -1286,7 +1286,7 @@ This api is used to get all active sessions by AccountID(UID). [More Info](https ``` var accountId = "accountId"; //Required -var apiResponse = new SocialApi().GetActiveSessionByAccountID(accountId); +var apiResponse = new SocialApi().GetActiveSessionByAccountID(accountId).Result; ``` @@ -1298,7 +1298,7 @@ This api is used to get all active sessions by ProfileId. [More Info](https://ww ``` var profileId = "profileId"; //Required -var apiResponse = new SocialApi().GetActiveSessionByProfileID(profileId); +var apiResponse = new SocialApi().GetActiveSessionByProfileID(profileId).Result; ``` @@ -1310,7 +1310,7 @@ var apiResponse = new SocialApi().GetActiveSessionByProfileID(profileId); ``` var accessToken = "accessToken"; //Required -var apiResponse = new SocialApi().GetAlbums(accessToken); +var apiResponse = new SocialApi().GetAlbums(accessToken).Result; ``` @@ -1323,7 +1323,7 @@ var apiResponse = new SocialApi().GetAlbums(accessToken); var accessToken = "accessToken"; //Required var nextCursor = "nextCursor"; //Required -var apiResponse = new SocialApi().GetAlbumsWithCursor(accessToken, nextCursor); +var apiResponse = new SocialApi().GetAlbumsWithCursor(accessToken, nextCursor).Result; ``` @@ -1335,7 +1335,7 @@ The Audio API is used to get audio files data from the user's social account.<br ``` var accessToken = "accessToken"; //Required -var apiResponse = new SocialApi().GetAudios(accessToken); +var apiResponse = new SocialApi().GetAudios(accessToken).Result; ``` @@ -1348,7 +1348,7 @@ The Audio API is used to get audio files data from the user's social account.<br var accessToken = "accessToken"; //Required var nextCursor = "nextCursor"; //Required -var apiResponse = new SocialApi().GetAudiosWithCursor(accessToken, nextCursor); +var apiResponse = new SocialApi().GetAudiosWithCursor(accessToken, nextCursor).Result; ``` @@ -1360,7 +1360,7 @@ The Check In API is used to get check Ins data from the user's social account.<b ``` var accessToken = "accessToken"; //Required -var apiResponse = new SocialApi().GetCheckIns(accessToken); +var apiResponse = new SocialApi().GetCheckIns(accessToken).Result; ``` @@ -1373,7 +1373,7 @@ The Check In API is used to get check Ins data from the user's social account.<b var accessToken = "accessToken"; //Required var nextCursor = "nextCursor"; //Required -var apiResponse = new SocialApi().GetCheckInsWithCursor(accessToken, nextCursor); +var apiResponse = new SocialApi().GetCheckInsWithCursor(accessToken, nextCursor).Result; ``` @@ -1386,7 +1386,7 @@ The Contact API is used to get contacts/friends/connections data from the user's var accessToken = "accessToken"; //Required var nextCursor = "nextCursor"; //Optional -var apiResponse = new SocialApi().GetContacts(accessToken, nextCursor); +var apiResponse = new SocialApi().GetContacts(accessToken, nextCursor).Result; ``` @@ -1398,7 +1398,7 @@ The Event API is used to get the event data from the user's social account.<br>< ``` var accessToken = "accessToken"; //Required -var apiResponse = new SocialApi().GetEvents(accessToken); +var apiResponse = new SocialApi().GetEvents(accessToken).Result; ``` @@ -1411,7 +1411,7 @@ The Event API is used to get the event data from the user's social account.<br>< var accessToken = "accessToken"; //Required var nextCursor = "nextCursor"; //Required -var apiResponse = new SocialApi().GetEventsWithCursor(accessToken, nextCursor); +var apiResponse = new SocialApi().GetEventsWithCursor(accessToken, nextCursor).Result; ``` @@ -1423,7 +1423,7 @@ Get the following user list from the user's social account.<br><br><b>Supported ``` var accessToken = "accessToken"; //Required -var apiResponse = new SocialApi().GetFollowings(accessToken); +var apiResponse = new SocialApi().GetFollowings(accessToken).Result; ``` @@ -1436,7 +1436,7 @@ Get the following user list from the user's social account.<br><br><b>Supported var accessToken = "accessToken"; //Required var nextCursor = "nextCursor"; //Required -var apiResponse = new SocialApi().GetFollowingsWithCursor(accessToken, nextCursor); +var apiResponse = new SocialApi().GetFollowingsWithCursor(accessToken, nextCursor).Result; ``` @@ -1448,7 +1448,7 @@ The Group API is used to get group data from the user's social account.<br><br>< ``` var accessToken = "accessToken"; //Required -var apiResponse = new SocialApi().GetGroups(accessToken); +var apiResponse = new SocialApi().GetGroups(accessToken).Result; ``` @@ -1461,7 +1461,7 @@ The Group API is used to get group data from the user's social account.<br><br>< var accessToken = "accessToken"; //Required var nextCursor = "nextCursor"; //Required -var apiResponse = new SocialApi().GetGroupsWithCursor(accessToken, nextCursor); +var apiResponse = new SocialApi().GetGroupsWithCursor(accessToken, nextCursor).Result; ``` @@ -1473,7 +1473,7 @@ The Like API is used to get likes data from the user's social account.<br><br><b ``` var accessToken = "accessToken"; //Required -var apiResponse = new SocialApi().GetLikes(accessToken); +var apiResponse = new SocialApi().GetLikes(accessToken).Result; ``` @@ -1486,7 +1486,7 @@ The Like API is used to get likes data from the user's social account.<br><br><b var accessToken = "accessToken"; //Required var nextCursor = "nextCursor"; //Required -var apiResponse = new SocialApi().GetLikesWithCursor(accessToken, nextCursor); +var apiResponse = new SocialApi().GetLikesWithCursor(accessToken, nextCursor).Result; ``` @@ -1498,7 +1498,7 @@ The Mention API is used to get mentions data from the user's social account.<br> ``` var accessToken = "accessToken"; //Required -var apiResponse = new SocialApi().GetMentions(accessToken); +var apiResponse = new SocialApi().GetMentions(accessToken).Result; ``` @@ -1511,7 +1511,7 @@ The Page API is used to get the page data from the user's social account.<br><br var accessToken = "accessToken"; //Required var pageName = "pageName"; //Required -var apiResponse = new SocialApi().GetPage(accessToken, pageName); +var apiResponse = new SocialApi().GetPage(accessToken, pageName).Result; ``` @@ -1524,7 +1524,7 @@ The Photo API is used to get photo data from the user's social account.<br><br>< var accessToken = "accessToken"; //Required var albumId = "albumId"; //Required -var apiResponse = new SocialApi().GetPhotos(accessToken, albumId); +var apiResponse = new SocialApi().GetPhotos(accessToken, albumId).Result; ``` @@ -1536,7 +1536,7 @@ The Post API is used to get post message data from the user's social account.<br ``` var accessToken = "accessToken"; //Required -var apiResponse = new SocialApi().GetPosts(accessToken); +var apiResponse = new SocialApi().GetPosts(accessToken).Result; ``` @@ -1554,7 +1554,7 @@ var imageUrl = "imageUrl"; //Required var status = "status"; //Required var title = "title"; //Required var url = "url"; //Required -var apiResponse = new SocialApi().GetTrackableStatusStats(accessToken, caption, description, imageUrl, status, title, url); +var apiResponse = new SocialApi().GetTrackableStatusStats(accessToken, caption, description, imageUrl, status, title, url).Result; ``` @@ -1566,7 +1566,7 @@ The Trackable status API works very similar to the Status API but it returns a P ``` var postId = "postId"; //Required -var apiResponse = new SocialApi().TrackableStatusFetching(postId); +var apiResponse = new SocialApi().TrackableStatusFetching(postId).Result; ``` @@ -1579,7 +1579,7 @@ The User Profile API is used to get social profile data from the user's social a var accessToken = "accessToken"; //Required string fields = null; //Optional -var apiResponse = new SocialApi().GetSocialUserProfile(accessToken, fields); +var apiResponse = new SocialApi().GetSocialUserProfile(accessToken, fields).Result; ``` @@ -1592,7 +1592,7 @@ The User Profile API is used to get the latest updated social profile data from var accessToken = "accessToken"; //Required string fields = null; //Optional -var apiResponse = new SocialApi().GetRefreshedSocialUserProfile(accessToken, fields); +var apiResponse = new SocialApi().GetRefreshedSocialUserProfile(accessToken, fields).Result; ``` @@ -1605,7 +1605,7 @@ The Video API is used to get video files data from the user's social account.<br var accessToken = "accessToken"; //Required var nextCursor = "nextCursor"; //Required -var apiResponse = new SocialApi().GetVideos(accessToken, nextCursor); +var apiResponse = new SocialApi().GetVideos(accessToken, nextCursor).Result; ``` @@ -1658,7 +1658,7 @@ var objectName = "objectName"; //Required var objectRecordId = "objectRecordId"; //Required CustomObjectUpdateOperationType updateType = CustomObjectUpdateOperationType.Default; //Optional -var apiResponse = new CustomObjectApi().UpdateCustomObjectByToken(accessToken, objectName, objectRecordId, customObject, updateType); +var apiResponse = new CustomObjectApi().UpdateCustomObjectByToken(accessToken, objectName, objectRecordId, customObject, updateType).Result; ``` @@ -1674,7 +1674,7 @@ var objectRecordId = "objectRecordId"; //Required var uid = "uid"; //Required CustomObjectUpdateOperationType updateType = CustomObjectUpdateOperationType.Default; //Optional -var apiResponse = new CustomObjectApi().UpdateCustomObjectByUid(objectName, objectRecordId, customObject, uid, updateType); +var apiResponse = new CustomObjectApi().UpdateCustomObjectByUid(objectName, objectRecordId, customObject, uid, updateType).Result; ``` @@ -1688,7 +1688,7 @@ This API is used to write information in JSON format to the custom object for th var accessToken = "accessToken"; //Required var objectName = "objectName"; //Required -var apiResponse = new CustomObjectApi().CreateCustomObjectByToken(accessToken, objectName, customObject); +var apiResponse = new CustomObjectApi().CreateCustomObjectByToken(accessToken, objectName, customObject).Result; ``` @@ -1702,7 +1702,7 @@ This API is used to write information in JSON format to the custom object for th var objectName = "objectName"; //Required var uid = "uid"; //Required -var apiResponse = new CustomObjectApi().CreateCustomObjectByUid(objectName, customObject, uid); +var apiResponse = new CustomObjectApi().CreateCustomObjectByUid(objectName, customObject, uid).Result; ``` @@ -1715,7 +1715,7 @@ This API is used to retrieve the specified Custom Object data for the specified var accessToken = "accessToken"; //Required var objectName = "objectName"; //Required -var apiResponse = new CustomObjectApi().GetCustomObjectByToken(accessToken, objectName); +var apiResponse = new CustomObjectApi().GetCustomObjectByToken(accessToken, objectName).Result; ``` @@ -1729,7 +1729,7 @@ This API is used to retrieve the Custom Object data for the specified account. [ var accessToken = "accessToken"; //Required var objectName = "objectName"; //Required var objectRecordId = "objectRecordId"; //Required -var apiResponse = new CustomObjectApi().GetCustomObjectByRecordIDAndToken(accessToken, objectName, objectRecordId); +var apiResponse = new CustomObjectApi().GetCustomObjectByRecordIDAndToken(accessToken, objectName, objectRecordId).Result; ``` @@ -1742,7 +1742,7 @@ This API is used to retrieve all the custom objects by UID from cloud storage. [ var objectName = "objectName"; //Required var uid = "uid"; //Required -var apiResponse = new CustomObjectApi().GetCustomObjectByUid(objectName, uid); +var apiResponse = new CustomObjectApi().GetCustomObjectByUid(objectName, uid).Result; ``` @@ -1756,7 +1756,7 @@ This API is used to retrieve the Custom Object data for the specified account. [ var objectName = "objectName"; //Required var objectRecordId = "objectRecordId"; //Required var uid = "uid"; //Required -var apiResponse = new CustomObjectApi().GetCustomObjectByRecordID(objectName, objectRecordId, uid); +var apiResponse = new CustomObjectApi().GetCustomObjectByRecordID(objectName, objectRecordId, uid).Result; ``` @@ -1770,7 +1770,7 @@ This API is used to remove the specified Custom Object data using ObjectRecordId var accessToken = "accessToken"; //Required var objectName = "objectName"; //Required var objectRecordId = "objectRecordId"; //Required -var apiResponse = new CustomObjectApi().DeleteCustomObjectByToken(accessToken, objectName, objectRecordId); +var apiResponse = new CustomObjectApi().DeleteCustomObjectByToken(accessToken, objectName, objectRecordId).Result; ``` @@ -1784,7 +1784,7 @@ This API is used to remove the specified Custom Object data using ObjectRecordId var objectName = "objectName"; //Required var objectRecordId = "objectRecordId"; //Required var uid = "uid"; //Required -var apiResponse = new CustomObjectApi().DeleteCustomObjectByRecordID(objectName, objectRecordId, uid); +var apiResponse = new CustomObjectApi().DeleteCustomObjectByRecordID(objectName, objectRecordId, uid).Result; ``` @@ -1823,7 +1823,7 @@ Otp ="<Otp>", Password ="<Password>", Phone ="<Phone>" }; //Required -var apiResponse = new PhoneAuthenticationApi().ResetPasswordByPhoneOTP(resetPasswordByOTPModel); +var apiResponse = new PhoneAuthenticationApi().ResetPasswordByPhoneOTP(resetPasswordByOTPModel).Result; ``` @@ -1838,7 +1838,7 @@ var otp = "otp"; //Required var phone = "phone"; //Required string fields = null; //Optional var smsTemplate = "smsTemplate"; //Optional -var apiResponse = new PhoneAuthenticationApi().PhoneVerificationByOTP(otp, phone, fields, smsTemplate); +var apiResponse = new PhoneAuthenticationApi().PhoneVerificationByOTP(otp, phone, fields, smsTemplate).Result; ``` @@ -1852,7 +1852,7 @@ This API is used to consume the verification code sent to verify a user's phone var accessToken = "accessToken"; //Required var otp = "otp"; //Required var smsTemplate = "smsTemplate"; //Optional -var apiResponse = new PhoneAuthenticationApi().PhoneVerificationOTPByAccessToken(accessToken, otp, smsTemplate); +var apiResponse = new PhoneAuthenticationApi().PhoneVerificationOTPByAccessToken(accessToken, otp, smsTemplate).Result; ``` @@ -1866,7 +1866,7 @@ This API is used to update the login Phone Number of users [More Info](https://w var accessToken = "accessToken"; //Required var phone = "phone"; //Required var smsTemplate = "smsTemplate"; //Optional -var apiResponse = new PhoneAuthenticationApi().UpdatePhoneNumber(accessToken, phone, smsTemplate); +var apiResponse = new PhoneAuthenticationApi().UpdatePhoneNumber(accessToken, phone, smsTemplate).Result; ``` @@ -1884,7 +1884,7 @@ Phone ="<Phone>" string fields = null; //Optional var loginUrl = "loginUrl"; //Optional var smsTemplate = "smsTemplate"; //Optional -var apiResponse = new PhoneAuthenticationApi().LoginByPhone(phoneAuthenticationModel, fields, loginUrl, smsTemplate); +var apiResponse = new PhoneAuthenticationApi().LoginByPhone(phoneAuthenticationModel, fields, loginUrl, smsTemplate).Result; ``` @@ -1897,7 +1897,7 @@ This API is used to send the OTP to reset the account password. [More Info](http var phone = "phone"; //Required var smsTemplate = "smsTemplate"; //Optional -var apiResponse = new PhoneAuthenticationApi().ForgotPasswordByPhoneOTP(phone, smsTemplate); +var apiResponse = new PhoneAuthenticationApi().ForgotPasswordByPhoneOTP(phone, smsTemplate).Result; ``` @@ -1910,7 +1910,7 @@ This API is used to resend a verification OTP to verify a user's Phone Number. T var phone = "phone"; //Required var smsTemplate = "smsTemplate"; //Optional -var apiResponse = new PhoneAuthenticationApi().PhoneResendVerificationOTP(phone, smsTemplate); +var apiResponse = new PhoneAuthenticationApi().PhoneResendVerificationOTP(phone, smsTemplate).Result; ``` @@ -1924,7 +1924,7 @@ This API is used to resend a verification OTP to verify a user's Phone Number in var accessToken = "accessToken"; //Required var phone = "phone"; //Required var smsTemplate = "smsTemplate"; //Optional -var apiResponse = new PhoneAuthenticationApi().PhoneResendVerificationOTPByToken(accessToken, phone, smsTemplate); +var apiResponse = new PhoneAuthenticationApi().PhoneResendVerificationOTPByToken(accessToken, phone, smsTemplate).Result; ``` @@ -1947,7 +1947,7 @@ var options = "options"; //Optional var smsTemplate = "smsTemplate"; //Optional var verificationUrl = "verificationUrl"; //Optional var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional -var apiResponse = new PhoneAuthenticationApi().UserRegistrationByPhone(authUserRegistrationModel, sott, fields, options, smsTemplate, verificationUrl, welcomeEmailTemplate); +var apiResponse = new PhoneAuthenticationApi().UserRegistrationByPhone(authUserRegistrationModel, sott, fields, options, smsTemplate, verificationUrl, welcomeEmailTemplate).Result; ``` @@ -1959,7 +1959,7 @@ This API is used to check the Phone Number exists or not on your site. [More Inf ``` var phone = "phone"; //Required -var apiResponse = new PhoneAuthenticationApi().CheckPhoneNumberAvailability(phone); +var apiResponse = new PhoneAuthenticationApi().CheckPhoneNumberAvailability(phone).Result; ``` @@ -1971,7 +1971,7 @@ This API is used to delete the Phone ID on a user's account via the access_token ``` var accessToken = "accessToken"; //Required -var apiResponse = new PhoneAuthenticationApi().RemovePhoneIDByAccessToken(accessToken); +var apiResponse = new PhoneAuthenticationApi().RemovePhoneIDByAccessToken(accessToken).Result; ``` @@ -2019,7 +2019,7 @@ MultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout = new MultiFacto Otp ="<Otp>" }; //Required string fields = null; //Optional -var apiResponse = new MultiFactorAuthenticationApi().MFAUpdateSetting(accessToken, multiFactorAuthModelWithLockout, fields); +var apiResponse = new MultiFactorAuthenticationApi().MFAUpdateSetting(accessToken, multiFactorAuthModelWithLockout, fields).Result; ``` @@ -2036,7 +2036,7 @@ GoogleAuthenticatorCode ="<GoogleAuthenticatorCode>" }; //Required string fields = null; //Optional var smsTemplate = "smsTemplate"; //Optional -var apiResponse = new MultiFactorAuthenticationApi().MFAUpdateByAccessToken(accessToken, multiFactorAuthModelByGoogleAuthenticatorCode, fields, smsTemplate); +var apiResponse = new MultiFactorAuthenticationApi().MFAUpdateByAccessToken(accessToken, multiFactorAuthModelByGoogleAuthenticatorCode, fields, smsTemplate).Result; ``` @@ -2050,7 +2050,7 @@ This API is used to update the Multi-factor authentication phone number by sendi var accessToken = "accessToken"; //Required var phoneNo2FA = "phoneNo2FA"; //Required var smsTemplate2FA = "smsTemplate2FA"; //Optional -var apiResponse = new MultiFactorAuthenticationApi().MFAUpdatePhoneNumberByToken(accessToken, phoneNo2FA, smsTemplate2FA); +var apiResponse = new MultiFactorAuthenticationApi().MFAUpdatePhoneNumberByToken(accessToken, phoneNo2FA, smsTemplate2FA).Result; ``` @@ -2067,7 +2067,7 @@ Otp ="<Otp>" var secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required string fields = null; //Optional var smsTemplate2FA = "smsTemplate2FA"; //Optional -var apiResponse = new MultiFactorAuthenticationApi().MFAValidateOTPByPhone(multiFactorAuthModelWithLockout, secondFactorAuthenticationToken, fields, smsTemplate2FA); +var apiResponse = new MultiFactorAuthenticationApi().MFAValidateOTPByPhone(multiFactorAuthModelWithLockout, secondFactorAuthenticationToken, fields, smsTemplate2FA).Result; ``` @@ -2082,7 +2082,7 @@ var googleAuthenticatorCode = "googleAuthenticatorCode"; //Required var secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required string fields = null; //Optional var smsTemplate2FA = "smsTemplate2FA"; //Optional -var apiResponse = new MultiFactorAuthenticationApi().MFAValidateGoogleAuthCode(googleAuthenticatorCode, secondFactorAuthenticationToken, fields, smsTemplate2FA); +var apiResponse = new MultiFactorAuthenticationApi().MFAValidateGoogleAuthCode(googleAuthenticatorCode, secondFactorAuthenticationToken, fields, smsTemplate2FA).Result; ``` @@ -2098,7 +2098,7 @@ BackupCode ="<BackupCode>" }; //Required var secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required string fields = null; //Optional -var apiResponse = new MultiFactorAuthenticationApi().MFAValidateBackupCode(multiFactorAuthModelByBackupCode, secondFactorAuthenticationToken, fields); +var apiResponse = new MultiFactorAuthenticationApi().MFAValidateBackupCode(multiFactorAuthModelByBackupCode, secondFactorAuthenticationToken, fields).Result; ``` @@ -2112,7 +2112,7 @@ This API is used to update (if configured) the phone number used for Multi-facto var phoneNo2FA = "phoneNo2FA"; //Required var secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required var smsTemplate2FA = "smsTemplate2FA"; //Optional -var apiResponse = new MultiFactorAuthenticationApi().MFAUpdatePhoneNumber(phoneNo2FA, secondFactorAuthenticationToken, smsTemplate2FA); +var apiResponse = new MultiFactorAuthenticationApi().MFAUpdatePhoneNumber(phoneNo2FA, secondFactorAuthenticationToken, smsTemplate2FA).Result; ``` @@ -2131,7 +2131,7 @@ var loginUrl = "loginUrl"; //Optional var smsTemplate = "smsTemplate"; //Optional var smsTemplate2FA = "smsTemplate2FA"; //Optional var verificationUrl = "verificationUrl"; //Optional -var apiResponse = new MultiFactorAuthenticationApi().MFALoginByEmail(email, password, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl); +var apiResponse = new MultiFactorAuthenticationApi().MFALoginByEmail(email, password, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl).Result; ``` @@ -2150,7 +2150,7 @@ var loginUrl = "loginUrl"; //Optional var smsTemplate = "smsTemplate"; //Optional var smsTemplate2FA = "smsTemplate2FA"; //Optional var verificationUrl = "verificationUrl"; //Optional -var apiResponse = new MultiFactorAuthenticationApi().MFALoginByUserName(password, username, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl); +var apiResponse = new MultiFactorAuthenticationApi().MFALoginByUserName(password, username, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl).Result; ``` @@ -2169,7 +2169,7 @@ var loginUrl = "loginUrl"; //Optional var smsTemplate = "smsTemplate"; //Optional var smsTemplate2FA = "smsTemplate2FA"; //Optional var verificationUrl = "verificationUrl"; //Optional -var apiResponse = new MultiFactorAuthenticationApi().MFALoginByPhone(password, phone, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl); +var apiResponse = new MultiFactorAuthenticationApi().MFALoginByPhone(password, phone, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl).Result; ``` @@ -2182,7 +2182,7 @@ This API is used to configure the Multi-factor authentication after login by usi var accessToken = "accessToken"; //Required var smsTemplate2FA = "smsTemplate2FA"; //Optional -var apiResponse = new MultiFactorAuthenticationApi().MFAConfigureByAccessToken(accessToken, smsTemplate2FA); +var apiResponse = new MultiFactorAuthenticationApi().MFAConfigureByAccessToken(accessToken, smsTemplate2FA).Result; ``` @@ -2194,7 +2194,7 @@ This API is used to get a set of backup codes via access_token to allow the user ``` var accessToken = "accessToken"; //Required -var apiResponse = new MultiFactorAuthenticationApi().MFABackupCodeByAccessToken(accessToken); +var apiResponse = new MultiFactorAuthenticationApi().MFABackupCodeByAccessToken(accessToken).Result; ``` @@ -2206,7 +2206,7 @@ API is used to reset the backup codes on a given account via the access_token. T ``` var accessToken = "accessToken"; //Required -var apiResponse = new MultiFactorAuthenticationApi().MFAResetBackupCodeByAccessToken(accessToken); +var apiResponse = new MultiFactorAuthenticationApi().MFAResetBackupCodeByAccessToken(accessToken).Result; ``` @@ -2219,7 +2219,7 @@ This API is used to resending the verification OTP to the provided phone number var secondFactorAuthenticationToken = "secondFactorAuthenticationToken"; //Required var smsTemplate2FA = "smsTemplate2FA"; //Optional -var apiResponse = new MultiFactorAuthenticationApi().MFAResendOTP(secondFactorAuthenticationToken, smsTemplate2FA); +var apiResponse = new MultiFactorAuthenticationApi().MFAResendOTP(secondFactorAuthenticationToken, smsTemplate2FA).Result; ``` @@ -2231,7 +2231,7 @@ This API is used to reset the backup codes on a given account via the UID. This ``` var uid = "uid"; //Required -var apiResponse = new MultiFactorAuthenticationApi().MFABackupCodeByUid(uid); +var apiResponse = new MultiFactorAuthenticationApi().MFABackupCodeByUid(uid).Result; ``` @@ -2243,7 +2243,7 @@ This API is used to reset the backup codes on a given account via the UID. This ``` var uid = "uid"; //Required -var apiResponse = new MultiFactorAuthenticationApi().MFAResetBackupCodeByUid(uid); +var apiResponse = new MultiFactorAuthenticationApi().MFAResetBackupCodeByUid(uid).Result; ``` @@ -2256,7 +2256,7 @@ This API Resets the Google Authenticator configurations on a given account via t var accessToken = "accessToken"; //Required var googleAuthenticator = true; //Required -var apiResponse = new MultiFactorAuthenticationApi().MFAResetGoogleAuthByToken(accessToken, googleAuthenticator); +var apiResponse = new MultiFactorAuthenticationApi().MFAResetGoogleAuthByToken(accessToken, googleAuthenticator).Result; ``` @@ -2269,7 +2269,7 @@ This API resets the SMS Authenticator configurations on a given account via the var accessToken = "accessToken"; //Required var otpAuthenticator = true; //Required -var apiResponse = new MultiFactorAuthenticationApi().MFAResetSMSAuthByToken(accessToken, otpAuthenticator); +var apiResponse = new MultiFactorAuthenticationApi().MFAResetSMSAuthByToken(accessToken, otpAuthenticator).Result; ``` @@ -2282,7 +2282,7 @@ This API resets the SMS Authenticator configurations on a given account via the var otpAuthenticator = true; //Required var uid = "uid"; //Required -var apiResponse = new MultiFactorAuthenticationApi().MFAResetSMSAuthenticatorByUid(otpAuthenticator, uid); +var apiResponse = new MultiFactorAuthenticationApi().MFAResetSMSAuthenticatorByUid(otpAuthenticator, uid).Result; ``` @@ -2295,7 +2295,7 @@ This API resets the Google Authenticator configurations on a given account via t var googleAuthenticator = true; //Required var uid = "uid"; //Required -var apiResponse = new MultiFactorAuthenticationApi().MFAResetGoogleAuthenticatorByUid(googleAuthenticator, uid); +var apiResponse = new MultiFactorAuthenticationApi().MFAResetGoogleAuthenticatorByUid(googleAuthenticator, uid).Result; ``` @@ -2336,7 +2336,7 @@ ResetPINByResetToken resetPINByResetToken = new ResetPINByResetToken{ PIN ="<PIN>", ResetToken ="<ResetToken>" }; //Required -var apiResponse = new PINAuthenticationApi().ResetPINByResetToken(resetPINByResetToken); +var apiResponse = new PINAuthenticationApi().ResetPINByResetToken(resetPINByResetToken).Result; ``` @@ -2354,7 +2354,7 @@ SecurityAnswer = new Dictionary<String,String>{ ["QuestionID"] = "Answer" } }; //Required -var apiResponse = new PINAuthenticationApi().ResetPINByEmailAndSecurityAnswer(resetPINBySecurityQuestionAnswerAndEmailModel); +var apiResponse = new PINAuthenticationApi().ResetPINByEmailAndSecurityAnswer(resetPINBySecurityQuestionAnswerAndEmailModel).Result; ``` @@ -2372,7 +2372,7 @@ SecurityAnswer = new Dictionary<String,String>{ }, Username ="<Username>" }; //Required -var apiResponse = new PINAuthenticationApi().ResetPINByUsernameAndSecurityAnswer(resetPINBySecurityQuestionAnswerAndUsernameModel); +var apiResponse = new PINAuthenticationApi().ResetPINByUsernameAndSecurityAnswer(resetPINBySecurityQuestionAnswerAndUsernameModel).Result; ``` @@ -2390,7 +2390,7 @@ SecurityAnswer = new Dictionary<String,String>{ ["QuestionID"] = "Answer" } }; //Required -var apiResponse = new PINAuthenticationApi().ResetPINByPhoneAndSecurityAnswer(resetPINBySecurityQuestionAnswerAndPhoneModel); +var apiResponse = new PINAuthenticationApi().ResetPINByPhoneAndSecurityAnswer(resetPINBySecurityQuestionAnswerAndPhoneModel).Result; ``` @@ -2406,7 +2406,7 @@ ChangePINModel changePINModel = new ChangePINModel{ NewPIN ="<NewPIN>", OldPIN ="<OldPIN>" }; //Required -var apiResponse = new PINAuthenticationApi().ChangePINByAccessToken(accessToken, changePINModel); +var apiResponse = new PINAuthenticationApi().ChangePINByAccessToken(accessToken, changePINModel).Result; ``` @@ -2422,7 +2422,7 @@ Otp ="<Otp>", Phone ="<Phone>", PIN ="<PIN>" }; //Required -var apiResponse = new PINAuthenticationApi().ResetPINByPhoneAndOtp(resetPINByPhoneAndOTPModel); +var apiResponse = new PINAuthenticationApi().ResetPINByPhoneAndOtp(resetPINByPhoneAndOTPModel).Result; ``` @@ -2438,7 +2438,7 @@ Email ="<Email>", Otp ="<Otp>", PIN ="<PIN>" }; //Required -var apiResponse = new PINAuthenticationApi().ResetPINByEmailAndOtp(resetPINByEmailAndOtpModel); +var apiResponse = new PINAuthenticationApi().ResetPINByEmailAndOtp(resetPINByEmailAndOtpModel).Result; ``` @@ -2454,7 +2454,7 @@ Otp ="<Otp>", PIN ="<PIN>", Username ="<Username>" }; //Required -var apiResponse = new PINAuthenticationApi().ResetPINByUsernameAndOtp(resetPINByUsernameAndOtpModel); +var apiResponse = new PINAuthenticationApi().ResetPINByUsernameAndOtp(resetPINByUsernameAndOtpModel).Result; ``` @@ -2469,7 +2469,7 @@ LoginByPINModel loginByPINModel = new LoginByPINModel{ PIN ="<PIN>" }; //Required var sessionToken = "sessionToken"; //Required -var apiResponse = new PINAuthenticationApi().PINLogin(loginByPINModel, sessionToken); +var apiResponse = new PINAuthenticationApi().PINLogin(loginByPINModel, sessionToken).Result; ``` @@ -2485,7 +2485,7 @@ Email ="<Email>" }; //Required var emailTemplate = "emailTemplate"; //Optional var resetPINUrl = "resetPINUrl"; //Optional -var apiResponse = new PINAuthenticationApi().SendForgotPINEmailByEmail(forgotPINLinkByEmailModel, emailTemplate, resetPINUrl); +var apiResponse = new PINAuthenticationApi().SendForgotPINEmailByEmail(forgotPINLinkByEmailModel, emailTemplate, resetPINUrl).Result; ``` @@ -2501,7 +2501,7 @@ UserName ="<UserName>" }; //Required var emailTemplate = "emailTemplate"; //Optional var resetPINUrl = "resetPINUrl"; //Optional -var apiResponse = new PINAuthenticationApi().SendForgotPINEmailByUsername(forgotPINLinkByUserNameModel, emailTemplate, resetPINUrl); +var apiResponse = new PINAuthenticationApi().SendForgotPINEmailByUsername(forgotPINLinkByUserNameModel, emailTemplate, resetPINUrl).Result; ``` @@ -2516,7 +2516,7 @@ ForgotPINOtpByPhoneModel forgotPINOtpByPhoneModel = new ForgotPINOtpByPhoneModel Phone ="<Phone>" }; //Required var smsTemplate = "smsTemplate"; //Optional -var apiResponse = new PINAuthenticationApi().SendForgotPINSMSByPhone(forgotPINOtpByPhoneModel, smsTemplate); +var apiResponse = new PINAuthenticationApi().SendForgotPINSMSByPhone(forgotPINOtpByPhoneModel, smsTemplate).Result; ``` @@ -2531,7 +2531,7 @@ PINRequiredModel pinRequiredModel = new PINRequiredModel{ PIN ="<PIN>" }; //Required var pinAuthToken = "pinAuthToken"; //Required -var apiResponse = new PINAuthenticationApi().SetPINByPinAuthToken(pinRequiredModel, pinAuthToken); +var apiResponse = new PINAuthenticationApi().SetPINByPinAuthToken(pinRequiredModel, pinAuthToken).Result; ``` @@ -2543,7 +2543,7 @@ This API is used to invalidate pin session token. [More Info](https://www.loginr ``` var sessionToken = "sessionToken"; //Required -var apiResponse = new PINAuthenticationApi().InValidatePinSessionToken(sessionToken); +var apiResponse = new PINAuthenticationApi().InValidatePinSessionToken(sessionToken).Result; ``` @@ -2579,7 +2579,7 @@ var accessToken = "accessToken"; //Required ReauthByOtpModel reauthByOtpModel = new ReauthByOtpModel{ Otp ="<Otp>" }; //Required -var apiResponse = new ReAuthenticationApi().MFAReAuthenticateByOTP(accessToken, reauthByOtpModel); +var apiResponse = new ReAuthenticationApi().MFAReAuthenticateByOTP(accessToken, reauthByOtpModel).Result; ``` @@ -2594,7 +2594,7 @@ var accessToken = "accessToken"; //Required ReauthByBackupCodeModel reauthByBackupCodeModel = new ReauthByBackupCodeModel{ BackupCode ="<BackupCode>" }; //Required -var apiResponse = new ReAuthenticationApi().MFAReAuthenticateByBackupCode(accessToken, reauthByBackupCodeModel); +var apiResponse = new ReAuthenticationApi().MFAReAuthenticateByBackupCode(accessToken, reauthByBackupCodeModel).Result; ``` @@ -2609,7 +2609,7 @@ var accessToken = "accessToken"; //Required ReauthByGoogleAuthenticatorCodeModel reauthByGoogleAuthenticatorCodeModel = new ReauthByGoogleAuthenticatorCodeModel{ GoogleAuthenticatorCode ="<GoogleAuthenticatorCode>" }; //Required -var apiResponse = new ReAuthenticationApi().MFAReAuthenticateByGoogleAuth(accessToken, reauthByGoogleAuthenticatorCodeModel); +var apiResponse = new ReAuthenticationApi().MFAReAuthenticateByGoogleAuth(accessToken, reauthByGoogleAuthenticatorCodeModel).Result; ``` @@ -2625,7 +2625,7 @@ PasswordEventBasedAuthModelWithLockout passwordEventBasedAuthModelWithLockout = Password ="<Password>" }; //Required var smsTemplate2FA = "smsTemplate2FA"; //Optional -var apiResponse = new ReAuthenticationApi().MFAReAuthenticateByPassword(accessToken, passwordEventBasedAuthModelWithLockout, smsTemplate2FA); +var apiResponse = new ReAuthenticationApi().MFAReAuthenticateByPassword(accessToken, passwordEventBasedAuthModelWithLockout, smsTemplate2FA).Result; ``` @@ -2641,7 +2641,7 @@ PINAuthEventBasedAuthModelWithLockout pinAuthEventBasedAuthModelWithLockout = ne PIN ="<PIN>" }; //Required var smsTemplate2FA = "smsTemplate2FA"; //Optional -var apiResponse = new ReAuthenticationApi().VerifyPINAuthentication(accessToken, pinAuthEventBasedAuthModelWithLockout, smsTemplate2FA); +var apiResponse = new ReAuthenticationApi().VerifyPINAuthentication(accessToken, pinAuthEventBasedAuthModelWithLockout, smsTemplate2FA).Result; ``` @@ -2656,7 +2656,7 @@ EventBasedMultiFactorToken eventBasedMultiFactorToken = new EventBasedMultiFacto SecondFactorValidationToken ="<SecondFactorValidationToken>" }; //Required var uid = "uid"; //Required -var apiResponse = new ReAuthenticationApi().VerifyMultiFactorOtpReauthentication(eventBasedMultiFactorToken, uid); +var apiResponse = new ReAuthenticationApi().VerifyMultiFactorOtpReauthentication(eventBasedMultiFactorToken, uid).Result; ``` @@ -2671,7 +2671,7 @@ EventBasedMultiFactorToken eventBasedMultiFactorToken = new EventBasedMultiFacto SecondFactorValidationToken ="<SecondFactorValidationToken>" }; //Required var uid = "uid"; //Required -var apiResponse = new ReAuthenticationApi().VerifyMultiFactorPasswordReauthentication(eventBasedMultiFactorToken, uid); +var apiResponse = new ReAuthenticationApi().VerifyMultiFactorPasswordReauthentication(eventBasedMultiFactorToken, uid).Result; ``` @@ -2686,7 +2686,7 @@ EventBasedMultiFactorToken eventBasedMultiFactorToken = new EventBasedMultiFacto SecondFactorValidationToken ="<SecondFactorValidationToken>" }; //Required var uid = "uid"; //Required -var apiResponse = new ReAuthenticationApi().VerifyMultiFactorPINReauthentication(eventBasedMultiFactorToken, uid); +var apiResponse = new ReAuthenticationApi().VerifyMultiFactorPINReauthentication(eventBasedMultiFactorToken, uid).Result; ``` @@ -2699,7 +2699,7 @@ This API is used to trigger the Multi-Factor Autentication workflow for the prov var accessToken = "accessToken"; //Required var smsTemplate2FA = "smsTemplate2FA"; //Optional -var apiResponse = new ReAuthenticationApi().MFAReAuthenticate(accessToken, smsTemplate2FA); +var apiResponse = new ReAuthenticationApi().MFAReAuthenticate(accessToken, smsTemplate2FA).Result; ``` @@ -2736,7 +2736,7 @@ ConsentOptionId ="<ConsentOptionId>", IsAccepted = true }} }; //Required -var apiResponse = new ConsentManagementApi().UpdateConsentProfileByAccessToken(accessToken, consentUpdateModel); +var apiResponse = new ConsentManagementApi().UpdateConsentProfileByAccessToken(accessToken, consentUpdateModel).Result; ``` @@ -2760,7 +2760,7 @@ Event ="<Event>", IsCustom = true }} }; //Required -var apiResponse = new ConsentManagementApi().SubmitConsentByConsentToken(consentToken, consentSubmitModel); +var apiResponse = new ConsentManagementApi().SubmitConsentByConsentToken(consentToken, consentSubmitModel).Result; ``` @@ -2784,7 +2784,7 @@ Event ="<Event>", IsCustom = true }} }; //Required -var apiResponse = new ConsentManagementApi().SubmitConsentByAccessToken(accessToken, consentSubmitModel); +var apiResponse = new ConsentManagementApi().SubmitConsentByAccessToken(accessToken, consentSubmitModel).Result; ``` @@ -2796,7 +2796,7 @@ This API is used to get the Consent logs of the user. [More Info](https://www.lo ``` var uid = "uid"; //Required -var apiResponse = new ConsentManagementApi().GetConsentLogsByUid(uid); +var apiResponse = new ConsentManagementApi().GetConsentLogsByUid(uid).Result; ``` @@ -2808,7 +2808,7 @@ This API is used to fetch consent logs. [More Info](https://www.loginradius.com/ ``` var accessToken = "accessToken"; //Required -var apiResponse = new ConsentManagementApi().GetConsentLogs(accessToken); +var apiResponse = new ConsentManagementApi().GetConsentLogs(accessToken).Result; ``` @@ -2822,7 +2822,7 @@ This API is used to check if consent is submitted for a particular event or not. var accessToken = "accessToken"; //Required var @event = "@event"; //Required var isCustom = true; //Required -var apiResponse = new ConsentManagementApi().VerifyConsentByAccessToken(accessToken, @event, isCustom); +var apiResponse = new ConsentManagementApi().VerifyConsentByAccessToken(accessToken, @event, isCustom).Result; ``` @@ -2851,7 +2851,7 @@ This API verifies the provided token for Smart Login [More Info](https://www.log var verificationToken = "verificationToken"; //Required var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional -var apiResponse = new SmartLoginApi().SmartLoginTokenVerification(verificationToken, welcomeEmailTemplate); +var apiResponse = new SmartLoginApi().SmartLoginTokenVerification(verificationToken, welcomeEmailTemplate).Result; ``` @@ -2867,7 +2867,7 @@ var email = "email"; //Required var redirectUrl = "redirectUrl"; //Optional var smartLoginEmailTemplate = "smartLoginEmailTemplate"; //Optional var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional -var apiResponse = new SmartLoginApi().SmartLoginByEmail(clientGuid, email, redirectUrl, smartLoginEmailTemplate, welcomeEmailTemplate); +var apiResponse = new SmartLoginApi().SmartLoginByEmail(clientGuid, email, redirectUrl, smartLoginEmailTemplate, welcomeEmailTemplate).Result; ``` @@ -2883,7 +2883,7 @@ var username = "username"; //Required var redirectUrl = "redirectUrl"; //Optional var smartLoginEmailTemplate = "smartLoginEmailTemplate"; //Optional var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional -var apiResponse = new SmartLoginApi().SmartLoginByUserName(clientGuid, username, redirectUrl, smartLoginEmailTemplate, welcomeEmailTemplate); +var apiResponse = new SmartLoginApi().SmartLoginByUserName(clientGuid, username, redirectUrl, smartLoginEmailTemplate, welcomeEmailTemplate).Result; ``` @@ -2896,7 +2896,7 @@ This API is used to check if the Smart Login link has been clicked or not [More var clientGuid = "clientGuid"; //Required string fields = null; //Optional -var apiResponse = new SmartLoginApi().SmartLoginPing(clientGuid, fields); +var apiResponse = new SmartLoginApi().SmartLoginPing(clientGuid, fields).Result; ``` @@ -2928,7 +2928,7 @@ var otp = "otp"; //Required var phone = "phone"; //Required string fields = null; //Optional var smsTemplate = "smsTemplate"; //Optional -var apiResponse = new OneTouchLoginApi().OneTouchLoginOTPVerification(otp, phone, fields, smsTemplate); +var apiResponse = new OneTouchLoginApi().OneTouchLoginOTPVerification(otp, phone, fields, smsTemplate).Result; ``` @@ -2947,7 +2947,7 @@ G_recaptcha_response ="<G-recaptcha-response>" var oneTouchLoginEmailTemplate = "oneTouchLoginEmailTemplate"; //Optional var redirecturl = "redirecturl"; //Optional var welcomeemailtemplate = "welcomeemailtemplate"; //Optional -var apiResponse = new OneTouchLoginApi().OneTouchLoginByEmail(oneTouchLoginByEmailModel, oneTouchLoginEmailTemplate, redirecturl, welcomeemailtemplate); +var apiResponse = new OneTouchLoginApi().OneTouchLoginByEmail(oneTouchLoginByEmailModel, oneTouchLoginEmailTemplate, redirecturl, welcomeemailtemplate).Result; ``` @@ -2963,7 +2963,7 @@ G_recaptcha_response ="<G-recaptcha-response>", Phone ="<Phone>" }; //Required var smsTemplate = "smsTemplate"; //Optional -var apiResponse = new OneTouchLoginApi().OneTouchLoginByPhone(oneTouchLoginByPhoneModel, smsTemplate); +var apiResponse = new OneTouchLoginApi().OneTouchLoginByPhone(oneTouchLoginByPhoneModel, smsTemplate).Result; ``` @@ -2976,7 +2976,7 @@ This API verifies the provided token for One Touch Login [More Info](https://www var verificationToken = "verificationToken"; //Required var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional -var apiResponse = new OneTouchLoginApi().OneTouchEmailVerification(verificationToken, welcomeEmailTemplate); +var apiResponse = new OneTouchLoginApi().OneTouchEmailVerification(verificationToken, welcomeEmailTemplate).Result; ``` @@ -2989,7 +2989,7 @@ This API is used to check if the One Touch Login link has been clicked or not. [ var clientGuid = "clientGuid"; //Required string fields = null; //Optional -var apiResponse = new OneTouchLoginApi().OneTouchLoginPing(clientGuid, fields); +var apiResponse = new OneTouchLoginApi().OneTouchLoginPing(clientGuid, fields).Result; ``` @@ -3023,7 +3023,7 @@ Phone ="<Phone>" }; //Required string fields = null; //Optional var smsTemplate = "smsTemplate"; //Optional -var apiResponse = new PasswordLessLoginApi().PasswordlessLoginPhoneVerification(passwordLessLoginOtpModel, fields, smsTemplate); +var apiResponse = new PasswordLessLoginApi().PasswordlessLoginPhoneVerification(passwordLessLoginOtpModel, fields, smsTemplate).Result; ``` @@ -3036,7 +3036,7 @@ API can be used to send a One-time Passcode (OTP) provided that the account has var phone = "phone"; //Required var smsTemplate = "smsTemplate"; //Optional -var apiResponse = new PasswordLessLoginApi().PasswordlessLoginByPhone(phone, smsTemplate); +var apiResponse = new PasswordLessLoginApi().PasswordlessLoginByPhone(phone, smsTemplate).Result; ``` @@ -3050,7 +3050,7 @@ This API is used to send a Passwordless Login verification link to the provided var email = "email"; //Required var passwordLessLoginTemplate = "passwordLessLoginTemplate"; //Optional var verificationUrl = "verificationUrl"; //Optional -var apiResponse = new PasswordLessLoginApi().PasswordlessLoginByEmail(email, passwordLessLoginTemplate, verificationUrl); +var apiResponse = new PasswordLessLoginApi().PasswordlessLoginByEmail(email, passwordLessLoginTemplate, verificationUrl).Result; ``` @@ -3064,7 +3064,7 @@ This API is used to send a Passwordless Login Verification Link to a customer by var username = "username"; //Required var passwordLessLoginTemplate = "passwordLessLoginTemplate"; //Optional var verificationUrl = "verificationUrl"; //Optional -var apiResponse = new PasswordLessLoginApi().PasswordlessLoginByUserName(username, passwordLessLoginTemplate, verificationUrl); +var apiResponse = new PasswordLessLoginApi().PasswordlessLoginByUserName(username, passwordLessLoginTemplate, verificationUrl).Result; ``` @@ -3078,7 +3078,7 @@ This API is used to verify the Passwordless Login verification link. Note: If yo var verificationToken = "verificationToken"; //Required string fields = null; //Optional var welcomeEmailTemplate = "welcomeEmailTemplate"; //Optional -var apiResponse = new PasswordLessLoginApi().PasswordlessLoginVerification(verificationToken, fields, welcomeEmailTemplate); +var apiResponse = new PasswordLessLoginApi().PasswordlessLoginVerification(verificationToken, fields, welcomeEmailTemplate).Result; ``` @@ -3099,7 +3099,7 @@ This API is used to get the configurations which are set in the LoginRadius Dash ``` -var apiResponse = new ConfigurationApi().GetConfigurations(); +var apiResponse = new ConfigurationApi().GetConfigurations().Result; ``` <h6 id="GetServerInfo-get-">Get Server Time (GET)</h6> @@ -3110,7 +3110,7 @@ This API allows you to query your LoginRadius account for basic server informati ``` var timeDifference = 0; //Optional -var apiResponse = new ConfigurationApi().GetServerInfo(timeDifference); +var apiResponse = new ConfigurationApi().GetServerInfo(timeDifference).Result; ``` @@ -3151,7 +3151,7 @@ AccountRolesModel accountRolesModel = new AccountRolesModel{ Roles = new List<String>{"Roles"} }; //Required var uid = "uid"; //Required -var apiResponse = new RoleApi().AssignRolesByUid(accountRolesModel, uid); +var apiResponse = new RoleApi().AssignRolesByUid(accountRolesModel, uid).Result; ``` @@ -3172,7 +3172,7 @@ Roles = new List<String>{"Roles"} }} }; //Required var uid = "uid"; //Required -var apiResponse = new RoleApi().UpdateRoleContextByUid(accountRoleContextModel, uid); +var apiResponse = new RoleApi().UpdateRoleContextByUid(accountRoleContextModel, uid).Result; ``` @@ -3187,7 +3187,7 @@ PermissionsModel permissionsModel = new PermissionsModel{ Permissions = new List<String>{"Permissions"} }; //Required var role = "role"; //Required -var apiResponse = new RoleApi().AddRolePermissions(permissionsModel, role); +var apiResponse = new RoleApi().AddRolePermissions(permissionsModel, role).Result; ``` @@ -3207,7 +3207,7 @@ Permissions = new Dictionary<String,Boolean>{ } }} }; //Required -var apiResponse = new RoleApi().CreateRoles(rolesModel); +var apiResponse = new RoleApi().CreateRoles(rolesModel).Result; ``` @@ -3219,7 +3219,7 @@ API is used to retrieve all the assigned roles of a particular User. [More Info] ``` var uid = "uid"; //Required -var apiResponse = new RoleApi().GetRolesByUid(uid); +var apiResponse = new RoleApi().GetRolesByUid(uid).Result; ``` @@ -3231,7 +3231,7 @@ This API Gets the contexts that have been configured and the associated roles an ``` var uid = "uid"; //Required -var apiResponse = new RoleApi().GetRoleContextByUid(uid); +var apiResponse = new RoleApi().GetRoleContextByUid(uid).Result; ``` @@ -3243,7 +3243,7 @@ The API is used to retrieve role context by the context name. [More Info](https: ``` var contextName = "contextName"; //Required -var apiResponse = new RoleApi().GetRoleContextByContextName(contextName); +var apiResponse = new RoleApi().GetRoleContextByContextName(contextName).Result; ``` @@ -3254,7 +3254,7 @@ This API retrieves the complete list of created roles with permissions of your a ``` -var apiResponse = new RoleApi().GetRolesList(); +var apiResponse = new RoleApi().GetRolesList().Result; ``` @@ -3269,7 +3269,7 @@ AccountRolesModel accountRolesModel = new AccountRolesModel{ Roles = new List<String>{"Roles"} }; //Required var uid = "uid"; //Required -var apiResponse = new RoleApi().UnassignRolesByUid(accountRolesModel, uid); +var apiResponse = new RoleApi().UnassignRolesByUid(accountRolesModel, uid).Result; ``` @@ -3282,7 +3282,7 @@ This API Deletes the specified Role Context [More Info](https://www.loginradius. var contextName = "contextName"; //Required var uid = "uid"; //Required -var apiResponse = new RoleApi().DeleteRoleContextByUid(contextName, uid); +var apiResponse = new RoleApi().DeleteRoleContextByUid(contextName, uid).Result; ``` @@ -3298,7 +3298,7 @@ RoleContextRemoveRoleModel roleContextRemoveRoleModel = new RoleContextRemoveRol Roles = new List<String>{"Roles"} }; //Required var uid = "uid"; //Required -var apiResponse = new RoleApi().DeleteRolesFromRoleContextByUid(contextName, roleContextRemoveRoleModel, uid); +var apiResponse = new RoleApi().DeleteRolesFromRoleContextByUid(contextName, roleContextRemoveRoleModel, uid).Result; ``` @@ -3314,7 +3314,7 @@ RoleContextAdditionalPermissionRemoveRoleModel roleContextAdditionalPermissionRe AdditionalPermissions = new List<String>{"AdditionalPermissions"} }; //Required var uid = "uid"; //Required -var apiResponse = new RoleApi().DeleteAdditionalPermissionFromRoleContextByUid(contextName, roleContextAdditionalPermissionRemoveRoleModel, uid); +var apiResponse = new RoleApi().DeleteAdditionalPermissionFromRoleContextByUid(contextName, roleContextAdditionalPermissionRemoveRoleModel, uid).Result; ``` @@ -3326,7 +3326,7 @@ This API is used to delete the role. [More Info](https://www.loginradius.com/doc ``` var role = "role"; //Required -var apiResponse = new RoleApi().DeleteRole(role); +var apiResponse = new RoleApi().DeleteRole(role).Result; ``` @@ -3341,7 +3341,7 @@ PermissionsModel permissionsModel = new PermissionsModel{ Permissions = new List<String>{"Permissions"} }; //Required var role = "role"; //Required -var apiResponse = new RoleApi().RemoveRolePermissions(permissionsModel, role); +var apiResponse = new RoleApi().RemoveRolePermissions(permissionsModel, role).Result; ``` @@ -3378,7 +3378,7 @@ Type ="<Type>", Value ="<Value>" }; //Required var recordId = "recordId"; //Required -var apiResponse = new CustomRegistrationDataApi().UpdateRegistrationData(registrationDataUpdateModel, recordId); +var apiResponse = new CustomRegistrationDataApi().UpdateRegistrationData(registrationDataUpdateModel, recordId).Result; ``` @@ -3391,7 +3391,7 @@ This API allows you to validate code for a particular dropdown member. [More Inf var code = "code"; //Required var recordId = "recordId"; //Required -var apiResponse = new CustomRegistrationDataApi().ValidateRegistrationDataCode(code, recordId); +var apiResponse = new CustomRegistrationDataApi().ValidateRegistrationDataCode(code, recordId).Result; ``` @@ -3413,7 +3413,7 @@ Type ="<Type>", Value ="<Value>" }} }; //Required -var apiResponse = new CustomRegistrationDataApi().AddRegistrationData(registrationDataCreateModelList); +var apiResponse = new CustomRegistrationDataApi().AddRegistrationData(registrationDataCreateModelList).Result; ``` @@ -3428,7 +3428,7 @@ var type = "type"; //Required var limit = 0; //Optional var parentId = "parentId"; //Optional var skip = 0; //Optional -var apiResponse = new CustomRegistrationDataApi().AuthGetRegistrationData(type, limit, parentId, skip); +var apiResponse = new CustomRegistrationDataApi().AuthGetRegistrationData(type, limit, parentId, skip).Result; ``` @@ -3443,7 +3443,7 @@ var type = "type"; //Required var limit = 0; //Optional var parentId = "parentId"; //Optional var skip = 0; //Optional -var apiResponse = new CustomRegistrationDataApi().GetRegistrationData(type, limit, parentId, skip); +var apiResponse = new CustomRegistrationDataApi().GetRegistrationData(type, limit, parentId, skip).Result; ``` @@ -3455,7 +3455,7 @@ This API allows you to delete an item from a dropdown list. [More Info](https:// ``` var recordId = "recordId"; //Required -var apiResponse = new CustomRegistrationDataApi().DeleteRegistrationData(recordId); +var apiResponse = new CustomRegistrationDataApi().DeleteRegistrationData(recordId).Result; ``` @@ -3467,7 +3467,7 @@ This API allows you to delete all records contained in a datasource. [More Info] ``` var type = "type"; //Required -var apiResponse = new CustomRegistrationDataApi().DeleteAllRecordsByDataSource(type); +var apiResponse = new CustomRegistrationDataApi().DeleteAllRecordsByDataSource(type).Result; ``` @@ -3514,7 +3514,7 @@ var rbaOneclickEmailTemplate = "rbaOneclickEmailTemplate"; //Optional var rbaOTPSmsTemplate = "rbaOTPSmsTemplate"; //Optional var smsTemplate = "smsTemplate"; //Optional var verificationUrl = "verificationUrl"; //Optional -var apiResponse = new RiskBasedAuthenticationApi().RBALoginByEmail(emailAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl); +var apiResponse = new RiskBasedAuthenticationApi().RBALoginByEmail(emailAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl).Result; ``` @@ -3546,7 +3546,7 @@ var rbaOneclickEmailTemplate = "rbaOneclickEmailTemplate"; //Optional var rbaOTPSmsTemplate = "rbaOTPSmsTemplate"; //Optional var smsTemplate = "smsTemplate"; //Optional var verificationUrl = "verificationUrl"; //Optional -var apiResponse = new RiskBasedAuthenticationApi().RBALoginByUserName(userNameAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl); +var apiResponse = new RiskBasedAuthenticationApi().RBALoginByUserName(userNameAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl).Result; ``` @@ -3578,7 +3578,7 @@ var rbaOneclickEmailTemplate = "rbaOneclickEmailTemplate"; //Optional var rbaOTPSmsTemplate = "rbaOTPSmsTemplate"; //Optional var smsTemplate = "smsTemplate"; //Optional var verificationUrl = "verificationUrl"; //Optional -var apiResponse = new RiskBasedAuthenticationApi().RBALoginByPhone(phoneAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl); +var apiResponse = new RiskBasedAuthenticationApi().RBALoginByPhone(phoneAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl).Result; ``` @@ -3603,7 +3603,7 @@ This API allows you to generate SOTT with a given expiration time. [More Info](h ``` var timeDifference = 0; //Optional -var apiResponse = new SottApi().GenerateSott(timeDifference); +var apiResponse = new SottApi().GenerateSott(timeDifference).Result; ``` @@ -3635,7 +3635,7 @@ The API is used to get LoginRadius access token by sending Facebook's access tok ``` var fbAccessToken = "fbAccessToken"; //Required -var apiResponse = new NativeSocialApi().GetAccessTokenByFacebookAccessToken(fbAccessToken); +var apiResponse = new NativeSocialApi().GetAccessTokenByFacebookAccessToken(fbAccessToken).Result; ``` @@ -3648,7 +3648,7 @@ The API is used to get LoginRadius access token by sending Twitter's access toke var twAccessToken = "twAccessToken"; //Required var twTokenSecret = "twTokenSecret"; //Required -var apiResponse = new NativeSocialApi().GetAccessTokenByTwitterAccessToken(twAccessToken, twTokenSecret); +var apiResponse = new NativeSocialApi().GetAccessTokenByTwitterAccessToken(twAccessToken, twTokenSecret).Result; ``` @@ -3662,7 +3662,7 @@ The API is used to get LoginRadius access token by sending Google's access token var googleAccessToken = "googleAccessToken"; //Required var clientId = "clientId"; //Optional var refreshToken = "refreshToken"; //Optional -var apiResponse = new NativeSocialApi().GetAccessTokenByGoogleAccessToken(googleAccessToken, clientId, refreshToken); +var apiResponse = new NativeSocialApi().GetAccessTokenByGoogleAccessToken(googleAccessToken, clientId, refreshToken).Result; ``` @@ -3674,7 +3674,7 @@ This API is used to Get LoginRadius Access Token using google jwt id token for g ``` var idToken = "idToken"; //Required -var apiResponse = new NativeSocialApi().GetAccessTokenByGoogleJWTAccessToken(idToken); +var apiResponse = new NativeSocialApi().GetAccessTokenByGoogleJWTAccessToken(idToken).Result; ``` @@ -3686,7 +3686,7 @@ The API is used to get LoginRadius access token by sending Linkedin's access tok ``` var lnAccessToken = "lnAccessToken"; //Required -var apiResponse = new NativeSocialApi().GetAccessTokenByLinkedinAccessToken(lnAccessToken); +var apiResponse = new NativeSocialApi().GetAccessTokenByLinkedinAccessToken(lnAccessToken).Result; ``` @@ -3698,7 +3698,7 @@ The API is used to get LoginRadius access token by sending Foursquare's access t ``` var fsAccessToken = "fsAccessToken"; //Required -var apiResponse = new NativeSocialApi().GetAccessTokenByFoursquareAccessToken(fsAccessToken); +var apiResponse = new NativeSocialApi().GetAccessTokenByFoursquareAccessToken(fsAccessToken).Result; ``` @@ -3710,7 +3710,7 @@ The API is used to get LoginRadius access token by sending Vkontakte's access to ``` var vkAccessToken = "vkAccessToken"; //Required -var apiResponse = new NativeSocialApi().GetAccessTokenByVkontakteAccessToken(vkAccessToken); +var apiResponse = new NativeSocialApi().GetAccessTokenByVkontakteAccessToken(vkAccessToken).Result; ``` @@ -3722,7 +3722,7 @@ The API is used to get LoginRadius access token by sending Google's AuthCode. It ``` var googleAuthcode = "googleAuthcode"; //Required -var apiResponse = new NativeSocialApi().GetAccessTokenByGoogleAuthCode(googleAuthcode); +var apiResponse = new NativeSocialApi().GetAccessTokenByGoogleAuthCode(googleAuthcode).Result; ``` @@ -3753,7 +3753,7 @@ WebHookSubscribeModel webHookSubscribeModel = new WebHookSubscribeModel{ Event ="<Event>", TargetUrl ="<TargetUrl>" }; //Required -var apiResponse = new WebHookApi().WebHookSubscribe(webHookSubscribeModel); +var apiResponse = new WebHookApi().WebHookSubscribe(webHookSubscribeModel).Result; ``` @@ -3765,7 +3765,7 @@ This API is used to fatch all the subscribed URLs, for particular event [More In ``` var @event = "@event"; //Required -var apiResponse = new WebHookApi().GetWebHookSubscribedURLs(@event); +var apiResponse = new WebHookApi().GetWebHookSubscribedURLs(@event).Result; ``` @@ -3776,7 +3776,7 @@ API can be used to test a subscribed WebHook. [More Info](https://www.loginradiu ``` -var apiResponse = new WebHookApi().WebhookTest(); +var apiResponse = new WebHookApi().WebhookTest().Result; ``` @@ -3791,12 +3791,32 @@ WebHookSubscribeModel webHookSubscribeModel = new WebHookSubscribeModel{ Event ="<Event>", TargetUrl ="<TargetUrl>" }; //Required -var apiResponse = new WebHookApi().WebHookUnsubscribe(webHookSubscribeModel); +var apiResponse = new WebHookApi().WebHookUnsubscribe(webHookSubscribeModel).Result; ``` +### JWT Token Validate +This is the inbuilt SDK JWT Token Validate method and we are using the JwtSecurityTokenHandler for this.The JwtSecurityTokenHandler class in the System.IdentityModel.Tokens.Jwt (opens new window)package will handle the low-level details of validating a JWT. +This method will return an instance of JwtSecurityToken if the token is valid. But in the case of any type error the method return System.Exception in the same class. + +Note:- This method is supported only .NET 45 or later / .NetStandard 2.0 or later + +``` +JwtValidationParameters jwtParameters = new JwtValidationParameters +{ + JwtToken = "", + Secret = "" +}; + +var jwt = new JwtTokenValidation().validateJwtToken(jwtParameters); + if(jwt.Error != null) { + + // write your code here + } + +``` diff --git a/Samples/dot-net-demo/dot-net-demo/Controllers/HomeController.cs b/Samples/dot-net-demo/dot-net-demo/Controllers/HomeController.cs index 7bde963..d1590e5 100644 --- a/Samples/dot-net-demo/dot-net-demo/Controllers/HomeController.cs +++ b/Samples/dot-net-demo/dot-net-demo/Controllers/HomeController.cs @@ -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) { @@ -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)); @@ -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)); @@ -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)); @@ -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) { @@ -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)); @@ -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) { @@ -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)); @@ -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) { @@ -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) { @@ -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)); } @@ -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)); @@ -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)); @@ -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) { @@ -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)); @@ -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)); @@ -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)); @@ -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)); @@ -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)); @@ -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)); @@ -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)); @@ -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) { @@ -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)); @@ -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)); @@ -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)); diff --git a/Source/.nuget/NuGet.Config b/Source/.nuget/NuGet.Config old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2.sln b/Source/LoginRadiusSDK.V2.sln old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/Api/Account/AccountApi.cs b/Source/LoginRadiusSDK.V2/Api/Account/AccountApi.cs index 722946a..d4ca650 100644 --- a/Source/LoginRadiusSDK.V2/Api/Account/AccountApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Account/AccountApi.cs @@ -12,6 +12,7 @@ using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; using LoginRadiusSDK.V2.Models.RequestModels; using LoginRadiusSDK.V2.Models.ResponseModels; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Account { @@ -27,7 +28,7 @@ public class AccountApi : LoginRadiusResource /// <returns>Response containing Definition for Complete profile data</returns> /// 18.15 - public ApiResponse<Identity> UpdateAccountByUid(object payload, string uid, + public async Task<ApiResponse<Identity>> UpdateAccountByUid(object payload, string uid, string fields = "", bool? nullSupport = null) { if (payload == null) @@ -54,7 +55,7 @@ public ApiResponse<Identity> UpdateAccountByUid(object payload, string uid, var resourcePath = $"identity/v2/manage/account/{uid}"; - return ConfigureAndExecute<Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(payload)); + return await ConfigureAndExecute<Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(payload)); } /// <summary> @@ -64,7 +65,7 @@ public ApiResponse<Identity> UpdateAccountByUid(object payload, string uid, /// <returns>Complete Policy History data</returns> /// 15.1.1 - public ApiResponse<PrivacyPolicyHistoryResponse> GetPrivacyPolicyHistoryByUid(string uid) + public async Task<ApiResponse<PrivacyPolicyHistoryResponse>> GetPrivacyPolicyHistoryByUid(string uid) { if (string.IsNullOrWhiteSpace(uid)) { @@ -78,7 +79,7 @@ public ApiResponse<PrivacyPolicyHistoryResponse> GetPrivacyPolicyHistoryByUid(st var resourcePath = $"identity/v2/manage/account/{uid}/privacypolicy/history"; - return ConfigureAndExecute<PrivacyPolicyHistoryResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<PrivacyPolicyHistoryResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to create an account in Cloud Storage. This API bypass the normal email verification process and manually creates the user. <br><br>In order to use this API, you need to format a JSON request body with all of the mandatory fields @@ -88,7 +89,7 @@ public ApiResponse<PrivacyPolicyHistoryResponse> GetPrivacyPolicyHistoryByUid(st /// <returns>Response containing Definition for Complete profile data</returns> /// 18.1 - public ApiResponse<Identity> CreateAccount(AccountCreateModel accountCreateModel, string fields = "") + public async Task<ApiResponse<Identity>> CreateAccount(AccountCreateModel accountCreateModel, string fields = "") { if (accountCreateModel == null) { @@ -106,7 +107,7 @@ public ApiResponse<Identity> CreateAccount(AccountCreateModel accountCreateModel var resourcePath = "identity/v2/manage/account"; - return ConfigureAndExecute<Identity>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(accountCreateModel)); + return await ConfigureAndExecute<Identity>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(accountCreateModel)); } /// <summary> /// This API is used to retrieve all of the profile data, associated with the specified account by email in Cloud Storage. @@ -116,7 +117,7 @@ public ApiResponse<Identity> CreateAccount(AccountCreateModel accountCreateModel /// <returns>Response containing Definition for Complete profile data</returns> /// 18.2 - public ApiResponse<Identity> GetAccountProfileByEmail(string email, string fields = "") + public async Task<ApiResponse<Identity>> GetAccountProfileByEmail(string email, string fields = "") { if (string.IsNullOrWhiteSpace(email)) { @@ -135,7 +136,7 @@ public ApiResponse<Identity> GetAccountProfileByEmail(string email, string field var resourcePath = "identity/v2/manage/account"; - return ConfigureAndExecute<Identity>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<Identity>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to retrieve all of the profile data associated with the specified account by user name in Cloud Storage. @@ -145,7 +146,7 @@ public ApiResponse<Identity> GetAccountProfileByEmail(string email, string field /// <returns>Response containing Definition for Complete profile data</returns> /// 18.3 - public ApiResponse<Identity> GetAccountProfileByUserName(string userName, string fields = "") + public async Task<ApiResponse<Identity>> GetAccountProfileByUserName(string userName, string fields = "") { if (string.IsNullOrWhiteSpace(userName)) { @@ -164,7 +165,7 @@ public ApiResponse<Identity> GetAccountProfileByUserName(string userName, string var resourcePath = "identity/v2/manage/account"; - return ConfigureAndExecute<Identity>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<Identity>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to retrieve all of the profile data, associated with the account by phone number in Cloud Storage. @@ -174,7 +175,7 @@ public ApiResponse<Identity> GetAccountProfileByUserName(string userName, string /// <returns>Response containing Definition for Complete profile data</returns> /// 18.4 - public ApiResponse<Identity> GetAccountProfileByPhone(string phone, string fields = "") + public async Task<ApiResponse<Identity>> GetAccountProfileByPhone(string phone, string fields = "") { if (string.IsNullOrWhiteSpace(phone)) { @@ -193,7 +194,7 @@ public ApiResponse<Identity> GetAccountProfileByPhone(string phone, string field var resourcePath = "identity/v2/manage/account"; - return ConfigureAndExecute<Identity>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<Identity>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to retrieve all of the profile data, associated with the account by uid in Cloud Storage. @@ -203,7 +204,7 @@ public ApiResponse<Identity> GetAccountProfileByPhone(string phone, string field /// <returns>Response containing Definition for Complete profile data</returns> /// 18.5 - public ApiResponse<Identity> GetAccountProfileByUid(string uid, string fields = "") + public async Task<ApiResponse<Identity>> GetAccountProfileByUid(string uid, string fields = "") { if (string.IsNullOrWhiteSpace(uid)) { @@ -221,7 +222,7 @@ public ApiResponse<Identity> GetAccountProfileByUid(string uid, string fields = var resourcePath = $"identity/v2/manage/account/{uid}"; - return ConfigureAndExecute<Identity>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<Identity>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to update the information of existing accounts in your Cloud Storage. See our Advanced API Usage section <a href='https://www.loginradius.com/docs/api/v2/customer-identity-api/advanced-api-usage/'>Here</a> for more capabilities. @@ -232,7 +233,7 @@ public ApiResponse<Identity> GetAccountProfileByUid(string uid, string fields = /// <returns>Response containing Definition for Complete profile data</returns> /// 18.15 - public ApiResponse<Identity> UpdateAccountByUid(AccountUserProfileUpdateModel accountUserProfileUpdateModel, string uid, + public async Task<ApiResponse<Identity>> UpdateAccountByUid(AccountUserProfileUpdateModel accountUserProfileUpdateModel, string uid, string fields = "") { if (accountUserProfileUpdateModel == null) @@ -255,7 +256,7 @@ public ApiResponse<Identity> UpdateAccountByUid(AccountUserProfileUpdateModel ac var resourcePath = $"identity/v2/manage/account/{uid}"; - return ConfigureAndExecute<Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(accountUserProfileUpdateModel)); + return await ConfigureAndExecute<Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(accountUserProfileUpdateModel)); } /// <summary> /// This API is used to update the PhoneId by using the Uid's. Admin can update the PhoneId's for both the verified and unverified profiles. It will directly replace the PhoneId and bypass the OTP verification process. @@ -266,7 +267,7 @@ public ApiResponse<Identity> UpdateAccountByUid(AccountUserProfileUpdateModel ac /// <returns>Response containing Definition for Complete profile data</returns> /// 18.16 - public ApiResponse<Identity> UpdatePhoneIDByUid(string phone, string uid, + public async Task<ApiResponse<Identity>> UpdatePhoneIDByUid(string phone, string uid, string fields = "") { if (string.IsNullOrWhiteSpace(phone)) @@ -294,7 +295,7 @@ public ApiResponse<Identity> UpdatePhoneIDByUid(string phone, string uid, var resourcePath = $"identity/v2/manage/account/{uid}/phoneid"; - return ConfigureAndExecute<Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API use to retrive the hashed password of a specified account in Cloud Storage. @@ -303,7 +304,7 @@ public ApiResponse<Identity> UpdatePhoneIDByUid(string phone, string uid, /// <returns>Response containing Definition for Complete PasswordHash data</returns> /// 18.17 - public ApiResponse<UserPasswordHash> GetAccountPasswordHashByUid(string uid) + public async Task<ApiResponse<UserPasswordHash>> GetAccountPasswordHashByUid(string uid) { if (string.IsNullOrWhiteSpace(uid)) { @@ -317,7 +318,7 @@ public ApiResponse<UserPasswordHash> GetAccountPasswordHashByUid(string uid) var resourcePath = $"identity/v2/manage/account/{uid}/password"; - return ConfigureAndExecute<UserPasswordHash>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<UserPasswordHash>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to set the password of an account in Cloud Storage. @@ -327,7 +328,7 @@ public ApiResponse<UserPasswordHash> GetAccountPasswordHashByUid(string uid) /// <returns>Response containing Definition for Complete PasswordHash data</returns> /// 18.18 - public ApiResponse<UserPasswordHash> SetAccountPasswordByUid(string password, string uid) + public async Task<ApiResponse<UserPasswordHash>> SetAccountPasswordByUid(string password, string uid) { if (string.IsNullOrWhiteSpace(password)) { @@ -350,7 +351,7 @@ public ApiResponse<UserPasswordHash> SetAccountPasswordByUid(string password, st var resourcePath = $"identity/v2/manage/account/{uid}/password"; - return ConfigureAndExecute<UserPasswordHash>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<UserPasswordHash>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API deletes the Users account and allows them to re-register for a new account. @@ -359,7 +360,7 @@ public ApiResponse<UserPasswordHash> SetAccountPasswordByUid(string password, st /// <returns>Response containing Definition of Delete Request</returns> /// 18.19 - public ApiResponse<DeleteResponse> DeleteAccountByUid(string uid) + public async Task<ApiResponse<DeleteResponse>> DeleteAccountByUid(string uid) { if (string.IsNullOrWhiteSpace(uid)) { @@ -373,7 +374,7 @@ public ApiResponse<DeleteResponse> DeleteAccountByUid(string uid) var resourcePath = $"identity/v2/manage/account/{uid}"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); } /// <summary> /// This API is used to invalidate the Email Verification status on an account. @@ -384,7 +385,7 @@ public ApiResponse<DeleteResponse> DeleteAccountByUid(string uid) /// <returns>Response containing Definition of Complete Validation data</returns> /// 18.20 - public ApiResponse<PostResponse> InvalidateAccountEmailVerification(string uid, string emailTemplate = "", + public async Task<ApiResponse<PostResponse>> InvalidateAccountEmailVerification(string uid, string emailTemplate = "", string verificationUrl = "") { if (string.IsNullOrWhiteSpace(uid)) @@ -407,7 +408,7 @@ public ApiResponse<PostResponse> InvalidateAccountEmailVerification(string uid, var resourcePath = $"identity/v2/manage/account/{uid}/invalidateemail"; - return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, null); + return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, null); } /// <summary> /// This API Returns a Forgot Password Token it can also be used to send a Forgot Password email to the customer. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' in the body. @@ -419,7 +420,7 @@ public ApiResponse<PostResponse> InvalidateAccountEmailVerification(string uid, /// <returns>Response containing Definition of Complete Forgot Password data</returns> /// 18.22 - public ApiResponse<ForgotPasswordResponse> GetForgotPasswordToken(string email, string emailTemplate = null, + public async Task<ApiResponse<ForgotPasswordResponse>> GetForgotPasswordToken(string email, string emailTemplate = null, string resetPasswordUrl = null, bool? sendEmail = null) { if (string.IsNullOrWhiteSpace(email)) @@ -451,7 +452,7 @@ public ApiResponse<ForgotPasswordResponse> GetForgotPasswordToken(string email, var resourcePath = "identity/v2/manage/account/forgot/token"; - return ConfigureAndExecute<ForgotPasswordResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<ForgotPasswordResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API Returns an Email Verification token. @@ -460,7 +461,7 @@ public ApiResponse<ForgotPasswordResponse> GetForgotPasswordToken(string email, /// <returns>Response containing Definition of Complete Verification data</returns> /// 18.23 - public ApiResponse<EmailVerificationTokenResponse> GetEmailVerificationToken(string email) + public async Task<ApiResponse<EmailVerificationTokenResponse>> GetEmailVerificationToken(string email) { if (string.IsNullOrWhiteSpace(email)) { @@ -479,7 +480,7 @@ public ApiResponse<EmailVerificationTokenResponse> GetEmailVerificationToken(str var resourcePath = "identity/v2/manage/account/verify/token"; - return ConfigureAndExecute<EmailVerificationTokenResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<EmailVerificationTokenResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// The API is used to get LoginRadius access token based on UID. @@ -488,7 +489,7 @@ public ApiResponse<EmailVerificationTokenResponse> GetEmailVerificationToken(str /// <returns>Response containing Definition of Complete Token data</returns> /// 18.24 - public ApiResponse<AccessToken> GetAccessTokenByUid(string uid) + public async Task<ApiResponse<AccessToken>> GetAccessTokenByUid(string uid) { if (string.IsNullOrWhiteSpace(uid)) { @@ -503,7 +504,7 @@ public ApiResponse<AccessToken> GetAccessTokenByUid(string uid) var resourcePath = "identity/v2/manage/account/access_token"; - return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API Allows you to reset the phone no verification of an end user’s account. @@ -513,7 +514,7 @@ public ApiResponse<AccessToken> GetAccessTokenByUid(string uid) /// <returns>Response containing Definition of Complete Validation data</returns> /// 18.27 - public ApiResponse<PostResponse> ResetPhoneIDVerificationByUid(string uid, string smsTemplate = "") + public async Task<ApiResponse<PostResponse>> ResetPhoneIDVerificationByUid(string uid, string smsTemplate = "") { if (string.IsNullOrWhiteSpace(uid)) { @@ -531,7 +532,7 @@ public ApiResponse<PostResponse> ResetPhoneIDVerificationByUid(string uid, strin var resourcePath = $"identity/v2/manage/account/{uid}/invalidatephone"; - return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, null); + return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, null); } /// <summary> /// This API is used to add/upsert another emails in account profile by different-different email types. If the email type is same then it will simply update the existing email, otherwise it will add a new email in Email array. @@ -542,7 +543,7 @@ public ApiResponse<PostResponse> ResetPhoneIDVerificationByUid(string uid, strin /// <returns>Response containing Definition for Complete profile data</returns> /// 18.29 - public ApiResponse<Identity> UpsertEmail(UpsertEmailModel upsertEmailModel, string uid, + public async Task<ApiResponse<Identity>> UpsertEmail(UpsertEmailModel upsertEmailModel, string uid, string fields = "") { if (upsertEmailModel == null) @@ -565,7 +566,7 @@ public ApiResponse<Identity> UpsertEmail(UpsertEmailModel upsertEmailModel, stri var resourcePath = $"identity/v2/manage/account/{uid}/email"; - return ConfigureAndExecute<Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(upsertEmailModel)); + return await ConfigureAndExecute<Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(upsertEmailModel)); } /// <summary> /// Use this API to Remove emails from a user Account @@ -576,7 +577,7 @@ public ApiResponse<Identity> UpsertEmail(UpsertEmailModel upsertEmailModel, stri /// <returns>Response containing Definition for Complete profile data</returns> /// 18.30 - public ApiResponse<Identity> RemoveEmail(string email, string uid, + public async Task<ApiResponse<Identity>> RemoveEmail(string email, string uid, string fields = "") { if (string.IsNullOrWhiteSpace(email)) @@ -604,7 +605,7 @@ public ApiResponse<Identity> RemoveEmail(string email, string uid, var resourcePath = $"identity/v2/manage/account/{uid}/email"; - return ConfigureAndExecute<Identity>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<Identity>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API is used to refresh an access_token via it's associated refresh_token. @@ -613,7 +614,7 @@ public ApiResponse<Identity> RemoveEmail(string email, string uid, /// <returns>Response containing Definition of Complete Token data</returns> /// 18.31 - public ApiResponse<AccessToken> RefreshAccessTokenByRefreshToken(string refreshToken) + public async Task<ApiResponse<AccessToken>> RefreshAccessTokenByRefreshToken(string refreshToken) { if (string.IsNullOrWhiteSpace(refreshToken)) { @@ -628,7 +629,7 @@ public ApiResponse<AccessToken> RefreshAccessTokenByRefreshToken(string refreshT var resourcePath = "identity/v2/manage/account/access_token/refresh"; - return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Revoke Refresh Access Token API is used to revoke a refresh token or the Provider Access Token, revoking an existing refresh token will invalidate the refresh token but the associated access token will work until the expiry. @@ -637,7 +638,7 @@ public ApiResponse<AccessToken> RefreshAccessTokenByRefreshToken(string refreshT /// <returns>Response containing Definition of Delete Request</returns> /// 18.32 - public ApiResponse<DeleteResponse> RevokeRefreshToken(string refreshToken) + public async Task<ApiResponse<DeleteResponse>> RevokeRefreshToken(string refreshToken) { if (string.IsNullOrWhiteSpace(refreshToken)) { @@ -652,7 +653,7 @@ public ApiResponse<DeleteResponse> RevokeRefreshToken(string refreshToken) var resourcePath = "identity/v2/manage/account/access_token/refresh/revoke"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <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. @@ -662,7 +663,7 @@ public ApiResponse<DeleteResponse> RevokeRefreshToken(string refreshToken) /// <returns>Complete user Identity data</returns> /// 18.35 - public ApiResponse<ListReturn<Identity>> GetAccountIdentitiesByEmail(string email, string fields = "") + public async Task<ApiResponse<ListReturn<Identity>>> GetAccountIdentitiesByEmail(string email, string fields = "") { if (string.IsNullOrWhiteSpace(email)) { @@ -681,7 +682,7 @@ public ApiResponse<ListReturn<Identity>> GetAccountIdentitiesByEmail(string emai var resourcePath = "identity/v2/manage/account/identities"; - return ConfigureAndExecute<ListReturn<Identity>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<ListReturn<Identity>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to delete all user profiles associated with an Email. @@ -690,7 +691,7 @@ public ApiResponse<ListReturn<Identity>> GetAccountIdentitiesByEmail(string emai /// <returns>Response containing Definition of Delete Request</returns> /// 18.36 - public ApiResponse<DeleteResponse> AccountDeleteByEmail(string email) + public async Task<ApiResponse<DeleteResponse>> AccountDeleteByEmail(string email) { if (string.IsNullOrWhiteSpace(email)) { @@ -705,7 +706,7 @@ public ApiResponse<DeleteResponse> AccountDeleteByEmail(string email) var resourcePath = "identity/v2/manage/account"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); } /// <summary> /// This API is used to update a user's Uid. It will update all profiles, custom objects and consent management logs associated with the Uid. @@ -715,7 +716,7 @@ public ApiResponse<DeleteResponse> AccountDeleteByEmail(string email) /// <returns>Response containing Definition of Complete Validation data</returns> /// 18.41 - public ApiResponse<PostResponse> AccountUpdateUid(UpdateUidModel updateUidModel, string uid) + public async Task<ApiResponse<PostResponse>> AccountUpdateUid(UpdateUidModel updateUidModel, string uid) { if (updateUidModel == null) { @@ -734,7 +735,7 @@ public ApiResponse<PostResponse> AccountUpdateUid(UpdateUidModel updateUidModel, var resourcePath = "identity/v2/manage/account/uid"; - return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(updateUidModel)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(updateUidModel)); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Account/RoleApi.cs b/Source/LoginRadiusSDK.V2/Api/Account/RoleApi.cs index f7c7d4c..94bb4d8 100644 --- a/Source/LoginRadiusSDK.V2/Api/Account/RoleApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Account/RoleApi.cs @@ -12,6 +12,7 @@ using LoginRadiusSDK.V2.Models.RequestModels; using LoginRadiusSDK.V2.Models.ResponseModels; using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile.Objects; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Account { @@ -24,7 +25,7 @@ public class RoleApi : LoginRadiusResource /// <returns>Response containing Definition of Complete Roles data</returns> /// 18.6 - public ApiResponse<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.AccountRolesModel> GetRolesByUid(string uid) + public async Task<ApiResponse<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.AccountRolesModel>> GetRolesByUid(string uid) { if (string.IsNullOrWhiteSpace(uid)) { @@ -38,7 +39,7 @@ public class RoleApi : LoginRadiusResource var resourcePath = $"identity/v2/manage/account/{uid}/role"; - return ConfigureAndExecute<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.AccountRolesModel>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.AccountRolesModel>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to assign your desired roles to a given user. @@ -48,7 +49,7 @@ public class RoleApi : LoginRadiusResource /// <returns>Response containing Definition of Complete Roles data</returns> /// 18.7 - public ApiResponse<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.AccountRolesModel> AssignRolesByUid(LoginRadiusSDK.V2.Models.RequestModels.AccountRolesModel accountRolesModel, string uid) + public async Task<ApiResponse<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.AccountRolesModel>> AssignRolesByUid(LoginRadiusSDK.V2.Models.RequestModels.AccountRolesModel accountRolesModel, string uid) { if (accountRolesModel == null) { @@ -66,7 +67,7 @@ public class RoleApi : LoginRadiusResource var resourcePath = $"identity/v2/manage/account/{uid}/role"; - return ConfigureAndExecute<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.AccountRolesModel>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(accountRolesModel)); + return await ConfigureAndExecute<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.AccountRolesModel>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(accountRolesModel)); } /// <summary> /// This API is used to unassign roles from a user. @@ -76,7 +77,7 @@ public class RoleApi : LoginRadiusResource /// <returns>Response containing Definition of Delete Request</returns> /// 18.8 - public ApiResponse<DeleteResponse> UnassignRolesByUid(LoginRadiusSDK.V2.Models.RequestModels.AccountRolesModel accountRolesModel, string uid) + public async Task<ApiResponse<DeleteResponse>> UnassignRolesByUid(LoginRadiusSDK.V2.Models.RequestModels.AccountRolesModel accountRolesModel, string uid) { if (accountRolesModel == null) { @@ -94,7 +95,7 @@ public ApiResponse<DeleteResponse> UnassignRolesByUid(LoginRadiusSDK.V2.Models.R var resourcePath = $"identity/v2/manage/account/{uid}/role"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(accountRolesModel)); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(accountRolesModel)); } /// <summary> /// This API Gets the contexts that have been configured and the associated roles and permissions. @@ -103,7 +104,7 @@ public ApiResponse<DeleteResponse> UnassignRolesByUid(LoginRadiusSDK.V2.Models.R /// <returns>Complete user RoleContext data</returns> /// 18.9 - public ApiResponse<ListReturn<RoleContext>> GetRoleContextByUid(string uid) + public async Task<ApiResponse<ListReturn<RoleContext>>> GetRoleContextByUid(string uid) { if (string.IsNullOrWhiteSpace(uid)) { @@ -117,7 +118,7 @@ public ApiResponse<ListReturn<RoleContext>> GetRoleContextByUid(string uid) var resourcePath = $"identity/v2/manage/account/{uid}/rolecontext"; - return ConfigureAndExecute<ListReturn<RoleContext>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<ListReturn<RoleContext>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The API is used to retrieve role context by the context name. @@ -126,7 +127,7 @@ public ApiResponse<ListReturn<RoleContext>> GetRoleContextByUid(string uid) /// <returns>Complete user RoleContext data</returns> /// 18.10 - public ApiResponse<ListReturn<RoleContextResponseModel>> GetRoleContextByContextName(string contextName) + public async Task<ApiResponse<ListReturn<RoleContextResponseModel>>> GetRoleContextByContextName(string contextName) { if (string.IsNullOrWhiteSpace(contextName)) { @@ -140,7 +141,7 @@ public ApiResponse<ListReturn<RoleContextResponseModel>> GetRoleContextByContext var resourcePath = $"identity/v2/manage/account/rolecontext/{contextName}"; - return ConfigureAndExecute<ListReturn<RoleContextResponseModel>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<ListReturn<RoleContextResponseModel>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API creates a Context with a set of Roles @@ -150,7 +151,7 @@ public ApiResponse<ListReturn<RoleContextResponseModel>> GetRoleContextByContext /// <returns>Complete user RoleContext data</returns> /// 18.11 - public ApiResponse<ListReturn<RoleContext>> UpdateRoleContextByUid(AccountRoleContextModel accountRoleContextModel, string uid) + public async Task<ApiResponse<ListReturn<RoleContext>>> UpdateRoleContextByUid(AccountRoleContextModel accountRoleContextModel, string uid) { if (accountRoleContextModel == null) { @@ -168,7 +169,7 @@ public ApiResponse<ListReturn<RoleContext>> UpdateRoleContextByUid(AccountRoleCo var resourcePath = $"identity/v2/manage/account/{uid}/rolecontext"; - return ConfigureAndExecute<ListReturn<RoleContext>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(accountRoleContextModel)); + return await ConfigureAndExecute<ListReturn<RoleContext>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(accountRoleContextModel)); } /// <summary> /// This API Deletes the specified Role Context @@ -178,7 +179,7 @@ public ApiResponse<ListReturn<RoleContext>> UpdateRoleContextByUid(AccountRoleCo /// <returns>Response containing Definition of Delete Request</returns> /// 18.12 - public ApiResponse<DeleteResponse> DeleteRoleContextByUid(string contextName, string uid) + public async Task<ApiResponse<DeleteResponse>> DeleteRoleContextByUid(string contextName, string uid) { if (string.IsNullOrWhiteSpace(contextName)) { @@ -196,7 +197,7 @@ public ApiResponse<DeleteResponse> DeleteRoleContextByUid(string contextName, st var resourcePath = $"identity/v2/manage/account/{uid}/rolecontext/{contextName}"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); } /// <summary> /// This API Deletes the specified Role from a Context. @@ -207,7 +208,7 @@ public ApiResponse<DeleteResponse> DeleteRoleContextByUid(string contextName, st /// <returns>Response containing Definition of Delete Request</returns> /// 18.13 - public ApiResponse<DeleteResponse> DeleteRolesFromRoleContextByUid(string contextName, RoleContextRemoveRoleModel roleContextRemoveRoleModel, + public async Task<ApiResponse<DeleteResponse>> DeleteRolesFromRoleContextByUid(string contextName, RoleContextRemoveRoleModel roleContextRemoveRoleModel, string uid) { if (string.IsNullOrWhiteSpace(contextName)) @@ -230,7 +231,7 @@ public ApiResponse<DeleteResponse> DeleteRolesFromRoleContextByUid(string contex var resourcePath = $"identity/v2/manage/account/{uid}/rolecontext/{contextName}/role"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(roleContextRemoveRoleModel)); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(roleContextRemoveRoleModel)); } /// <summary> /// This API Deletes Additional Permissions from Context. @@ -241,7 +242,7 @@ public ApiResponse<DeleteResponse> DeleteRolesFromRoleContextByUid(string contex /// <returns>Response containing Definition of Delete Request</returns> /// 18.14 - public ApiResponse<DeleteResponse> DeleteAdditionalPermissionFromRoleContextByUid(string contextName, RoleContextAdditionalPermissionRemoveRoleModel roleContextAdditionalPermissionRemoveRoleModel, + public async Task<ApiResponse<DeleteResponse>> DeleteAdditionalPermissionFromRoleContextByUid(string contextName, RoleContextAdditionalPermissionRemoveRoleModel roleContextAdditionalPermissionRemoveRoleModel, string uid) { if (string.IsNullOrWhiteSpace(contextName)) @@ -264,7 +265,7 @@ public ApiResponse<DeleteResponse> DeleteAdditionalPermissionFromRoleContextByUi var resourcePath = $"identity/v2/manage/account/{uid}/rolecontext/{contextName}/additionalpermission"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(roleContextAdditionalPermissionRemoveRoleModel)); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(roleContextAdditionalPermissionRemoveRoleModel)); } /// <summary> /// This API retrieves the complete list of created roles with permissions of your app. @@ -272,7 +273,7 @@ public ApiResponse<DeleteResponse> DeleteAdditionalPermissionFromRoleContextByUi /// <returns>Complete user Roles List data</returns> /// 41.1 - public ApiResponse<ListData<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>> GetRolesList() + public async Task<ApiResponse<ListData<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>>> GetRolesList() { var queryParameters = new QueryParameters { @@ -282,7 +283,7 @@ public ApiResponse<DeleteResponse> DeleteAdditionalPermissionFromRoleContextByUi var resourcePath = "identity/v2/manage/role"; - return ConfigureAndExecute<ListData<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<ListData<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API creates a role with permissions. @@ -291,7 +292,7 @@ public ApiResponse<DeleteResponse> DeleteAdditionalPermissionFromRoleContextByUi /// <returns>Complete user Roles data</returns> /// 41.2 - public ApiResponse<ListData<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>> CreateRoles(RolesModel rolesModel) + public async Task<ApiResponse<ListData<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>>> CreateRoles(RolesModel rolesModel) { if (rolesModel == null) { @@ -305,7 +306,7 @@ public ApiResponse<DeleteResponse> DeleteAdditionalPermissionFromRoleContextByUi var resourcePath = "identity/v2/manage/role"; - return ConfigureAndExecute<ListData<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(rolesModel)); + return await ConfigureAndExecute<ListData<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(rolesModel)); } /// <summary> /// This API is used to delete the role. @@ -314,7 +315,7 @@ public ApiResponse<DeleteResponse> DeleteAdditionalPermissionFromRoleContextByUi /// <returns>Response containing Definition of Delete Request</returns> /// 41.3 - public ApiResponse<DeleteResponse> DeleteRole(string role) + public async Task<ApiResponse<DeleteResponse>> DeleteRole(string role) { if (string.IsNullOrWhiteSpace(role)) { @@ -328,7 +329,7 @@ public ApiResponse<DeleteResponse> DeleteRole(string role) var resourcePath = $"identity/v2/manage/role/{role}"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); } /// <summary> /// This API is used to add permissions to a given role. @@ -338,7 +339,7 @@ public ApiResponse<DeleteResponse> DeleteRole(string role) /// <returns>Response containing Definition of Complete role data</returns> /// 41.4 - public ApiResponse<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel> AddRolePermissions(PermissionsModel permissionsModel, string role) + public async Task<ApiResponse<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>> AddRolePermissions(PermissionsModel permissionsModel, string role) { if (permissionsModel == null) { @@ -356,7 +357,7 @@ public ApiResponse<DeleteResponse> DeleteRole(string role) var resourcePath = $"identity/v2/manage/role/{role}/permission"; - return ConfigureAndExecute<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(permissionsModel)); + return await ConfigureAndExecute<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(permissionsModel)); } /// <summary> /// API is used to remove permissions from a role. @@ -366,7 +367,7 @@ public ApiResponse<DeleteResponse> DeleteRole(string role) /// <returns>Response containing Definition of Complete role data</returns> /// 41.5 - public ApiResponse<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel> RemoveRolePermissions(PermissionsModel permissionsModel, string role) + public async Task<ApiResponse<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>> RemoveRolePermissions(PermissionsModel permissionsModel, string role) { if (permissionsModel == null) { @@ -384,7 +385,7 @@ public ApiResponse<DeleteResponse> DeleteRole(string role) var resourcePath = $"identity/v2/manage/role/{role}/permission"; - return ConfigureAndExecute<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(permissionsModel)); + return await ConfigureAndExecute<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.RoleModel>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(permissionsModel)); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Account/SottApi.cs b/Source/LoginRadiusSDK.V2/Api/Account/SottApi.cs index 5a8f2d0..834c7d2 100644 --- a/Source/LoginRadiusSDK.V2/Api/Account/SottApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Account/SottApi.cs @@ -8,6 +8,7 @@ using LoginRadiusSDK.V2.Common; using LoginRadiusSDK.V2.Util; using LoginRadiusSDK.V2.Models.ResponseModels; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Account { @@ -20,7 +21,7 @@ public class SottApi : LoginRadiusResource /// <returns>Sott data For Registration</returns> /// 18.28 - public ApiResponse<SottResponseData> GenerateSott(int? timeDifference = null) + public async Task<ApiResponse<SottResponseData>> GenerateSott(int? timeDifference = null) { var queryParameters = new QueryParameters { @@ -34,7 +35,7 @@ public ApiResponse<SottResponseData> GenerateSott(int? timeDifference = null) var resourcePath = "identity/v2/manage/account/sott"; - return ConfigureAndExecute<SottResponseData>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<SottResponseData>(HttpMethod.GET, resourcePath, queryParameters, null); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Advanced/ConfigurationApi.cs b/Source/LoginRadiusSDK.V2/Api/Advanced/ConfigurationApi.cs index 08277bc..14087b4 100644 --- a/Source/LoginRadiusSDK.V2/Api/Advanced/ConfigurationApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Advanced/ConfigurationApi.cs @@ -8,6 +8,7 @@ using LoginRadiusSDK.V2.Common; using LoginRadiusSDK.V2.Util; using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Advanced { @@ -18,14 +19,17 @@ public class ConfigurationApi : LoginRadiusResource /// </summary> /// <returns>Response containing LoginRadius App configurations which are set in the LoginRadius Dashboard for a particular LoginRadius site/environment</returns> /// 100 - public ApiResponse<ConfigResponseModel> GetConfigurations() + public async Task<ApiResponse<ConfigResponseModel>> GetConfigurations() { var queryParameters = new QueryParameters { { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] } }; var resourcePath = "ciam/appinfo"; - return ConfigureAndExecute<ConfigResponseModel>(HttpMethod.GET, resourcePath, queryParameters, null); + + return await ConfigureAndExecute<ConfigResponseModel>(HttpMethod.GET, resourcePath, queryParameters, null); + + } /// <summary> @@ -35,7 +39,7 @@ public ApiResponse<ConfigResponseModel> GetConfigurations() /// <returns>Response containing Definition of Complete service info data</returns> /// 3.1 - public ApiResponse<ServiceInfoModel> GetServerInfo(int? timeDifference = null) + public async Task<ApiResponse<ServiceInfoModel>> GetServerInfo(int? timeDifference = null) { var queryParameters = new QueryParameters { @@ -48,7 +52,7 @@ public ApiResponse<ServiceInfoModel> GetServerInfo(int? timeDifference = null) var resourcePath = "identity/v2/serverinfo"; - return ConfigureAndExecute<ServiceInfoModel>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<ServiceInfoModel>(HttpMethod.GET, resourcePath, queryParameters, null); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Advanced/ConsentManagementApi.cs b/Source/LoginRadiusSDK.V2/Api/Advanced/ConsentManagementApi.cs index 6c9fa40..82c960e 100644 --- a/Source/LoginRadiusSDK.V2/Api/Advanced/ConsentManagementApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Advanced/ConsentManagementApi.cs @@ -11,6 +11,7 @@ using LoginRadiusSDK.V2.Models.ResponseModels; using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; using LoginRadiusSDK.V2.Models.RequestModels; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Advanced { @@ -23,7 +24,7 @@ public class ConsentManagementApi : LoginRadiusResource /// <returns>Response containing consent logs</returns> /// 18.37 - public ApiResponse<ConsentLogsResponseModel> GetConsentLogsByUid(string uid) + public async Task<ApiResponse<ConsentLogsResponseModel>> GetConsentLogsByUid(string uid) { if (string.IsNullOrWhiteSpace(uid)) { @@ -37,7 +38,7 @@ public ApiResponse<ConsentLogsResponseModel> GetConsentLogsByUid(string uid) var resourcePath = $"identity/v2/manage/account/{uid}/consent/logs"; - return ConfigureAndExecute<ConsentLogsResponseModel>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<ConsentLogsResponseModel>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is to submit consent form using consent token. @@ -47,7 +48,7 @@ public ApiResponse<ConsentLogsResponseModel> GetConsentLogsByUid(string uid) /// <returns>Response containing User Profile Data and access token</returns> /// 43.1 - public ApiResponse<AccessToken<Identity>> SubmitConsentByConsentToken(string consentToken, ConsentSubmitModel consentSubmitModel) + public async Task<ApiResponse<AccessToken<Identity>>> SubmitConsentByConsentToken(string consentToken, ConsentSubmitModel consentSubmitModel) { if (string.IsNullOrWhiteSpace(consentToken)) { @@ -65,7 +66,7 @@ public ApiResponse<AccessToken<Identity>> SubmitConsentByConsentToken(string con var resourcePath = "identity/v2/auth/consent"; - return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(consentSubmitModel)); + return await ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(consentSubmitModel)); } /// <summary> /// This API is used to fetch consent logs. @@ -74,7 +75,7 @@ public ApiResponse<AccessToken<Identity>> SubmitConsentByConsentToken(string con /// <returns>Response containing consent logs</returns> /// 43.2 - public ApiResponse<ConsentLogsResponseModel> GetConsentLogs(string accessToken) + public async Task<ApiResponse<ConsentLogsResponseModel>> GetConsentLogs(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -88,7 +89,7 @@ public ApiResponse<ConsentLogsResponseModel> GetConsentLogs(string accessToken) var resourcePath = "identity/v2/auth/consent/logs"; - return ConfigureAndExecute<ConsentLogsResponseModel>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<ConsentLogsResponseModel>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// API to provide a way to end user to submit a consent form for particular event type. @@ -98,7 +99,7 @@ public ApiResponse<ConsentLogsResponseModel> GetConsentLogs(string accessToken) /// <returns>Response containing Definition for Complete profile data</returns> /// 43.3 - public ApiResponse<Identity> SubmitConsentByAccessToken(string accessToken, ConsentSubmitModel consentSubmitModel) + public async Task<ApiResponse<Identity>> SubmitConsentByAccessToken(string accessToken, ConsentSubmitModel consentSubmitModel) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -116,7 +117,7 @@ public ApiResponse<Identity> SubmitConsentByAccessToken(string accessToken, Cons var resourcePath = "identity/v2/auth/consent/profile"; - return ConfigureAndExecute<Identity>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(consentSubmitModel)); + return await ConfigureAndExecute<Identity>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(consentSubmitModel)); } /// <summary> /// This API is used to check if consent is submitted for a particular event or not. @@ -127,7 +128,7 @@ public ApiResponse<Identity> SubmitConsentByAccessToken(string accessToken, Cons /// <returns>Response containing consent profile</returns> /// 43.4 - public ApiResponse<ConsentProfileValidResponse> VerifyConsentByAccessToken(string accessToken, string @event, + public async Task<ApiResponse<ConsentProfileValidResponse>> VerifyConsentByAccessToken(string accessToken, string @event, bool? isCustom) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -148,7 +149,7 @@ public ApiResponse<ConsentProfileValidResponse> VerifyConsentByAccessToken(strin var resourcePath = "identity/v2/auth/consent/verify"; - return ConfigureAndExecute<ConsentProfileValidResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<ConsentProfileValidResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is to update consents using access token. @@ -158,7 +159,7 @@ public ApiResponse<ConsentProfileValidResponse> VerifyConsentByAccessToken(strin /// <returns>Response containing consent profile</returns> /// 43.5 - public ApiResponse<ConsentProfile> UpdateConsentProfileByAccessToken(string accessToken, ConsentUpdateModel consentUpdateModel) + public async Task<ApiResponse<ConsentProfile>> UpdateConsentProfileByAccessToken(string accessToken, ConsentUpdateModel consentUpdateModel) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -176,7 +177,7 @@ public ApiResponse<ConsentProfile> UpdateConsentProfileByAccessToken(string acce var resourcePath = "identity/v2/auth/consent"; - return ConfigureAndExecute<ConsentProfile>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(consentUpdateModel)); + return await ConfigureAndExecute<ConsentProfile>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(consentUpdateModel)); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Advanced/CustomObjectApi.cs b/Source/LoginRadiusSDK.V2/Api/Advanced/CustomObjectApi.cs index e4db91f..6d7fb13 100644 --- a/Source/LoginRadiusSDK.V2/Api/Advanced/CustomObjectApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Advanced/CustomObjectApi.cs @@ -11,10 +11,11 @@ using LoginRadiusSDK.V2.Models.ResponseModels; using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; using LoginRadiusSDK.V2.Models.Enums; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Advanced { - public class CustomObjectApi : LoginRadiusResource + public class CustomObjectApi : LoginRadiusResource { /// <summary> /// This API is used to write information in JSON format to the custom object for the specified account. @@ -25,7 +26,7 @@ public class CustomObjectApi : LoginRadiusResource /// <returns>Response containing Definition for Complete user custom object data</returns> /// 6.1 - public ApiResponse<UserCustomObjectData> CreateCustomObjectByToken(string accessToken, string objectName, + public async Task<ApiResponse<UserCustomObjectData>> CreateCustomObjectByToken(string accessToken, string objectName, object payload) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -49,7 +50,7 @@ public ApiResponse<UserCustomObjectData> CreateCustomObjectByToken(string access var resourcePath = "identity/v2/auth/customobject"; - return ConfigureAndExecute<UserCustomObjectData>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(payload)); + return await ConfigureAndExecute<UserCustomObjectData>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(payload)); } /// <summary> /// This API is used to update the specified custom object data of the specified account. If the value of updatetype is 'replace' then it will fully replace custom object with the new custom object and if the value of updatetype is 'partialreplace' then it will perform an upsert type operation @@ -62,7 +63,7 @@ public ApiResponse<UserCustomObjectData> CreateCustomObjectByToken(string access /// <returns>Response containing Definition for Complete user custom object data</returns> /// 6.2 - public ApiResponse<UserCustomObjectData> UpdateCustomObjectByToken(string accessToken, string objectName, + public async Task<ApiResponse<UserCustomObjectData>> UpdateCustomObjectByToken(string accessToken, string objectName, string objectRecordId, object payload, CustomObjectUpdateOperationType? updateType = null) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -94,7 +95,7 @@ public ApiResponse<UserCustomObjectData> UpdateCustomObjectByToken(string access var resourcePath = $"identity/v2/auth/customobject/{objectRecordId}"; - return ConfigureAndExecute<UserCustomObjectData>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(payload)); + return await ConfigureAndExecute<UserCustomObjectData>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(payload)); } /// <summary> /// This API is used to retrieve the specified Custom Object data for the specified account. @@ -104,7 +105,7 @@ public ApiResponse<UserCustomObjectData> UpdateCustomObjectByToken(string access /// <returns>Complete user CustomObject data</returns> /// 6.3 - public ApiResponse<ListData<UserCustomObjectData>> GetCustomObjectByToken(string accessToken, string objectName) + public async Task<ApiResponse<ListData<UserCustomObjectData>>> GetCustomObjectByToken(string accessToken, string objectName) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -123,7 +124,7 @@ public ApiResponse<ListData<UserCustomObjectData>> GetCustomObjectByToken(string var resourcePath = "identity/v2/auth/customobject"; - return ConfigureAndExecute<ListData<UserCustomObjectData>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<ListData<UserCustomObjectData>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to retrieve the Custom Object data for the specified account. @@ -134,7 +135,7 @@ public ApiResponse<ListData<UserCustomObjectData>> GetCustomObjectByToken(string /// <returns>Response containing Definition for Complete user custom object data</returns> /// 6.4 - public ApiResponse<UserCustomObjectData> GetCustomObjectByRecordIDAndToken(string accessToken, string objectName, + public async Task<ApiResponse<UserCustomObjectData>> GetCustomObjectByRecordIDAndToken(string accessToken, string objectName, string objectRecordId) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -158,7 +159,7 @@ public ApiResponse<UserCustomObjectData> GetCustomObjectByRecordIDAndToken(strin var resourcePath = $"identity/v2/auth/customobject/{objectRecordId}"; - return ConfigureAndExecute<UserCustomObjectData>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<UserCustomObjectData>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to remove the specified Custom Object data using ObjectRecordId of a specified account. @@ -169,7 +170,7 @@ public ApiResponse<UserCustomObjectData> GetCustomObjectByRecordIDAndToken(strin /// <returns>Response containing Definition of Delete Request</returns> /// 6.5 - public ApiResponse<DeleteResponse> DeleteCustomObjectByToken(string accessToken, string objectName, + public async Task<ApiResponse<DeleteResponse>> DeleteCustomObjectByToken(string accessToken, string objectName, string objectRecordId) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -193,7 +194,7 @@ public ApiResponse<DeleteResponse> DeleteCustomObjectByToken(string accessToken, var resourcePath = $"identity/v2/auth/customobject/{objectRecordId}"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); } /// <summary> /// This API is used to write information in JSON format to the custom object for the specified account. @@ -204,7 +205,7 @@ public ApiResponse<DeleteResponse> DeleteCustomObjectByToken(string accessToken, /// <returns>Response containing Definition for Complete user custom object data</returns> /// 19.1 - public ApiResponse<UserCustomObjectData> CreateCustomObjectByUid(string objectName, object payload, + public async Task<ApiResponse<UserCustomObjectData>> CreateCustomObjectByUid(string objectName, object payload, string uid) { if (string.IsNullOrWhiteSpace(objectName)) @@ -228,7 +229,7 @@ public ApiResponse<UserCustomObjectData> CreateCustomObjectByUid(string objectNa var resourcePath = $"identity/v2/manage/account/{uid}/customobject"; - return ConfigureAndExecute<UserCustomObjectData>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(payload)); + return await ConfigureAndExecute<UserCustomObjectData>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(payload)); } /// <summary> /// This API is used to update the specified custom object data of a specified account. If the value of updatetype is 'replace' then it will fully replace custom object with new custom object and if the value of updatetype is partialreplace then it will perform an upsert type operation. @@ -241,7 +242,7 @@ public ApiResponse<UserCustomObjectData> CreateCustomObjectByUid(string objectNa /// <returns>Response containing Definition for Complete user custom object data</returns> /// 19.2 - public ApiResponse<UserCustomObjectData> UpdateCustomObjectByUid(string objectName, string objectRecordId, + public async Task<ApiResponse<UserCustomObjectData>> UpdateCustomObjectByUid(string objectName, string objectRecordId, object payload, string uid, CustomObjectUpdateOperationType? updateType = null) { if (string.IsNullOrWhiteSpace(objectName)) @@ -273,7 +274,7 @@ public ApiResponse<UserCustomObjectData> UpdateCustomObjectByUid(string objectNa var resourcePath = $"identity/v2/manage/account/{uid}/customobject/{objectRecordId}"; - return ConfigureAndExecute<UserCustomObjectData>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(payload)); + return await ConfigureAndExecute<UserCustomObjectData>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(payload)); } /// <summary> /// This API is used to retrieve all the custom objects by UID from cloud storage. @@ -283,7 +284,7 @@ public ApiResponse<UserCustomObjectData> UpdateCustomObjectByUid(string objectNa /// <returns>Complete user CustomObject data</returns> /// 19.3 - public ApiResponse<ListData<UserCustomObjectData>> GetCustomObjectByUid(string objectName, string uid) + public async Task<ApiResponse<ListData<UserCustomObjectData>>> GetCustomObjectByUid(string objectName, string uid) { if (string.IsNullOrWhiteSpace(objectName)) { @@ -302,7 +303,7 @@ public ApiResponse<ListData<UserCustomObjectData>> GetCustomObjectByUid(string o var resourcePath = $"identity/v2/manage/account/{uid}/customobject"; - return ConfigureAndExecute<ListData<UserCustomObjectData>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<ListData<UserCustomObjectData>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to retrieve the Custom Object data for the specified account. @@ -313,7 +314,7 @@ public ApiResponse<ListData<UserCustomObjectData>> GetCustomObjectByUid(string o /// <returns>Response containing Definition for Complete user custom object data</returns> /// 19.4 - public ApiResponse<UserCustomObjectData> GetCustomObjectByRecordID(string objectName, string objectRecordId, + public async Task<ApiResponse<UserCustomObjectData>> GetCustomObjectByRecordID(string objectName, string objectRecordId, string uid) { if (string.IsNullOrWhiteSpace(objectName)) @@ -337,7 +338,7 @@ public ApiResponse<UserCustomObjectData> GetCustomObjectByRecordID(string object var resourcePath = $"identity/v2/manage/account/{uid}/customobject/{objectRecordId}"; - return ConfigureAndExecute<UserCustomObjectData>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<UserCustomObjectData>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to remove the specified Custom Object data using ObjectRecordId of specified account. @@ -348,7 +349,7 @@ public ApiResponse<UserCustomObjectData> GetCustomObjectByRecordID(string object /// <returns>Response containing Definition of Delete Request</returns> /// 19.5 - public ApiResponse<DeleteResponse> DeleteCustomObjectByRecordID(string objectName, string objectRecordId, + public async Task<ApiResponse<DeleteResponse>> DeleteCustomObjectByRecordID(string objectName, string objectRecordId, string uid) { if (string.IsNullOrWhiteSpace(objectName)) @@ -372,7 +373,7 @@ public ApiResponse<DeleteResponse> DeleteCustomObjectByRecordID(string objectNam var resourcePath = $"identity/v2/manage/account/{uid}/customobject/{objectRecordId}"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Advanced/CustomRegistrationDataApi.cs b/Source/LoginRadiusSDK.V2/Api/Advanced/CustomRegistrationDataApi.cs index 0b6c395..a76f66d 100644 --- a/Source/LoginRadiusSDK.V2/Api/Advanced/CustomRegistrationDataApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Advanced/CustomRegistrationDataApi.cs @@ -11,6 +11,7 @@ using LoginRadiusSDK.V2.Util; using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; using LoginRadiusSDK.V2.Models.RequestModels; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Advanced { @@ -26,7 +27,7 @@ public class CustomRegistrationDataApi : LoginRadiusResource /// <returns>Complete user Registration data</returns> /// 7.1 - public ApiResponse<List<RegistrationDataField>> AuthGetRegistrationData(string type, int? limit = null, + public async Task<ApiResponse<List<RegistrationDataField>>> AuthGetRegistrationData(string type, int? limit = null, string parentId = null, int? skip = null) { if (string.IsNullOrWhiteSpace(type)) @@ -52,7 +53,7 @@ public ApiResponse<List<RegistrationDataField>> AuthGetRegistrationData(string t var resourcePath = $"identity/v2/auth/registrationdata/{type}"; - return ConfigureAndExecute<List<RegistrationDataField>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<List<RegistrationDataField>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API allows you to validate code for a particular dropdown member. @@ -62,7 +63,7 @@ public ApiResponse<List<RegistrationDataField>> AuthGetRegistrationData(string t /// <returns>Response containing Definition of Complete Validation data</returns> /// 7.2 - public ApiResponse<PostValidationResponse> ValidateRegistrationDataCode(string code, string recordId) + public async Task<ApiResponse<PostValidationResponse>> ValidateRegistrationDataCode(string code, string recordId) { if (string.IsNullOrWhiteSpace(code)) { @@ -85,7 +86,7 @@ public ApiResponse<PostValidationResponse> ValidateRegistrationDataCode(string c var resourcePath = "identity/v2/auth/registrationdata/validatecode"; - return ConfigureAndExecute<PostValidationResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<PostValidationResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API is used to retrieve dropdown data. @@ -97,7 +98,7 @@ public ApiResponse<PostValidationResponse> ValidateRegistrationDataCode(string c /// <returns>Complete user Registration data Fields</returns> /// 16.1 - public ApiResponse<List<RegistrationDataField>> GetRegistrationData(string type, int? limit = null, + public async Task<ApiResponse<List<RegistrationDataField>>> GetRegistrationData(string type, int? limit = null, string parentId = null, int? skip = null) { if (string.IsNullOrWhiteSpace(type)) @@ -124,7 +125,7 @@ public ApiResponse<List<RegistrationDataField>> GetRegistrationData(string type, var resourcePath = $"identity/v2/manage/registrationdata/{type}"; - return ConfigureAndExecute<List<RegistrationDataField>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<List<RegistrationDataField>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API allows you to fill data into a dropdown list which you have created for user Registeration. For more details on how to use this API please see our Custom Registration Data Overview @@ -133,7 +134,7 @@ public ApiResponse<List<RegistrationDataField>> GetRegistrationData(string type, /// <returns>Response containing Definition of Complete Validation data</returns> /// 16.2 - public ApiResponse<PostResponse> AddRegistrationData(RegistrationDataCreateModelList registrationDataCreateModelList) + public async Task<ApiResponse<PostResponse>> AddRegistrationData(RegistrationDataCreateModelList registrationDataCreateModelList) { if (registrationDataCreateModelList == null) { @@ -147,7 +148,7 @@ public ApiResponse<PostResponse> AddRegistrationData(RegistrationDataCreateModel var resourcePath = "identity/v2/manage/registrationdata"; - return ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(registrationDataCreateModelList)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(registrationDataCreateModelList)); } /// <summary> /// This API allows you to update a dropdown item @@ -157,7 +158,7 @@ public ApiResponse<PostResponse> AddRegistrationData(RegistrationDataCreateModel /// <returns>Complete user Registration data Field</returns> /// 16.3 - public ApiResponse<UserProfilePostResponse<RegistrationDataField>> UpdateRegistrationData(RegistrationDataUpdateModel registrationDataUpdateModel, string recordId) + public async Task<ApiResponse<UserProfilePostResponse<RegistrationDataField>>> UpdateRegistrationData(RegistrationDataUpdateModel registrationDataUpdateModel, string recordId) { if (registrationDataUpdateModel == null) { @@ -175,7 +176,7 @@ public ApiResponse<UserProfilePostResponse<RegistrationDataField>> UpdateRegistr var resourcePath = $"identity/v2/manage/registrationdata/{recordId}"; - return ConfigureAndExecute<UserProfilePostResponse<RegistrationDataField>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(registrationDataUpdateModel)); + return await ConfigureAndExecute<UserProfilePostResponse<RegistrationDataField>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(registrationDataUpdateModel)); } /// <summary> /// This API allows you to delete an item from a dropdown list. @@ -184,7 +185,7 @@ public ApiResponse<UserProfilePostResponse<RegistrationDataField>> UpdateRegistr /// <returns>Response containing Definition of Delete Request</returns> /// 16.4 - public ApiResponse<DeleteResponse> DeleteRegistrationData(string recordId) + public async Task<ApiResponse<DeleteResponse>> DeleteRegistrationData(string recordId) { if (string.IsNullOrWhiteSpace(recordId)) { @@ -198,7 +199,7 @@ public ApiResponse<DeleteResponse> DeleteRegistrationData(string recordId) var resourcePath = $"identity/v2/manage/registrationdata/{recordId}"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); } /// <summary> /// This API allows you to delete all records contained in a datasource. @@ -207,7 +208,7 @@ public ApiResponse<DeleteResponse> DeleteRegistrationData(string recordId) /// <returns>Response containing Definition of Delete Request</returns> /// 16.5 - public ApiResponse<DeleteResponse> DeleteAllRecordsByDataSource(string type) + public async Task<ApiResponse<DeleteResponse>> DeleteAllRecordsByDataSource(string type) { if (string.IsNullOrWhiteSpace(type)) { @@ -221,7 +222,7 @@ public ApiResponse<DeleteResponse> DeleteAllRecordsByDataSource(string type) var resourcePath = $"identity/v2/manage/registrationdata/type/{type}"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Advanced/MultiFactorAuthenticationApi.cs b/Source/LoginRadiusSDK.V2/Api/Advanced/MultiFactorAuthenticationApi.cs index 421d71f..9e4a056 100644 --- a/Source/LoginRadiusSDK.V2/Api/Advanced/MultiFactorAuthenticationApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Advanced/MultiFactorAuthenticationApi.cs @@ -12,6 +12,7 @@ using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; using LoginRadiusSDK.V2.Models.RequestModels; using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Advanced { @@ -25,7 +26,7 @@ public class MultiFactorAuthenticationApi : LoginRadiusResource /// <returns>Response containing Definition of Complete Multi-Factor Authentication Settings data</returns> /// 5.7 - public ApiResponse<MultiFactorAuthenticationSettingsResponse> MFAConfigureByAccessToken(string accessToken, string smsTemplate2FA = null) + public async Task<ApiResponse<MultiFactorAuthenticationSettingsResponse>> MFAConfigureByAccessToken(string accessToken, string smsTemplate2FA = null) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -43,7 +44,7 @@ public ApiResponse<MultiFactorAuthenticationSettingsResponse> MFAConfigureByAcce var resourcePath = "identity/v2/auth/account/2fa"; - return ConfigureAndExecute<MultiFactorAuthenticationSettingsResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<MultiFactorAuthenticationSettingsResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to trigger the Multi-factor authentication settings after login for secure actions @@ -54,7 +55,7 @@ public ApiResponse<MultiFactorAuthenticationSettingsResponse> MFAConfigureByAcce /// <returns>Response containing Definition for Complete profile data</returns> /// 5.9 - public ApiResponse<Identity> MFAUpdateSetting(string accessToken, MultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout, + public async Task<ApiResponse<Identity>> MFAUpdateSetting(string accessToken, MultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout, string fields = "") { if (string.IsNullOrWhiteSpace(accessToken)) @@ -77,7 +78,7 @@ public ApiResponse<Identity> MFAUpdateSetting(string accessToken, MultiFactorAut var resourcePath = "identity/v2/auth/account/2fa/verification/otp"; - return ConfigureAndExecute<Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(multiFactorAuthModelWithLockout)); + return await ConfigureAndExecute<Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(multiFactorAuthModelWithLockout)); } /// <summary> /// This API is used to Enable Multi-factor authentication by access token on user login @@ -89,7 +90,7 @@ public ApiResponse<Identity> MFAUpdateSetting(string accessToken, MultiFactorAut /// <returns>Response containing Definition for Complete profile data</returns> /// 5.10 - public ApiResponse<Identity> MFAUpdateByAccessToken(string accessToken, MultiFactorAuthModelByGoogleAuthenticatorCode multiFactorAuthModelByGoogleAuthenticatorCode, + public async Task<ApiResponse<Identity>> MFAUpdateByAccessToken(string accessToken, MultiFactorAuthModelByGoogleAuthenticatorCode multiFactorAuthModelByGoogleAuthenticatorCode, string fields = "", string smsTemplate = null) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -116,7 +117,7 @@ public ApiResponse<Identity> MFAUpdateByAccessToken(string accessToken, MultiFac var resourcePath = "identity/v2/auth/account/2fa/verification/googleauthenticatorcode"; - return ConfigureAndExecute<Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(multiFactorAuthModelByGoogleAuthenticatorCode)); + return await ConfigureAndExecute<Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(multiFactorAuthModelByGoogleAuthenticatorCode)); } /// <summary> /// This API is used to update the Multi-factor authentication phone number by sending the verification OTP to the provided phone number @@ -127,7 +128,7 @@ public ApiResponse<Identity> MFAUpdateByAccessToken(string accessToken, MultiFac /// <returns>Response containing Definition for Complete SMS data</returns> /// 5.11 - public ApiResponse<SMSResponseData> MFAUpdatePhoneNumberByToken(string accessToken, string phoneNo2FA, + public async Task<ApiResponse<SMSResponseData>> MFAUpdatePhoneNumberByToken(string accessToken, string phoneNo2FA, string smsTemplate2FA = null) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -155,7 +156,7 @@ public ApiResponse<SMSResponseData> MFAUpdatePhoneNumberByToken(string accessTok var resourcePath = "identity/v2/auth/account/2fa"; - return ConfigureAndExecute<SMSResponseData>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<SMSResponseData>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API Resets the Google Authenticator configurations on a given account via the access_token @@ -165,7 +166,7 @@ public ApiResponse<SMSResponseData> MFAUpdatePhoneNumberByToken(string accessTok /// <returns>Response containing Definition of Delete Request</returns> /// 5.12.1 - public ApiResponse<DeleteResponse> MFAResetGoogleAuthByToken(string accessToken, bool googleAuthenticator) + public async Task<ApiResponse<DeleteResponse>> MFAResetGoogleAuthByToken(string accessToken, bool googleAuthenticator) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -184,7 +185,7 @@ public ApiResponse<DeleteResponse> MFAResetGoogleAuthByToken(string accessToken, var resourcePath = "identity/v2/auth/account/2fa/authenticator"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API resets the SMS Authenticator configurations on a given account via the access_token. @@ -194,7 +195,7 @@ public ApiResponse<DeleteResponse> MFAResetGoogleAuthByToken(string accessToken, /// <returns>Response containing Definition of Delete Request</returns> /// 5.12.2 - public ApiResponse<DeleteResponse> MFAResetSMSAuthByToken(string accessToken, bool otpAuthenticator) + public async Task<ApiResponse<DeleteResponse>> MFAResetSMSAuthByToken(string accessToken, bool otpAuthenticator) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -213,7 +214,7 @@ public ApiResponse<DeleteResponse> MFAResetSMSAuthByToken(string accessToken, bo var resourcePath = "identity/v2/auth/account/2fa/authenticator"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API is used to get a set of backup codes via access_token to allow the user login on a site that has Multi-factor Authentication enabled in the event that the user does not have a secondary factor available. We generate 10 codes, each code can only be consumed once. If any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically @@ -222,7 +223,7 @@ public ApiResponse<DeleteResponse> MFAResetSMSAuthByToken(string accessToken, bo /// <returns>Response containing Definition of Complete Backup Code data</returns> /// 5.13 - public ApiResponse<BackupCodeResponse> MFABackupCodeByAccessToken(string accessToken) + public async Task<ApiResponse<BackupCodeResponse>> MFABackupCodeByAccessToken(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -236,7 +237,7 @@ public ApiResponse<BackupCodeResponse> MFABackupCodeByAccessToken(string accessT var resourcePath = "identity/v2/auth/account/2fa/backupcode"; - return ConfigureAndExecute<BackupCodeResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<BackupCodeResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// API is used to reset the backup codes on a given account via the access_token. This API call will generate 10 new codes, each code can only be consumed once @@ -245,7 +246,7 @@ public ApiResponse<BackupCodeResponse> MFABackupCodeByAccessToken(string accessT /// <returns>Response containing Definition of Complete Backup Code data</returns> /// 5.14 - public ApiResponse<BackupCodeResponse> MFAResetBackupCodeByAccessToken(string accessToken) + public async Task<ApiResponse<BackupCodeResponse>> MFAResetBackupCodeByAccessToken(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -259,7 +260,7 @@ public ApiResponse<BackupCodeResponse> MFAResetBackupCodeByAccessToken(string ac var resourcePath = "identity/v2/auth/account/2fa/backupcode/reset"; - return ConfigureAndExecute<BackupCodeResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<BackupCodeResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API can be used to login by emailid on a Multi-factor authentication enabled LoginRadius site. @@ -275,7 +276,7 @@ public ApiResponse<BackupCodeResponse> MFAResetBackupCodeByAccessToken(string ac /// <returns>Complete user UserProfile data</returns> /// 9.8.1 - public ApiResponse<MultiFactorAuthenticationResponse<Identity>> MFALoginByEmail(string email, string password, + public async Task<ApiResponse<MultiFactorAuthenticationResponse<Identity>>> MFALoginByEmail(string email, string password, string emailTemplate = null, string fields = "", string loginUrl = null, string smsTemplate = null, string smsTemplate2FA = null, string verificationUrl = null) { @@ -324,7 +325,7 @@ public ApiResponse<MultiFactorAuthenticationResponse<Identity>> MFALoginByEmail( var resourcePath = "identity/v2/auth/login/2fa"; - return ConfigureAndExecute<MultiFactorAuthenticationResponse<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<MultiFactorAuthenticationResponse<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API can be used to login by username on a Multi-factor authentication enabled LoginRadius site. @@ -340,7 +341,7 @@ public ApiResponse<MultiFactorAuthenticationResponse<Identity>> MFALoginByEmail( /// <returns>Complete user UserProfile data</returns> /// 9.8.2 - public ApiResponse<MultiFactorAuthenticationResponse<Identity>> MFALoginByUserName(string password, string username, + public async Task<ApiResponse<MultiFactorAuthenticationResponse<Identity>>> MFALoginByUserName(string password, string username, string emailTemplate = null, string fields = "", string loginUrl = null, string smsTemplate = null, string smsTemplate2FA = null, string verificationUrl = null) { @@ -389,7 +390,7 @@ public ApiResponse<MultiFactorAuthenticationResponse<Identity>> MFALoginByUserNa var resourcePath = "identity/v2/auth/login/2fa"; - return ConfigureAndExecute<MultiFactorAuthenticationResponse<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<MultiFactorAuthenticationResponse<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API can be used to login by Phone on a Multi-factor authentication enabled LoginRadius site. @@ -405,7 +406,7 @@ public ApiResponse<MultiFactorAuthenticationResponse<Identity>> MFALoginByUserNa /// <returns>Complete user UserProfile data</returns> /// 9.8.3 - public ApiResponse<MultiFactorAuthenticationResponse<Identity>> MFALoginByPhone(string password, string phone, + public async Task<ApiResponse<MultiFactorAuthenticationResponse<Identity>>> MFALoginByPhone(string password, string phone, string emailTemplate = null, string fields = "", string loginUrl = null, string smsTemplate = null, string smsTemplate2FA = null, string verificationUrl = null) { @@ -454,7 +455,7 @@ public ApiResponse<MultiFactorAuthenticationResponse<Identity>> MFALoginByPhone( var resourcePath = "identity/v2/auth/login/2fa"; - return ConfigureAndExecute<MultiFactorAuthenticationResponse<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<MultiFactorAuthenticationResponse<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API is used to login via Multi-factor authentication by passing the One Time Password received via SMS @@ -466,7 +467,7 @@ public ApiResponse<MultiFactorAuthenticationResponse<Identity>> MFALoginByPhone( /// <returns>Complete user UserProfile data</returns> /// 9.12 - public ApiResponse<AccessToken<Identity>> MFAValidateOTPByPhone(MultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout, string secondFactorAuthenticationToken, + public async Task<ApiResponse<AccessToken<Identity>>> MFAValidateOTPByPhone(MultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout, string secondFactorAuthenticationToken, string fields = "", string smsTemplate2FA = null) { if (multiFactorAuthModelWithLockout == null) @@ -493,7 +494,7 @@ public ApiResponse<AccessToken<Identity>> MFAValidateOTPByPhone(MultiFactorAuthM var resourcePath = "identity/v2/auth/login/2fa/verification/otp"; - return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(multiFactorAuthModelWithLockout)); + return await ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(multiFactorAuthModelWithLockout)); } /// <summary> /// This API is used to login via Multi-factor-authentication by passing the google authenticator code. @@ -505,7 +506,7 @@ public ApiResponse<AccessToken<Identity>> MFAValidateOTPByPhone(MultiFactorAuthM /// <returns>Complete user UserProfile data</returns> /// 9.13 - public ApiResponse<AccessToken<Identity>> MFAValidateGoogleAuthCode(string googleAuthenticatorCode, string secondFactorAuthenticationToken, + public async Task<ApiResponse<AccessToken<Identity>>> MFAValidateGoogleAuthCode(string googleAuthenticatorCode, string secondFactorAuthenticationToken, string fields = "", string smsTemplate2FA = null) { if (string.IsNullOrWhiteSpace(googleAuthenticatorCode)) @@ -537,7 +538,7 @@ public ApiResponse<AccessToken<Identity>> MFAValidateGoogleAuthCode(string googl var resourcePath = "identity/v2/auth/login/2fa/verification/googleauthenticatorcode"; - return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API is used to validate the backup code provided by the user and if valid, we return an access_token allowing the user to login incases where Multi-factor authentication (MFA) is enabled and the secondary factor is unavailable. When a user initially downloads the Backup codes, We generate 10 codes, each code can only be consumed once. if any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically @@ -548,7 +549,7 @@ public ApiResponse<AccessToken<Identity>> MFAValidateGoogleAuthCode(string googl /// <returns>Complete user UserProfile data</returns> /// 9.14 - public ApiResponse<AccessToken<Identity>> MFAValidateBackupCode(MultiFactorAuthModelByBackupCode multiFactorAuthModelByBackupCode, string secondFactorAuthenticationToken, + public async Task<ApiResponse<AccessToken<Identity>>> MFAValidateBackupCode(MultiFactorAuthModelByBackupCode multiFactorAuthModelByBackupCode, string secondFactorAuthenticationToken, string fields = "") { if (multiFactorAuthModelByBackupCode == null) @@ -571,7 +572,7 @@ public ApiResponse<AccessToken<Identity>> MFAValidateBackupCode(MultiFactorAuthM var resourcePath = "identity/v2/auth/login/2fa/verification/backupcode"; - return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(multiFactorAuthModelByBackupCode)); + return await ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(multiFactorAuthModelByBackupCode)); } /// <summary> /// This API is used to update (if configured) the phone number used for Multi-factor authentication by sending the verification OTP to the provided phone number @@ -582,7 +583,7 @@ public ApiResponse<AccessToken<Identity>> MFAValidateBackupCode(MultiFactorAuthM /// <returns>Response containing Definition for Complete SMS data</returns> /// 9.16 - public ApiResponse<SMSResponseData> MFAUpdatePhoneNumber(string phoneNo2FA, string secondFactorAuthenticationToken, + public async Task<ApiResponse<SMSResponseData>> MFAUpdatePhoneNumber(string phoneNo2FA, string secondFactorAuthenticationToken, string smsTemplate2FA = null) { if (string.IsNullOrWhiteSpace(phoneNo2FA)) @@ -610,7 +611,7 @@ public ApiResponse<SMSResponseData> MFAUpdatePhoneNumber(string phoneNo2FA, stri var resourcePath = "identity/v2/auth/login/2fa"; - return ConfigureAndExecute<SMSResponseData>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<SMSResponseData>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API is used to resending the verification OTP to the provided phone number @@ -620,7 +621,7 @@ public ApiResponse<SMSResponseData> MFAUpdatePhoneNumber(string phoneNo2FA, stri /// <returns>Response containing Definition for Complete SMS data</returns> /// 9.17 - public ApiResponse<SMSResponseData> MFAResendOTP(string secondFactorAuthenticationToken, string smsTemplate2FA = null) + public async Task<ApiResponse<SMSResponseData>> MFAResendOTP(string secondFactorAuthenticationToken, string smsTemplate2FA = null) { if (string.IsNullOrWhiteSpace(secondFactorAuthenticationToken)) { @@ -638,7 +639,7 @@ public ApiResponse<SMSResponseData> MFAResendOTP(string secondFactorAuthenticati var resourcePath = "identity/v2/auth/login/2fa/resend"; - return ConfigureAndExecute<SMSResponseData>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<SMSResponseData>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API resets the SMS Authenticator configurations on a given account via the UID. @@ -648,7 +649,7 @@ public ApiResponse<SMSResponseData> MFAResendOTP(string secondFactorAuthenticati /// <returns>Response containing Definition of Delete Request</returns> /// 18.21.1 - public ApiResponse<DeleteResponse> MFAResetSMSAuthenticatorByUid(bool otpAuthenticator, string uid) + public async Task<ApiResponse<DeleteResponse>> MFAResetSMSAuthenticatorByUid(bool otpAuthenticator, string uid) { if (string.IsNullOrWhiteSpace(uid)) { @@ -668,7 +669,7 @@ public ApiResponse<DeleteResponse> MFAResetSMSAuthenticatorByUid(bool otpAuthent var resourcePath = "identity/v2/manage/account/2fa/authenticator"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API resets the Google Authenticator configurations on a given account via the UID. @@ -678,7 +679,7 @@ public ApiResponse<DeleteResponse> MFAResetSMSAuthenticatorByUid(bool otpAuthent /// <returns>Response containing Definition of Delete Request</returns> /// 18.21.2 - public ApiResponse<DeleteResponse> MFAResetGoogleAuthenticatorByUid(bool googleAuthenticator, string uid) + public async Task<ApiResponse<DeleteResponse>> MFAResetGoogleAuthenticatorByUid(bool googleAuthenticator, string uid) { if (string.IsNullOrWhiteSpace(uid)) { @@ -698,7 +699,7 @@ public ApiResponse<DeleteResponse> MFAResetGoogleAuthenticatorByUid(bool googleA var resourcePath = "identity/v2/manage/account/2fa/authenticator"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once. @@ -707,7 +708,7 @@ public ApiResponse<DeleteResponse> MFAResetGoogleAuthenticatorByUid(bool googleA /// <returns>Response containing Definition of Complete Backup Code data</returns> /// 18.25 - public ApiResponse<BackupCodeResponse> MFABackupCodeByUid(string uid) + public async Task<ApiResponse<BackupCodeResponse>> MFABackupCodeByUid(string uid) { if (string.IsNullOrWhiteSpace(uid)) { @@ -722,7 +723,7 @@ public ApiResponse<BackupCodeResponse> MFABackupCodeByUid(string uid) var resourcePath = "identity/v2/manage/account/2fa/backupcode"; - return ConfigureAndExecute<BackupCodeResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<BackupCodeResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once. @@ -731,7 +732,7 @@ public ApiResponse<BackupCodeResponse> MFABackupCodeByUid(string uid) /// <returns>Response containing Definition of Complete Backup Code data</returns> /// 18.26 - public ApiResponse<BackupCodeResponse> MFAResetBackupCodeByUid(string uid) + public async Task<ApiResponse<BackupCodeResponse>> MFAResetBackupCodeByUid(string uid) { if (string.IsNullOrWhiteSpace(uid)) { @@ -746,7 +747,7 @@ public ApiResponse<BackupCodeResponse> MFAResetBackupCodeByUid(string uid) var resourcePath = "identity/v2/manage/account/2fa/backupcode/reset"; - return ConfigureAndExecute<BackupCodeResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<BackupCodeResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Advanced/ReAuthenticationApi.cs b/Source/LoginRadiusSDK.V2/Api/Advanced/ReAuthenticationApi.cs index 0657cf0..b5d56ca 100644 --- a/Source/LoginRadiusSDK.V2/Api/Advanced/ReAuthenticationApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Advanced/ReAuthenticationApi.cs @@ -11,6 +11,7 @@ using LoginRadiusSDK.V2.Models.ResponseModels; using LoginRadiusSDK.V2.Models.RequestModels; using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Advanced { @@ -24,7 +25,7 @@ public class ReAuthenticationApi : LoginRadiusResource /// <returns>Response containing Definition of Complete Multi-Factor Authentication Settings data</returns> /// 14.3 - public ApiResponse<MultiFactorAuthenticationSettingsResponse> MFAReAuthenticate(string accessToken, string smsTemplate2FA = null) + public async Task<ApiResponse<MultiFactorAuthenticationSettingsResponse>> MFAReAuthenticate(string accessToken, string smsTemplate2FA = null) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -42,7 +43,7 @@ public ApiResponse<MultiFactorAuthenticationSettingsResponse> MFAReAuthenticate( var resourcePath = "identity/v2/auth/account/reauth/2fa"; - return ConfigureAndExecute<MultiFactorAuthenticationSettingsResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<MultiFactorAuthenticationSettingsResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to re-authenticate via Multi-factor authentication by passing the One Time Password received via SMS @@ -52,7 +53,7 @@ public ApiResponse<MultiFactorAuthenticationSettingsResponse> MFAReAuthenticate( /// <returns>Complete user Multi-Factor Authentication Token data</returns> /// 14.4 - public ApiResponse<EventBasedMultiFactorAuthenticationToken> MFAReAuthenticateByOTP(string accessToken, ReauthByOtpModel reauthByOtpModel) + public async Task<ApiResponse<EventBasedMultiFactorAuthenticationToken>> MFAReAuthenticateByOTP(string accessToken, ReauthByOtpModel reauthByOtpModel) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -70,7 +71,7 @@ public ApiResponse<EventBasedMultiFactorAuthenticationToken> MFAReAuthenticateBy var resourcePath = "identity/v2/auth/account/reauth/2fa/otp"; - return ConfigureAndExecute<EventBasedMultiFactorAuthenticationToken>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(reauthByOtpModel)); + return await ConfigureAndExecute<EventBasedMultiFactorAuthenticationToken>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(reauthByOtpModel)); } /// <summary> /// This API is used to re-authenticate by set of backup codes via access_token on the site that has Multi-factor authentication enabled in re-authentication for the user that does not have the device @@ -80,7 +81,7 @@ public ApiResponse<EventBasedMultiFactorAuthenticationToken> MFAReAuthenticateBy /// <returns>Complete user Multi-Factor Authentication Token data</returns> /// 14.5 - public ApiResponse<EventBasedMultiFactorAuthenticationToken> MFAReAuthenticateByBackupCode(string accessToken, ReauthByBackupCodeModel reauthByBackupCodeModel) + public async Task<ApiResponse<EventBasedMultiFactorAuthenticationToken>> MFAReAuthenticateByBackupCode(string accessToken, ReauthByBackupCodeModel reauthByBackupCodeModel) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -98,7 +99,7 @@ public ApiResponse<EventBasedMultiFactorAuthenticationToken> MFAReAuthenticateBy var resourcePath = "identity/v2/auth/account/reauth/2fa/backupcode"; - return ConfigureAndExecute<EventBasedMultiFactorAuthenticationToken>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(reauthByBackupCodeModel)); + return await ConfigureAndExecute<EventBasedMultiFactorAuthenticationToken>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(reauthByBackupCodeModel)); } /// <summary> /// This API is used to re-authenticate via Multi-factor-authentication by passing the google authenticator code @@ -108,7 +109,7 @@ public ApiResponse<EventBasedMultiFactorAuthenticationToken> MFAReAuthenticateBy /// <returns>Complete user Multi-Factor Authentication Token data</returns> /// 14.6 - public ApiResponse<EventBasedMultiFactorAuthenticationToken> MFAReAuthenticateByGoogleAuth(string accessToken, ReauthByGoogleAuthenticatorCodeModel reauthByGoogleAuthenticatorCodeModel) + public async Task<ApiResponse<EventBasedMultiFactorAuthenticationToken>> MFAReAuthenticateByGoogleAuth(string accessToken, ReauthByGoogleAuthenticatorCodeModel reauthByGoogleAuthenticatorCodeModel) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -126,7 +127,7 @@ public ApiResponse<EventBasedMultiFactorAuthenticationToken> MFAReAuthenticateBy var resourcePath = "identity/v2/auth/account/reauth/2fa/googleauthenticatorcode"; - return ConfigureAndExecute<EventBasedMultiFactorAuthenticationToken>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(reauthByGoogleAuthenticatorCodeModel)); + return await ConfigureAndExecute<EventBasedMultiFactorAuthenticationToken>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(reauthByGoogleAuthenticatorCodeModel)); } /// <summary> /// This API is used to re-authenticate via Multi-factor-authentication by passing the password @@ -137,7 +138,7 @@ public ApiResponse<EventBasedMultiFactorAuthenticationToken> MFAReAuthenticateBy /// <returns>Complete user Multi-Factor Authentication Token data</returns> /// 14.7 - public ApiResponse<EventBasedMultiFactorAuthenticationToken> MFAReAuthenticateByPassword(string accessToken, PasswordEventBasedAuthModelWithLockout passwordEventBasedAuthModelWithLockout, + public async Task<ApiResponse<EventBasedMultiFactorAuthenticationToken>> MFAReAuthenticateByPassword(string accessToken, PasswordEventBasedAuthModelWithLockout passwordEventBasedAuthModelWithLockout, string smsTemplate2FA = null) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -160,7 +161,7 @@ public ApiResponse<EventBasedMultiFactorAuthenticationToken> MFAReAuthenticateBy var resourcePath = "identity/v2/auth/account/reauth/password"; - return ConfigureAndExecute<EventBasedMultiFactorAuthenticationToken>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(passwordEventBasedAuthModelWithLockout)); + return await ConfigureAndExecute<EventBasedMultiFactorAuthenticationToken>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(passwordEventBasedAuthModelWithLockout)); } /// <summary> /// This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by OTP. @@ -170,7 +171,7 @@ public ApiResponse<EventBasedMultiFactorAuthenticationToken> MFAReAuthenticateBy /// <returns>Response containing Definition of Complete Validation data</returns> /// 18.38 - public ApiResponse<PostValidationResponse> VerifyMultiFactorOtpReauthentication(EventBasedMultiFactorToken eventBasedMultiFactorToken, string uid) + public async Task<ApiResponse<PostValidationResponse>> VerifyMultiFactorOtpReauthentication(EventBasedMultiFactorToken eventBasedMultiFactorToken, string uid) { if (eventBasedMultiFactorToken == null) { @@ -188,7 +189,7 @@ public ApiResponse<PostValidationResponse> VerifyMultiFactorOtpReauthentication( var resourcePath = $"identity/v2/manage/account/{uid}/reauth/2fa"; - return ConfigureAndExecute<PostValidationResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(eventBasedMultiFactorToken)); + return await ConfigureAndExecute<PostValidationResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(eventBasedMultiFactorToken)); } /// <summary> /// This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by password. @@ -198,7 +199,7 @@ public ApiResponse<PostValidationResponse> VerifyMultiFactorOtpReauthentication( /// <returns>Response containing Definition of Complete Validation data</returns> /// 18.39 - public ApiResponse<PostValidationResponse> VerifyMultiFactorPasswordReauthentication(EventBasedMultiFactorToken eventBasedMultiFactorToken, string uid) + public async Task<ApiResponse<PostValidationResponse>> VerifyMultiFactorPasswordReauthentication(EventBasedMultiFactorToken eventBasedMultiFactorToken, string uid) { if (eventBasedMultiFactorToken == null) { @@ -216,7 +217,7 @@ public ApiResponse<PostValidationResponse> VerifyMultiFactorPasswordReauthentica var resourcePath = $"identity/v2/manage/account/{uid}/reauth/password"; - return ConfigureAndExecute<PostValidationResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(eventBasedMultiFactorToken)); + return await ConfigureAndExecute<PostValidationResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(eventBasedMultiFactorToken)); } /// <summary> /// This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by PIN. @@ -226,7 +227,7 @@ public ApiResponse<PostValidationResponse> VerifyMultiFactorPasswordReauthentica /// <returns>Response containing Definition of Complete Validation data</returns> /// 18.40 - public ApiResponse<PostValidationResponse> VerifyMultiFactorPINReauthentication(EventBasedMultiFactorToken eventBasedMultiFactorToken, string uid) + public async Task<ApiResponse<PostValidationResponse>> VerifyMultiFactorPINReauthentication(EventBasedMultiFactorToken eventBasedMultiFactorToken, string uid) { if (eventBasedMultiFactorToken == null) { @@ -244,7 +245,7 @@ public ApiResponse<PostValidationResponse> VerifyMultiFactorPINReauthentication( var resourcePath = $"identity/v2/manage/account/{uid}/reauth/pin"; - return ConfigureAndExecute<PostValidationResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(eventBasedMultiFactorToken)); + return await ConfigureAndExecute<PostValidationResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(eventBasedMultiFactorToken)); } /// <summary> /// This API is used to validate the triggered MFA authentication flow with a password. @@ -255,7 +256,7 @@ public ApiResponse<PostValidationResponse> VerifyMultiFactorPINReauthentication( /// <returns>Response containing Definition response of MFA reauthentication</returns> /// 42.13 - public ApiResponse<EventBasedMultiFactorAuthenticationToken> VerifyPINAuthentication(string accessToken, PINAuthEventBasedAuthModelWithLockout pINAuthEventBasedAuthModelWithLockout, + public async Task<ApiResponse<EventBasedMultiFactorAuthenticationToken>> VerifyPINAuthentication(string accessToken, PINAuthEventBasedAuthModelWithLockout pINAuthEventBasedAuthModelWithLockout, string smsTemplate2FA = null) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -278,7 +279,7 @@ public ApiResponse<EventBasedMultiFactorAuthenticationToken> VerifyPINAuthentica var resourcePath = "identity/v2/auth/account/reauth/pin"; - return ConfigureAndExecute<EventBasedMultiFactorAuthenticationToken>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(pINAuthEventBasedAuthModelWithLockout)); + return await ConfigureAndExecute<EventBasedMultiFactorAuthenticationToken>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(pINAuthEventBasedAuthModelWithLockout)); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Advanced/WebHookApi.cs b/Source/LoginRadiusSDK.V2/Api/Advanced/WebHookApi.cs index 12adbf4..db5bed5 100644 --- a/Source/LoginRadiusSDK.V2/Api/Advanced/WebHookApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Advanced/WebHookApi.cs @@ -10,6 +10,7 @@ using LoginRadiusSDK.V2.Util; using LoginRadiusSDK.V2.Models.ResponseModels; using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Advanced { @@ -22,7 +23,7 @@ public class WebHookApi : LoginRadiusResource /// <returns>Response Containing List of Webhhook Data</returns> /// 40.1 - public ApiResponse<ListData<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.WebHookSubscribeModel>> GetWebHookSubscribedURLs(string @event) + public async Task<ApiResponse<ListData<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.WebHookSubscribeModel>>> GetWebHookSubscribedURLs(string @event) { if (string.IsNullOrWhiteSpace(@event)) { @@ -37,7 +38,7 @@ public class WebHookApi : LoginRadiusResource var resourcePath = "api/v2/webhook"; - return ConfigureAndExecute<ListData<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.WebHookSubscribeModel>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<ListData<LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects.WebHookSubscribeModel>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// API can be used to configure a WebHook on your LoginRadius site. Webhooks also work on subscribe and notification model, subscribe your hook and get a notification. Equivalent to RESThook but these provide security on basis of signature and RESThook work on unique URL. Following are the events that are allowed by LoginRadius to trigger a WebHook service call. @@ -46,7 +47,7 @@ public class WebHookApi : LoginRadiusResource /// <returns>Response containing Definition of Complete Validation data</returns> /// 40.2 - public ApiResponse<PostResponse> WebHookSubscribe(LoginRadiusSDK.V2.Models.RequestModels.WebHookSubscribeModel webHookSubscribeModel) + public async Task<ApiResponse<PostResponse>> WebHookSubscribe(LoginRadiusSDK.V2.Models.RequestModels.WebHookSubscribeModel webHookSubscribeModel) { if (webHookSubscribeModel == null) { @@ -60,7 +61,7 @@ public ApiResponse<PostResponse> WebHookSubscribe(LoginRadiusSDK.V2.Models.Reque var resourcePath = "api/v2/webhook"; - return ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(webHookSubscribeModel)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(webHookSubscribeModel)); } /// <summary> /// API can be used to test a subscribed WebHook. @@ -68,7 +69,7 @@ public ApiResponse<PostResponse> WebHookSubscribe(LoginRadiusSDK.V2.Models.Reque /// <returns>Response containing Definition of Complete Validation data</returns> /// 40.3 - public ApiResponse<EntityPermissionAcknowledgement> WebhookTest() + public async Task<ApiResponse<EntityPermissionAcknowledgement>> WebhookTest() { var queryParameters = new QueryParameters { @@ -78,7 +79,7 @@ public ApiResponse<EntityPermissionAcknowledgement> WebhookTest() var resourcePath = "api/v2/webhook/test"; - return ConfigureAndExecute<EntityPermissionAcknowledgement>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<EntityPermissionAcknowledgement>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// API can be used to unsubscribe a WebHook configured on your LoginRadius site. @@ -87,7 +88,7 @@ public ApiResponse<EntityPermissionAcknowledgement> WebhookTest() /// <returns>Response containing Definition of Delete Request</returns> /// 40.4 - public ApiResponse<DeleteResponse> WebHookUnsubscribe(LoginRadiusSDK.V2.Models.RequestModels.WebHookSubscribeModel webHookSubscribeModel) + public async Task<ApiResponse<DeleteResponse>> WebHookUnsubscribe(LoginRadiusSDK.V2.Models.RequestModels.WebHookSubscribeModel webHookSubscribeModel) { if (webHookSubscribeModel == null) { @@ -101,7 +102,7 @@ public ApiResponse<DeleteResponse> WebHookUnsubscribe(LoginRadiusSDK.V2.Models.R var resourcePath = "api/v2/webhook"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(webHookSubscribeModel)); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(webHookSubscribeModel)); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Authentication/AuthenticationApi.cs b/Source/LoginRadiusSDK.V2/Api/Authentication/AuthenticationApi.cs index 52cdc10..c8bc76a 100644 --- a/Source/LoginRadiusSDK.V2/Api/Authentication/AuthenticationApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Authentication/AuthenticationApi.cs @@ -13,6 +13,7 @@ using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; using LoginRadiusSDK.V2.Models.RequestModels; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Authentication { @@ -31,7 +32,7 @@ public class AuthenticationApi : LoginRadiusResource /// <returns>Response containing Definition of Complete Validation and UserProfile data</returns> /// 5.4 - public ApiResponse<UserProfilePostResponse<Identity>> UpdateProfileByAccessToken(string accessToken, object payload, + public async Task<ApiResponse<UserProfilePostResponse<Identity>>> UpdateProfileByAccessToken(string accessToken, object payload, string emailTemplate = null, string fields = "", bool? nullSupport = null, string smsTemplate = null, string verificationUrl = null) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -70,7 +71,7 @@ public ApiResponse<UserProfilePostResponse<Identity>> UpdateProfileByAccessToken var resourcePath = "identity/v2/auth/account"; - return ConfigureAndExecute<UserProfilePostResponse<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(payload)); + return await ConfigureAndExecute<UserProfilePostResponse<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(payload)); } /// <summary> @@ -80,7 +81,7 @@ public ApiResponse<UserProfilePostResponse<Identity>> UpdateProfileByAccessToken /// <returns>Response containing Definition for Complete SecurityQuestions data</returns> /// 2.1 - public ApiResponse<List<SecurityQuestions>> GetSecurityQuestionsByEmail(string email) + public async Task<ApiResponse<List<SecurityQuestions>>> GetSecurityQuestionsByEmail(string email) { if (string.IsNullOrWhiteSpace(email)) { @@ -94,7 +95,7 @@ public ApiResponse<List<SecurityQuestions>> GetSecurityQuestionsByEmail(string e var resourcePath = "identity/v2/auth/securityquestion/email"; - return ConfigureAndExecute<List<SecurityQuestions>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<List<SecurityQuestions>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. @@ -103,7 +104,7 @@ public ApiResponse<List<SecurityQuestions>> GetSecurityQuestionsByEmail(string e /// <returns>Response containing Definition for Complete SecurityQuestions data</returns> /// 2.2 - public ApiResponse<List<SecurityQuestions>> GetSecurityQuestionsByUserName(string userName) + public async Task<ApiResponse<List<SecurityQuestions>>> GetSecurityQuestionsByUserName(string userName) { if (string.IsNullOrWhiteSpace(userName)) { @@ -117,7 +118,7 @@ public ApiResponse<List<SecurityQuestions>> GetSecurityQuestionsByUserName(strin var resourcePath = "identity/v2/auth/securityquestion/username"; - return ConfigureAndExecute<List<SecurityQuestions>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<List<SecurityQuestions>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. @@ -126,7 +127,7 @@ public ApiResponse<List<SecurityQuestions>> GetSecurityQuestionsByUserName(strin /// <returns>Response containing Definition for Complete SecurityQuestions data</returns> /// 2.3 - public ApiResponse<List<SecurityQuestions>> GetSecurityQuestionsByPhone(string phone) + public async Task<ApiResponse<List<SecurityQuestions>>> GetSecurityQuestionsByPhone(string phone) { if (string.IsNullOrWhiteSpace(phone)) { @@ -140,7 +141,7 @@ public ApiResponse<List<SecurityQuestions>> GetSecurityQuestionsByPhone(string p var resourcePath = "identity/v2/auth/securityquestion/phone"; - return ConfigureAndExecute<List<SecurityQuestions>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<List<SecurityQuestions>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. @@ -149,7 +150,7 @@ public ApiResponse<List<SecurityQuestions>> GetSecurityQuestionsByPhone(string p /// <returns>Response containing Definition for Complete SecurityQuestions data</returns> /// 2.4 - public ApiResponse<List<SecurityQuestions>> GetSecurityQuestionsByAccessToken(string accessToken) + public async Task<ApiResponse<List<SecurityQuestions>>> GetSecurityQuestionsByAccessToken(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -163,7 +164,7 @@ public ApiResponse<List<SecurityQuestions>> GetSecurityQuestionsByAccessToken(st var resourcePath = "identity/v2/auth/securityquestion/accesstoken"; - return ConfigureAndExecute<List<SecurityQuestions>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<List<SecurityQuestions>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This api validates access token, if valid then returns a response with its expiry otherwise error. @@ -172,7 +173,7 @@ public ApiResponse<List<SecurityQuestions>> GetSecurityQuestionsByAccessToken(st /// <returns>Response containing Definition of Complete Token data</returns> /// 4.1 - public ApiResponse<AccessToken> AuthValidateAccessToken(string accessToken) + public async Task<ApiResponse<AccessToken>> AuthValidateAccessToken(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -186,7 +187,7 @@ public ApiResponse<AccessToken> AuthValidateAccessToken(string accessToken) var resourcePath = "identity/v2/auth/access_token/validate"; - return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This api call invalidates the active access token or expires an access token's validity. @@ -196,7 +197,7 @@ public ApiResponse<AccessToken> AuthValidateAccessToken(string accessToken) /// <returns>Response containing Definition of Complete Validation data</returns> /// 4.2 - public ApiResponse<PostResponse> AuthInValidateAccessToken(string accessToken, bool preventRefresh = false) + public async Task<ApiResponse<PostResponse>> AuthInValidateAccessToken(string accessToken, bool preventRefresh = false) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -214,7 +215,7 @@ public ApiResponse<PostResponse> AuthInValidateAccessToken(string accessToken, b var resourcePath = "identity/v2/auth/access_token/invalidate"; - return ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This api call provide the active access token Information @@ -223,7 +224,7 @@ public ApiResponse<PostResponse> AuthInValidateAccessToken(string accessToken, b /// <returns>Response containing Definition of Token Information</returns> /// 4.3 - public ApiResponse<TokenInfoResponseModel> GetAccessTokenInfo(string accessToken) + public async Task<ApiResponse<TokenInfoResponseModel>> GetAccessTokenInfo(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -237,7 +238,7 @@ public ApiResponse<TokenInfoResponseModel> GetAccessTokenInfo(string accessToken var resourcePath = "identity/v2/auth/access_token"; - return ConfigureAndExecute<TokenInfoResponseModel>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<TokenInfoResponseModel>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API retrieves a copy of the user data based on the access_token. @@ -247,7 +248,7 @@ public ApiResponse<TokenInfoResponseModel> GetAccessTokenInfo(string accessToken /// <returns>Response containing Definition for Complete profile data</returns> /// 5.2 - public ApiResponse<Identity> GetProfileByAccessToken(string accessToken, string fields = "") + public async Task<ApiResponse<Identity>> GetProfileByAccessToken(string accessToken, string fields = "") { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -265,7 +266,7 @@ public ApiResponse<Identity> GetProfileByAccessToken(string accessToken, string var resourcePath = "identity/v2/auth/account"; - return ConfigureAndExecute<Identity>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<Identity>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API sends a welcome email @@ -275,7 +276,7 @@ public ApiResponse<Identity> GetProfileByAccessToken(string accessToken, string /// <returns>Response containing Definition of Complete Validation data</returns> /// 5.3 - public ApiResponse<PostResponse> SendWelcomeEmail(string accessToken, string welcomeEmailTemplate = null) + public async Task<ApiResponse<PostResponse>> SendWelcomeEmail(string accessToken, string welcomeEmailTemplate = null) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -293,7 +294,7 @@ public ApiResponse<PostResponse> SendWelcomeEmail(string accessToken, string wel var resourcePath = "identity/v2/auth/account/sendwelcomeemail"; - return ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to update the user's profile by passing the access_token. @@ -307,7 +308,7 @@ public ApiResponse<PostResponse> SendWelcomeEmail(string accessToken, string wel /// <returns>Response containing Definition of Complete Validation and UserProfile data</returns> /// 5.4 - public ApiResponse<UserProfilePostResponse<Identity>> UpdateProfileByAccessToken(string accessToken, UserProfileUpdateModel userProfileUpdateModel, + public async Task<ApiResponse<UserProfilePostResponse<Identity>>> UpdateProfileByAccessToken(string accessToken, UserProfileUpdateModel userProfileUpdateModel, string emailTemplate = null, string fields = "", string smsTemplate = null, string verificationUrl = null) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -342,7 +343,7 @@ public ApiResponse<UserProfilePostResponse<Identity>> UpdateProfileByAccessToken var resourcePath = "identity/v2/auth/account"; - return ConfigureAndExecute<UserProfilePostResponse<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(userProfileUpdateModel)); + return await ConfigureAndExecute<UserProfilePostResponse<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(userProfileUpdateModel)); } /// <summary> /// This API will send a confirmation email for account deletion to the customer's email when passed the customer's access token @@ -353,7 +354,7 @@ public ApiResponse<UserProfilePostResponse<Identity>> UpdateProfileByAccessToken /// <returns>Response containing Definition of Delete Request</returns> /// 5.5 - public ApiResponse<DeleteRequestAcceptResponse> DeleteAccountWithEmailConfirmation(string accessToken, string deleteUrl = null, + public async Task<ApiResponse<DeleteRequestAcceptResponse>> DeleteAccountWithEmailConfirmation(string accessToken, string deleteUrl = null, string emailTemplate = null) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -376,7 +377,7 @@ public ApiResponse<DeleteRequestAcceptResponse> DeleteAccountWithEmailConfirmati var resourcePath = "identity/v2/auth/account"; - return ConfigureAndExecute<DeleteRequestAcceptResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + return await ConfigureAndExecute<DeleteRequestAcceptResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); } /// <summary> /// This API is used to delete an account by passing it a delete token. @@ -385,7 +386,7 @@ public ApiResponse<DeleteRequestAcceptResponse> DeleteAccountWithEmailConfirmati /// <returns>Response containing Definition of Complete Validation data</returns> /// 5.6 - public ApiResponse<PostResponse> DeleteAccountByDeleteToken(string deleteToken) + public async Task<ApiResponse<PostResponse>> DeleteAccountByDeleteToken(string deleteToken) { if (string.IsNullOrWhiteSpace(deleteToken)) { @@ -399,7 +400,7 @@ public ApiResponse<PostResponse> DeleteAccountByDeleteToken(string deleteToken) var resourcePath = "identity/v2/auth/account/delete"; - return ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to allow a customer with a valid access_token to unlock their account provided that they successfully pass the prompted Bot Protection challenges. The Block or Suspend block types are not applicable for this API. For additional details see our Auth Security Configuration documentation.You are only required to pass the Post Parameters that correspond to the prompted challenges. @@ -409,7 +410,7 @@ public ApiResponse<PostResponse> DeleteAccountByDeleteToken(string deleteToken) /// <returns>Response containing Definition of Complete Validation data</returns> /// 5.15 - public ApiResponse<PostResponse> UnlockAccountByToken(string accessToken, UnlockProfileModel unlockProfileModel) + public async Task<ApiResponse<PostResponse>> UnlockAccountByToken(string accessToken, UnlockProfileModel unlockProfileModel) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -427,7 +428,7 @@ public ApiResponse<PostResponse> UnlockAccountByToken(string accessToken, Unlock var resourcePath = "identity/v2/auth/account/unlock"; - return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(unlockProfileModel)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(unlockProfileModel)); } /// <summary> /// This API is used to check the email exists or not on your site. @@ -436,7 +437,7 @@ public ApiResponse<PostResponse> UnlockAccountByToken(string accessToken, Unlock /// <returns>Response containing Definition Complete ExistResponse data</returns> /// 8.1 - public ApiResponse<ExistResponse> CheckEmailAvailability(string email) + public async Task<ApiResponse<ExistResponse>> CheckEmailAvailability(string email) { if (string.IsNullOrWhiteSpace(email)) { @@ -450,7 +451,7 @@ public ApiResponse<ExistResponse> CheckEmailAvailability(string email) var resourcePath = "identity/v2/auth/email"; - return ConfigureAndExecute<ExistResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<ExistResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to verify the email of user. Note: This API will only return the full profile if you have 'Enable auto login after email verification' set in your LoginRadius Admin Console's Email Workflow settings under 'Verification Email'. @@ -462,7 +463,7 @@ public ApiResponse<ExistResponse> CheckEmailAvailability(string email) /// <returns>Response containing Definition of Complete Validation, UserProfile data and Access Token</returns> /// 8.2 - public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> VerifyEmail(string verificationToken, string fields = "", + public async Task<ApiResponse<UserProfilePostResponse<AccessToken<Identity>>>> VerifyEmail(string verificationToken, string fields = "", string url = null, string welcomeEmailTemplate = null) { if (string.IsNullOrWhiteSpace(verificationToken)) @@ -489,7 +490,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> VerifyEmail(s var resourcePath = "identity/v2/auth/email"; - return ConfigureAndExecute<UserProfilePostResponse<AccessToken<Identity>>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<UserProfilePostResponse<AccessToken<Identity>>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to verify the email of user when the OTP Email verification flow is enabled, please note that you must contact LoginRadius to have this feature enabled. @@ -501,7 +502,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> VerifyEmail(s /// <returns>Response containing Definition of Complete Validation, UserProfile data and Access Token</returns> /// 8.3 - public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> VerifyEmailByOTP(EmailVerificationByOtpModel emailVerificationByOtpModel, string fields = "", + public async Task<ApiResponse<UserProfilePostResponse<AccessToken<Identity>>>> VerifyEmailByOTP(EmailVerificationByOtpModel emailVerificationByOtpModel, string fields = "", string url = null, string welcomeEmailTemplate = null) { if (emailVerificationByOtpModel == null) @@ -527,7 +528,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> VerifyEmailBy var resourcePath = "identity/v2/auth/email"; - return ConfigureAndExecute<UserProfilePostResponse<AccessToken<Identity>>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(emailVerificationByOtpModel)); + return await ConfigureAndExecute<UserProfilePostResponse<AccessToken<Identity>>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(emailVerificationByOtpModel)); } /// <summary> /// This API is used to add additional emails to a user's account. @@ -540,7 +541,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> VerifyEmailBy /// <returns>Response containing Definition of Complete Validation data</returns> /// 8.5 - public ApiResponse<PostResponse> AddEmail(string accessToken, string email, + public async Task<ApiResponse<PostResponse>> AddEmail(string accessToken, string email, string type, string emailTemplate = null, string verificationUrl = null) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -577,7 +578,7 @@ public ApiResponse<PostResponse> AddEmail(string accessToken, string email, var resourcePath = "identity/v2/auth/email"; - return ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API is used to remove additional emails from a user's account. @@ -587,7 +588,7 @@ public ApiResponse<PostResponse> AddEmail(string accessToken, string email, /// <returns>Response containing Definition of Delete Request</returns> /// 8.6 - public ApiResponse<DeleteResponse> RemoveEmail(string accessToken, string email) + public async Task<ApiResponse<DeleteResponse>> RemoveEmail(string accessToken, string email) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -610,7 +611,7 @@ public ApiResponse<DeleteResponse> RemoveEmail(string accessToken, string email) var resourcePath = "identity/v2/auth/email"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API retrieves a copy of the user data based on the Email @@ -623,7 +624,7 @@ public ApiResponse<DeleteResponse> RemoveEmail(string accessToken, string email) /// <returns>Response containing User Profile Data and access token</returns> /// 9.2.1 - public ApiResponse<AccessToken<Identity>> LoginByEmail(EmailAuthenticationModel emailAuthenticationModel, string emailTemplate = null, + public async Task<ApiResponse<AccessToken<Identity>>> LoginByEmail(EmailAuthenticationModel emailAuthenticationModel, string emailTemplate = null, string fields = "", string loginUrl = null, string verificationUrl = null) { if (emailAuthenticationModel == null) @@ -653,7 +654,7 @@ public ApiResponse<AccessToken<Identity>> LoginByEmail(EmailAuthenticationModel var resourcePath = "identity/v2/auth/login"; - return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(emailAuthenticationModel)); + return await ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(emailAuthenticationModel)); } /// <summary> /// This API retrieves a copy of the user data based on the Username @@ -666,7 +667,7 @@ public ApiResponse<AccessToken<Identity>> LoginByEmail(EmailAuthenticationModel /// <returns>Response containing User Profile Data and access token</returns> /// 9.2.2 - public ApiResponse<AccessToken<Identity>> LoginByUserName(UserNameAuthenticationModel userNameAuthenticationModel, string emailTemplate = null, + public async Task<ApiResponse<AccessToken<Identity>>> LoginByUserName(UserNameAuthenticationModel userNameAuthenticationModel, string emailTemplate = null, string fields = "", string loginUrl = null, string verificationUrl = null) { if (userNameAuthenticationModel == null) @@ -696,7 +697,7 @@ public ApiResponse<AccessToken<Identity>> LoginByUserName(UserNameAuthentication var resourcePath = "identity/v2/auth/login"; - return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(userNameAuthenticationModel)); + return await ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(userNameAuthenticationModel)); } /// <summary> /// This API is used to send the reset password url to a specified account. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' @@ -707,7 +708,7 @@ public ApiResponse<AccessToken<Identity>> LoginByUserName(UserNameAuthentication /// <returns>Response containing Definition of Complete Validation data</returns> /// 10.1 - public ApiResponse<PostResponse> ForgotPassword(string email, string resetPasswordUrl, + public async Task<ApiResponse<PostResponse>> ForgotPassword(string email, string resetPasswordUrl, string emailTemplate = null) { if (string.IsNullOrWhiteSpace(email)) @@ -735,7 +736,7 @@ public ApiResponse<PostResponse> ForgotPassword(string email, string resetPasswo var resourcePath = "identity/v2/auth/password"; - return ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API is used to reset password for the specified account by security question @@ -744,7 +745,7 @@ public ApiResponse<PostResponse> ForgotPassword(string email, string resetPasswo /// <returns>Response containing Definition of Validation data and access token</returns> /// 10.3.1 - public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordBySecurityAnswerAndEmail(ResetPasswordBySecurityAnswerAndEmailModel resetPasswordBySecurityAnswerAndEmailModel) + public async Task<ApiResponse<UserProfilePostResponse<AccessToken>>> ResetPasswordBySecurityAnswerAndEmail(ResetPasswordBySecurityAnswerAndEmailModel resetPasswordBySecurityAnswerAndEmailModel) { if (resetPasswordBySecurityAnswerAndEmailModel == null) { @@ -757,7 +758,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordBySecurity var resourcePath = "identity/v2/auth/password/securityanswer"; - return ConfigureAndExecute<UserProfilePostResponse<AccessToken>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordBySecurityAnswerAndEmailModel)); + return await ConfigureAndExecute<UserProfilePostResponse<AccessToken>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordBySecurityAnswerAndEmailModel)); } /// <summary> /// This API is used to reset password for the specified account by security question @@ -766,7 +767,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordBySecurity /// <returns>Response containing Definition of Validation data and access token</returns> /// 10.3.2 - public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordBySecurityAnswerAndPhone(ResetPasswordBySecurityAnswerAndPhoneModel resetPasswordBySecurityAnswerAndPhoneModel) + public async Task<ApiResponse<UserProfilePostResponse<AccessToken>>> ResetPasswordBySecurityAnswerAndPhone(ResetPasswordBySecurityAnswerAndPhoneModel resetPasswordBySecurityAnswerAndPhoneModel) { if (resetPasswordBySecurityAnswerAndPhoneModel == null) { @@ -779,7 +780,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordBySecurity var resourcePath = "identity/v2/auth/password/securityanswer"; - return ConfigureAndExecute<UserProfilePostResponse<AccessToken>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordBySecurityAnswerAndPhoneModel)); + return await ConfigureAndExecute<UserProfilePostResponse<AccessToken>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordBySecurityAnswerAndPhoneModel)); } /// <summary> /// This API is used to reset password for the specified account by security question @@ -788,7 +789,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordBySecurity /// <returns>Response containing Definition of Validation data and access token</returns> /// 10.3.3 - public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordBySecurityAnswerAndUserName(ResetPasswordBySecurityAnswerAndUserNameModel resetPasswordBySecurityAnswerAndUserNameModel) + public async Task<ApiResponse<UserProfilePostResponse<AccessToken>>> ResetPasswordBySecurityAnswerAndUserName(ResetPasswordBySecurityAnswerAndUserNameModel resetPasswordBySecurityAnswerAndUserNameModel) { if (resetPasswordBySecurityAnswerAndUserNameModel == null) { @@ -801,7 +802,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordBySecurity var resourcePath = "identity/v2/auth/password/securityanswer"; - return ConfigureAndExecute<UserProfilePostResponse<AccessToken>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordBySecurityAnswerAndUserNameModel)); + return await ConfigureAndExecute<UserProfilePostResponse<AccessToken>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordBySecurityAnswerAndUserNameModel)); } /// <summary> /// This API is used to set a new password for the specified account. @@ -810,7 +811,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordBySecurity /// <returns>Response containing Definition of Validation data and access token</returns> /// 10.7.1 - public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordByResetToken(ResetPasswordByResetTokenModel resetPasswordByResetTokenModel) + public async Task<ApiResponse<UserProfilePostResponse<AccessToken>>> ResetPasswordByResetToken(ResetPasswordByResetTokenModel resetPasswordByResetTokenModel) { if (resetPasswordByResetTokenModel == null) { @@ -823,7 +824,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordByResetTok var resourcePath = "identity/v2/auth/password/reset"; - return ConfigureAndExecute<UserProfilePostResponse<AccessToken>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordByResetTokenModel)); + return await ConfigureAndExecute<UserProfilePostResponse<AccessToken>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordByResetTokenModel)); } /// <summary> /// This API is used to set a new password for the specified account. @@ -832,7 +833,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordByResetTok /// <returns>Response containing Definition of Validation data and access token</returns> /// 10.7.2 - public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordByEmailOTP(ResetPasswordByEmailAndOtpModel resetPasswordByEmailAndOtpModel) + public async Task<ApiResponse<UserProfilePostResponse<AccessToken>>> ResetPasswordByEmailOTP(ResetPasswordByEmailAndOtpModel resetPasswordByEmailAndOtpModel) { if (resetPasswordByEmailAndOtpModel == null) { @@ -845,7 +846,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordByEmailOTP var resourcePath = "identity/v2/auth/password/reset"; - return ConfigureAndExecute<UserProfilePostResponse<AccessToken>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordByEmailAndOtpModel)); + return await ConfigureAndExecute<UserProfilePostResponse<AccessToken>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordByEmailAndOtpModel)); } /// <summary> /// This API is used to set a new password for the specified account if you are using the username as the unique identifier in your workflow @@ -854,7 +855,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordByEmailOTP /// <returns>Response containing Definition of Validation data and access token</returns> /// 10.7.3 - public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordByOTPAndUserName(ResetPasswordByUserNameModel resetPasswordByUserNameModel) + public async Task<ApiResponse<UserProfilePostResponse<AccessToken>>> ResetPasswordByOTPAndUserName(ResetPasswordByUserNameModel resetPasswordByUserNameModel) { if (resetPasswordByUserNameModel == null) { @@ -867,7 +868,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordByOTPAndUs var resourcePath = "identity/v2/auth/password/reset"; - return ConfigureAndExecute<UserProfilePostResponse<AccessToken>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordByUserNameModel)); + return await ConfigureAndExecute<UserProfilePostResponse<AccessToken>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordByUserNameModel)); } /// <summary> /// This API is used to change the accounts password based on the previous password @@ -878,7 +879,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken>> ResetPasswordByOTPAndUs /// <returns>Response containing Definition of Complete Validation data</returns> /// 10.8 - public ApiResponse<PostResponse> ChangePassword(string accessToken, string newPassword, + public async Task<ApiResponse<PostResponse>> ChangePassword(string accessToken, string newPassword, string oldPassword) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -907,7 +908,7 @@ public ApiResponse<PostResponse> ChangePassword(string accessToken, string newPa var resourcePath = "identity/v2/auth/password/change"; - return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API is used to link up a social provider account with the specified account based on the access token and the social providers user access token. @@ -917,7 +918,7 @@ public ApiResponse<PostResponse> ChangePassword(string accessToken, string newPa /// <returns>Response containing Definition of Complete Validation data</returns> /// 12.1 - public ApiResponse<PostResponse> LinkSocialIdentities(string accessToken, string candidateToken) + public async Task<ApiResponse<PostResponse>> LinkSocialIdentities(string accessToken, string candidateToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -940,7 +941,7 @@ public ApiResponse<PostResponse> LinkSocialIdentities(string accessToken, string var resourcePath = "identity/v2/auth/socialidentity"; - return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API is used to unlink up a social provider account with the specified account based on the access token and the social providers user access token. The unlinked account will automatically get removed from your database. @@ -951,7 +952,7 @@ public ApiResponse<PostResponse> LinkSocialIdentities(string accessToken, string /// <returns>Response containing Definition of Delete Request</returns> /// 12.2 - public ApiResponse<DeleteResponse> UnlinkSocialIdentities(string accessToken, string provider, + public async Task<ApiResponse<DeleteResponse>> UnlinkSocialIdentities(string accessToken, string provider, string providerId) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -980,7 +981,7 @@ public ApiResponse<DeleteResponse> UnlinkSocialIdentities(string accessToken, st var resourcePath = "identity/v2/auth/socialidentity"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API is called just after account linking API and it prevents the raas profile of the second account from getting created. @@ -990,7 +991,7 @@ public ApiResponse<DeleteResponse> UnlinkSocialIdentities(string accessToken, st /// <returns>Response containing Definition for Complete SocialUserProfile data</returns> /// 12.3 - public ApiResponse<SocialUserProfile> GetSocialIdentity(string accessToken, string fields = "") + public async Task<ApiResponse<SocialUserProfile>> GetSocialIdentity(string accessToken, string fields = "") { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -1008,7 +1009,7 @@ public ApiResponse<SocialUserProfile> GetSocialIdentity(string accessToken, stri var resourcePath = "identity/v2/auth/socialidentity"; - return ConfigureAndExecute<SocialUserProfile>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<SocialUserProfile>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to set or change UserName by access token. @@ -1018,7 +1019,7 @@ public ApiResponse<SocialUserProfile> GetSocialIdentity(string accessToken, stri /// <returns>Response containing Definition of Complete Validation data</returns> /// 13.1 - public ApiResponse<PostResponse> SetOrChangeUserName(string accessToken, string username) + public async Task<ApiResponse<PostResponse>> SetOrChangeUserName(string accessToken, string username) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -1041,7 +1042,7 @@ public ApiResponse<PostResponse> SetOrChangeUserName(string accessToken, string var resourcePath = "identity/v2/auth/username"; - return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API is used to check the UserName exists or not on your site. @@ -1050,7 +1051,7 @@ public ApiResponse<PostResponse> SetOrChangeUserName(string accessToken, string /// <returns>Response containing Definition Complete ExistResponse data</returns> /// 13.2 - public ApiResponse<ExistResponse> CheckUserNameAvailability(string username) + public async Task<ApiResponse<ExistResponse>> CheckUserNameAvailability(string username) { if (string.IsNullOrWhiteSpace(username)) { @@ -1064,7 +1065,7 @@ public ApiResponse<ExistResponse> CheckUserNameAvailability(string username) var resourcePath = "identity/v2/auth/username"; - return ConfigureAndExecute<ExistResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<ExistResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to update the privacy policy stored in the user's profile by providing the access_token of the user accepting the privacy policy @@ -1074,7 +1075,7 @@ public ApiResponse<ExistResponse> CheckUserNameAvailability(string username) /// <returns>Response containing Definition for Complete profile data</returns> /// 15.1 - public ApiResponse<Identity> AcceptPrivacyPolicy(string accessToken, string fields = "") + public async Task<ApiResponse<Identity>> AcceptPrivacyPolicy(string accessToken, string fields = "") { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -1092,7 +1093,7 @@ public ApiResponse<Identity> AcceptPrivacyPolicy(string accessToken, string fiel var resourcePath = "identity/v2/auth/privacypolicy/accept"; - return ConfigureAndExecute<Identity>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<Identity>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API will return all the accepted privacy policies for the user by providing the access_token of that user. @@ -1101,7 +1102,7 @@ public ApiResponse<Identity> AcceptPrivacyPolicy(string accessToken, string fiel /// <returns>Complete Policy History data</returns> /// 15.2 - public ApiResponse<PrivacyPolicyHistoryResponse> GetPrivacyPolicyHistoryByAccessToken(string accessToken) + public async Task<ApiResponse<PrivacyPolicyHistoryResponse>> GetPrivacyPolicyHistoryByAccessToken(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -1115,7 +1116,7 @@ public ApiResponse<PrivacyPolicyHistoryResponse> GetPrivacyPolicyHistoryByAccess var resourcePath = "identity/v2/auth/privacypolicy/history"; - return ConfigureAndExecute<PrivacyPolicyHistoryResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<PrivacyPolicyHistoryResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API creates a user in the database as well as sends a verification email to the user. @@ -1130,7 +1131,7 @@ public ApiResponse<PrivacyPolicyHistoryResponse> GetPrivacyPolicyHistoryByAccess /// <returns>Response containing Definition of Complete Validation, UserProfile data and Access Token</returns> /// 17.1.1 - public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> UserRegistrationByEmail(AuthUserRegistrationModel authUserRegistrationModel, string sott, + public async Task<ApiResponse<UserProfilePostResponse<AccessToken<Identity>>>> UserRegistrationByEmail(AuthUserRegistrationModel authUserRegistrationModel, string sott, string emailTemplate = null, string fields = "", string options = "", string verificationUrl = null, string welcomeEmailTemplate = null) { if (authUserRegistrationModel == null) @@ -1169,7 +1170,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> UserRegistrat var resourcePath = "identity/v2/auth/register"; - return ConfigureAndExecute<UserProfilePostResponse<AccessToken<Identity>>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(authUserRegistrationModel)); + return await ConfigureAndExecute<UserProfilePostResponse<AccessToken<Identity>>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(authUserRegistrationModel)); } /// <summary> /// This API creates a user in the database as well as sends a verification email to the user. @@ -1184,7 +1185,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> UserRegistrat /// <returns>Response containing Definition of Complete Validation, UserProfile data and Access Token</returns> /// 17.2 - public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> UserRegistrationByCaptcha(AuthUserRegistrationModelWithCaptcha authUserRegistrationModelWithCaptcha, string emailTemplate = null, + public async Task<ApiResponse<UserProfilePostResponse<AccessToken<Identity>>>> UserRegistrationByCaptcha(AuthUserRegistrationModelWithCaptcha authUserRegistrationModelWithCaptcha, string emailTemplate = null, string fields = "", string options = "", string smsTemplate = null, string verificationUrl = null, string welcomeEmailTemplate = null) { if (authUserRegistrationModelWithCaptcha == null) @@ -1222,7 +1223,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> UserRegistrat var resourcePath = "identity/v2/auth/register/captcha"; - return ConfigureAndExecute<UserProfilePostResponse<AccessToken<Identity>>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(authUserRegistrationModelWithCaptcha)); + return await ConfigureAndExecute<UserProfilePostResponse<AccessToken<Identity>>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(authUserRegistrationModelWithCaptcha)); } /// <summary> /// This API resends the verification email to the user. @@ -1233,7 +1234,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> UserRegistrat /// <returns>Response containing Definition of Complete Validation data</returns> /// 17.3 - public ApiResponse<PostResponse> AuthResendEmailVerification(string email, string emailTemplate = null, + public async Task<ApiResponse<PostResponse>> AuthResendEmailVerification(string email, string emailTemplate = null, string verificationUrl = null) { if (string.IsNullOrWhiteSpace(email)) @@ -1260,7 +1261,7 @@ public ApiResponse<PostResponse> AuthResendEmailVerification(string email, strin var resourcePath = "identity/v2/auth/register"; - return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Authentication/OneTouchLoginApi.cs b/Source/LoginRadiusSDK.V2/Api/Authentication/OneTouchLoginApi.cs index 79d7051..a246949 100644 --- a/Source/LoginRadiusSDK.V2/Api/Authentication/OneTouchLoginApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Authentication/OneTouchLoginApi.cs @@ -12,6 +12,7 @@ using LoginRadiusSDK.V2.Models.RequestModels; using LoginRadiusSDK.V2.Models.ResponseModels; using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Authentication { @@ -27,7 +28,7 @@ public class OneTouchLoginApi : LoginRadiusResource /// <returns>Response containing Definition of Complete Validation data</returns> /// 1.2 - public ApiResponse<PostResponse> OneTouchLoginByEmail(OneTouchLoginByEmailModel oneTouchLoginByEmailModel, string oneTouchLoginEmailTemplate = null, + public async Task<ApiResponse<PostResponse>> OneTouchLoginByEmail(OneTouchLoginByEmailModel oneTouchLoginByEmailModel, string oneTouchLoginEmailTemplate = null, string redirecturl = null, string welcomeemailtemplate = null) { if (oneTouchLoginByEmailModel == null) @@ -53,7 +54,7 @@ public ApiResponse<PostResponse> OneTouchLoginByEmail(OneTouchLoginByEmailModel var resourcePath = "identity/v2/auth/onetouchlogin/email"; - return ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(oneTouchLoginByEmailModel)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(oneTouchLoginByEmailModel)); } /// <summary> /// This API is used to send one time password to a given phone number for a frictionless login/registration. @@ -63,7 +64,7 @@ public ApiResponse<PostResponse> OneTouchLoginByEmail(OneTouchLoginByEmailModel /// <returns>Response containing Definition of Complete Validation data</returns> /// 1.4 - public ApiResponse<PostResponse> OneTouchLoginByPhone(OneTouchLoginByPhoneModel oneTouchLoginByPhoneModel, string smsTemplate = null) + public async Task<ApiResponse<PostResponse>> OneTouchLoginByPhone(OneTouchLoginByPhoneModel oneTouchLoginByPhoneModel, string smsTemplate = null) { if (oneTouchLoginByPhoneModel == null) { @@ -80,7 +81,7 @@ public ApiResponse<PostResponse> OneTouchLoginByPhone(OneTouchLoginByPhoneModel var resourcePath = "identity/v2/auth/onetouchlogin/phone"; - return ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(oneTouchLoginByPhoneModel)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(oneTouchLoginByPhoneModel)); } /// <summary> /// This API is used to verify the otp for One Touch Login. @@ -92,7 +93,7 @@ public ApiResponse<PostResponse> OneTouchLoginByPhone(OneTouchLoginByPhoneModel /// <returns>Response Containing Access Token and Complete Profile Data</returns> /// 1.5 - public ApiResponse<AccessToken<UserProfile>> OneTouchLoginOTPVerification(string otp, string phone, + public async Task<ApiResponse<AccessToken<UserProfile>>> OneTouchLoginOTPVerification(string otp, string phone, string fields = "", string smsTemplate = null) { if (string.IsNullOrWhiteSpace(otp)) @@ -124,7 +125,7 @@ public ApiResponse<AccessToken<UserProfile>> OneTouchLoginOTPVerification(string var resourcePath = "identity/v2/auth/onetouchlogin/phone/verify"; - return ConfigureAndExecute<AccessToken<UserProfile>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<AccessToken<UserProfile>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API verifies the provided token for One Touch Login @@ -134,7 +135,7 @@ public ApiResponse<AccessToken<UserProfile>> OneTouchLoginOTPVerification(string /// <returns>Complete verified response data</returns> /// 8.4.2 - public ApiResponse<VerifiedResponse> OneTouchEmailVerification(string verificationToken, string welcomeEmailTemplate = null) + public async Task<ApiResponse<VerifiedResponse>> OneTouchEmailVerification(string verificationToken, string welcomeEmailTemplate = null) { if (string.IsNullOrWhiteSpace(verificationToken)) { @@ -152,7 +153,7 @@ public ApiResponse<VerifiedResponse> OneTouchEmailVerification(string verificati var resourcePath = "identity/v2/auth/email/onetouchlogin"; - return ConfigureAndExecute<VerifiedResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<VerifiedResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to check if the One Touch Login link has been clicked or not. @@ -162,7 +163,7 @@ public ApiResponse<VerifiedResponse> OneTouchEmailVerification(string verificati /// <returns>Response containing User Profile Data and access token</returns> /// 9.21.2 - public ApiResponse<AccessToken<Identity>> OneTouchLoginPing(string clientGuid, string fields = "") + public async Task<ApiResponse<AccessToken<Identity>>> OneTouchLoginPing(string clientGuid, string fields = "") { if (string.IsNullOrWhiteSpace(clientGuid)) { @@ -180,7 +181,7 @@ public ApiResponse<AccessToken<Identity>> OneTouchLoginPing(string clientGuid, s var resourcePath = "identity/v2/auth/login/smartlogin/ping"; - return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.GET, resourcePath, queryParameters, null); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Authentication/PINAuthenticationApi.cs b/Source/LoginRadiusSDK.V2/Api/Authentication/PINAuthenticationApi.cs index 0ecd69e..1dd3e0f 100644 --- a/Source/LoginRadiusSDK.V2/Api/Authentication/PINAuthenticationApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Authentication/PINAuthenticationApi.cs @@ -12,6 +12,7 @@ using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; using LoginRadiusSDK.V2.Models.RequestModels; using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Authentication { @@ -25,7 +26,7 @@ public class PINAuthenticationApi : LoginRadiusResource /// <returns>Response containing User Profile Data and access token</returns> /// 9.22 - public ApiResponse<AccessToken<Identity>> PINLogin(LoginByPINModel loginByPINModel, string sessionToken) + public async Task<ApiResponse<AccessToken<Identity>>> PINLogin(LoginByPINModel loginByPINModel, string sessionToken) { if (loginByPINModel == null) { @@ -43,7 +44,7 @@ public ApiResponse<AccessToken<Identity>> PINLogin(LoginByPINModel loginByPINMod var resourcePath = "identity/v2/auth/login/pin"; - return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(loginByPINModel)); + return await ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(loginByPINModel)); } /// <summary> /// This API sends the reset pin email to specified email address. @@ -54,7 +55,7 @@ public ApiResponse<AccessToken<Identity>> PINLogin(LoginByPINModel loginByPINMod /// <returns>Response containing Definition of Complete Validation data</returns> /// 42.1 - public ApiResponse<PostResponse> SendForgotPINEmailByEmail(ForgotPINLinkByEmailModel forgotPINLinkByEmailModel, string emailTemplate = null, + public async Task<ApiResponse<PostResponse>> SendForgotPINEmailByEmail(ForgotPINLinkByEmailModel forgotPINLinkByEmailModel, string emailTemplate = null, string resetPINUrl = null) { if (forgotPINLinkByEmailModel == null) @@ -76,7 +77,7 @@ public ApiResponse<PostResponse> SendForgotPINEmailByEmail(ForgotPINLinkByEmailM var resourcePath = "identity/v2/auth/pin/forgot/email"; - return ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(forgotPINLinkByEmailModel)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(forgotPINLinkByEmailModel)); } /// <summary> /// This API sends the reset pin email using username. @@ -87,7 +88,7 @@ public ApiResponse<PostResponse> SendForgotPINEmailByEmail(ForgotPINLinkByEmailM /// <returns>Response containing Definition of Complete Validation data</returns> /// 42.2 - public ApiResponse<PostResponse> SendForgotPINEmailByUsername(ForgotPINLinkByUserNameModel forgotPINLinkByUserNameModel, string emailTemplate = null, + public async Task<ApiResponse<PostResponse>> SendForgotPINEmailByUsername(ForgotPINLinkByUserNameModel forgotPINLinkByUserNameModel, string emailTemplate = null, string resetPINUrl = null) { if (forgotPINLinkByUserNameModel == null) @@ -109,7 +110,7 @@ public ApiResponse<PostResponse> SendForgotPINEmailByUsername(ForgotPINLinkByUse var resourcePath = "identity/v2/auth/pin/forgot/username"; - return ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(forgotPINLinkByUserNameModel)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(forgotPINLinkByUserNameModel)); } /// <summary> /// This API is used to reset pin using reset token. @@ -118,7 +119,7 @@ public ApiResponse<PostResponse> SendForgotPINEmailByUsername(ForgotPINLinkByUse /// <returns>Response containing Definition of Complete Validation data</returns> /// 42.3 - public ApiResponse<PostResponse> ResetPINByResetToken(ResetPINByResetToken resetPINByResetToken) + public async Task<ApiResponse<PostResponse>> ResetPINByResetToken(ResetPINByResetToken resetPINByResetToken) { if (resetPINByResetToken == null) { @@ -131,7 +132,7 @@ public ApiResponse<PostResponse> ResetPINByResetToken(ResetPINByResetToken reset var resourcePath = "identity/v2/auth/pin/reset/token"; - return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPINByResetToken)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPINByResetToken)); } /// <summary> /// This API is used to reset pin using security question answer and email. @@ -140,7 +141,7 @@ public ApiResponse<PostResponse> ResetPINByResetToken(ResetPINByResetToken reset /// <returns>Response containing Definition of Complete Validation data</returns> /// 42.4 - public ApiResponse<PostResponse> ResetPINByEmailAndSecurityAnswer(ResetPINBySecurityQuestionAnswerAndEmailModel resetPINBySecurityQuestionAnswerAndEmailModel) + public async Task<ApiResponse<PostResponse>> ResetPINByEmailAndSecurityAnswer(ResetPINBySecurityQuestionAnswerAndEmailModel resetPINBySecurityQuestionAnswerAndEmailModel) { if (resetPINBySecurityQuestionAnswerAndEmailModel == null) { @@ -153,7 +154,7 @@ public ApiResponse<PostResponse> ResetPINByEmailAndSecurityAnswer(ResetPINBySecu var resourcePath = "identity/v2/auth/pin/reset/securityanswer/email"; - return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPINBySecurityQuestionAnswerAndEmailModel)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPINBySecurityQuestionAnswerAndEmailModel)); } /// <summary> /// This API is used to reset pin using security question answer and username. @@ -162,7 +163,7 @@ public ApiResponse<PostResponse> ResetPINByEmailAndSecurityAnswer(ResetPINBySecu /// <returns>Response containing Definition of Complete Validation data</returns> /// 42.5 - public ApiResponse<PostResponse> ResetPINByUsernameAndSecurityAnswer(ResetPINBySecurityQuestionAnswerAndUsernameModel resetPINBySecurityQuestionAnswerAndUsernameModel) + public async Task<ApiResponse<PostResponse>> ResetPINByUsernameAndSecurityAnswer(ResetPINBySecurityQuestionAnswerAndUsernameModel resetPINBySecurityQuestionAnswerAndUsernameModel) { if (resetPINBySecurityQuestionAnswerAndUsernameModel == null) { @@ -175,7 +176,7 @@ public ApiResponse<PostResponse> ResetPINByUsernameAndSecurityAnswer(ResetPINByS var resourcePath = "identity/v2/auth/pin/reset/securityanswer/username"; - return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPINBySecurityQuestionAnswerAndUsernameModel)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPINBySecurityQuestionAnswerAndUsernameModel)); } /// <summary> /// This API is used to reset pin using security question answer and phone. @@ -184,7 +185,7 @@ public ApiResponse<PostResponse> ResetPINByUsernameAndSecurityAnswer(ResetPINByS /// <returns>Response containing Definition of Complete Validation data</returns> /// 42.6 - public ApiResponse<PostResponse> ResetPINByPhoneAndSecurityAnswer(ResetPINBySecurityQuestionAnswerAndPhoneModel resetPINBySecurityQuestionAnswerAndPhoneModel) + public async Task<ApiResponse<PostResponse>> ResetPINByPhoneAndSecurityAnswer(ResetPINBySecurityQuestionAnswerAndPhoneModel resetPINBySecurityQuestionAnswerAndPhoneModel) { if (resetPINBySecurityQuestionAnswerAndPhoneModel == null) { @@ -197,7 +198,7 @@ public ApiResponse<PostResponse> ResetPINByPhoneAndSecurityAnswer(ResetPINBySecu var resourcePath = "identity/v2/auth/pin/reset/securityanswer/phone"; - return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPINBySecurityQuestionAnswerAndPhoneModel)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPINBySecurityQuestionAnswerAndPhoneModel)); } /// <summary> /// This API sends the OTP to specified phone number @@ -207,7 +208,7 @@ public ApiResponse<PostResponse> ResetPINByPhoneAndSecurityAnswer(ResetPINBySecu /// <returns>Response Containing Validation Data and SMS Data</returns> /// 42.7 - public ApiResponse<UserProfilePostResponse<SMSResponseData>> SendForgotPINSMSByPhone(ForgotPINOtpByPhoneModel forgotPINOtpByPhoneModel, string smsTemplate = null) + public async Task<ApiResponse<UserProfilePostResponse<SMSResponseData>>> SendForgotPINSMSByPhone(ForgotPINOtpByPhoneModel forgotPINOtpByPhoneModel, string smsTemplate = null) { if (forgotPINOtpByPhoneModel == null) { @@ -224,7 +225,7 @@ public ApiResponse<UserProfilePostResponse<SMSResponseData>> SendForgotPINSMSByP var resourcePath = "identity/v2/auth/pin/forgot/otp"; - return ConfigureAndExecute<UserProfilePostResponse<SMSResponseData>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(forgotPINOtpByPhoneModel)); + return await ConfigureAndExecute<UserProfilePostResponse<SMSResponseData>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(forgotPINOtpByPhoneModel)); } /// <summary> /// This API is used to change a user's PIN using access token. @@ -234,7 +235,7 @@ public ApiResponse<UserProfilePostResponse<SMSResponseData>> SendForgotPINSMSByP /// <returns>Response containing Definition of Complete Validation data</returns> /// 42.8 - public ApiResponse<PostResponse> ChangePINByAccessToken(string accessToken, ChangePINModel changePINModel) + public async Task<ApiResponse<PostResponse>> ChangePINByAccessToken(string accessToken, ChangePINModel changePINModel) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -252,7 +253,7 @@ public ApiResponse<PostResponse> ChangePINByAccessToken(string accessToken, Chan var resourcePath = "identity/v2/auth/pin/change"; - return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(changePINModel)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(changePINModel)); } /// <summary> /// This API is used to reset pin using phoneId and OTP. @@ -261,7 +262,7 @@ public ApiResponse<PostResponse> ChangePINByAccessToken(string accessToken, Chan /// <returns>Response containing Definition of Complete Validation data</returns> /// 42.9 - public ApiResponse<PostResponse> ResetPINByPhoneAndOtp(ResetPINByPhoneAndOTPModel resetPINByPhoneAndOTPModel) + public async Task<ApiResponse<PostResponse>> ResetPINByPhoneAndOtp(ResetPINByPhoneAndOTPModel resetPINByPhoneAndOTPModel) { if (resetPINByPhoneAndOTPModel == null) { @@ -274,7 +275,7 @@ public ApiResponse<PostResponse> ResetPINByPhoneAndOtp(ResetPINByPhoneAndOTPMode var resourcePath = "identity/v2/auth/pin/reset/otp/phone"; - return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPINByPhoneAndOTPModel)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPINByPhoneAndOTPModel)); } /// <summary> /// This API is used to reset pin using email and OTP. @@ -283,7 +284,7 @@ public ApiResponse<PostResponse> ResetPINByPhoneAndOtp(ResetPINByPhoneAndOTPMode /// <returns>Response containing Definition of Complete Validation data</returns> /// 42.10 - public ApiResponse<PostResponse> ResetPINByEmailAndOtp(ResetPINByEmailAndOtpModel resetPINByEmailAndOtpModel) + public async Task<ApiResponse<PostResponse>> ResetPINByEmailAndOtp(ResetPINByEmailAndOtpModel resetPINByEmailAndOtpModel) { if (resetPINByEmailAndOtpModel == null) { @@ -296,7 +297,7 @@ public ApiResponse<PostResponse> ResetPINByEmailAndOtp(ResetPINByEmailAndOtpMode var resourcePath = "identity/v2/auth/pin/reset/otp/email"; - return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPINByEmailAndOtpModel)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPINByEmailAndOtpModel)); } /// <summary> /// This API is used to reset pin using username and OTP. @@ -305,7 +306,7 @@ public ApiResponse<PostResponse> ResetPINByEmailAndOtp(ResetPINByEmailAndOtpMode /// <returns>Response containing Definition of Complete Validation data</returns> /// 42.11 - public ApiResponse<PostResponse> ResetPINByUsernameAndOtp(ResetPINByUsernameAndOtpModel resetPINByUsernameAndOtpModel) + public async Task<ApiResponse<PostResponse>> ResetPINByUsernameAndOtp(ResetPINByUsernameAndOtpModel resetPINByUsernameAndOtpModel) { if (resetPINByUsernameAndOtpModel == null) { @@ -318,7 +319,7 @@ public ApiResponse<PostResponse> ResetPINByUsernameAndOtp(ResetPINByUsernameAndO var resourcePath = "identity/v2/auth/pin/reset/otp/username"; - return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPINByUsernameAndOtpModel)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPINByUsernameAndOtpModel)); } /// <summary> /// This API is used to change a user's PIN using Pin Auth token. @@ -328,7 +329,7 @@ public ApiResponse<PostResponse> ResetPINByUsernameAndOtp(ResetPINByUsernameAndO /// <returns>Response containing User Profile Data and access token</returns> /// 42.12 - public ApiResponse<AccessToken<Identity>> SetPINByPinAuthToken(PINRequiredModel pINRequiredModel, string pinAuthToken) + public async Task<ApiResponse<AccessToken<Identity>>> SetPINByPinAuthToken(PINRequiredModel pINRequiredModel, string pinAuthToken) { if (pINRequiredModel == null) { @@ -346,7 +347,7 @@ public ApiResponse<AccessToken<Identity>> SetPINByPinAuthToken(PINRequiredModel var resourcePath = "identity/v2/auth/pin/set/pinauthtoken"; - return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(pINRequiredModel)); + return await ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(pINRequiredModel)); } /// <summary> /// This API is used to invalidate pin session token. @@ -355,7 +356,7 @@ public ApiResponse<AccessToken<Identity>> SetPINByPinAuthToken(PINRequiredModel /// <returns>Response containing Definition of Complete Validation data</returns> /// 44.1 - public ApiResponse<PostResponse> InValidatePinSessionToken(string sessionToken) + public async Task<ApiResponse<PostResponse>> InValidatePinSessionToken(string sessionToken) { if (string.IsNullOrWhiteSpace(sessionToken)) { @@ -369,7 +370,7 @@ public ApiResponse<PostResponse> InValidatePinSessionToken(string sessionToken) var resourcePath = "identity/v2/auth/session_token/invalidate"; - return ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Authentication/PasswordLessLoginApi.cs b/Source/LoginRadiusSDK.V2/Api/Authentication/PasswordLessLoginApi.cs index 56ab71e..12f4c9f 100644 --- a/Source/LoginRadiusSDK.V2/Api/Authentication/PasswordLessLoginApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Authentication/PasswordLessLoginApi.cs @@ -12,6 +12,7 @@ using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; using LoginRadiusSDK.V2.Models.RequestModels; using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Authentication { @@ -26,7 +27,7 @@ public class PasswordLessLoginApi : LoginRadiusResource /// <returns>Response containing User Profile Data and access token</returns> /// 9.6 - public ApiResponse<AccessToken<Identity>> PasswordlessLoginPhoneVerification(PasswordLessLoginOtpModel passwordLessLoginOtpModel, string fields = "", + public async Task<ApiResponse<AccessToken<Identity>>> PasswordlessLoginPhoneVerification(PasswordLessLoginOtpModel passwordLessLoginOtpModel, string fields = "", string smsTemplate = null) { if (passwordLessLoginOtpModel == null) @@ -48,7 +49,7 @@ public ApiResponse<AccessToken<Identity>> PasswordlessLoginPhoneVerification(Pas var resourcePath = "identity/v2/auth/login/passwordlesslogin/otp/verify"; - return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(passwordLessLoginOtpModel)); + return await ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(passwordLessLoginOtpModel)); } /// <summary> /// API can be used to send a One-time Passcode (OTP) provided that the account has a verified PhoneID @@ -58,7 +59,7 @@ public ApiResponse<AccessToken<Identity>> PasswordlessLoginPhoneVerification(Pas /// <returns>Response Containing Definition of SMS Data</returns> /// 9.15 - public ApiResponse<GetResponse<SMSResponseData>> PasswordlessLoginByPhone(string phone, string smsTemplate = null) + public async Task<ApiResponse<GetResponse<SMSResponseData>>> PasswordlessLoginByPhone(string phone, string smsTemplate = null) { if (string.IsNullOrWhiteSpace(phone)) { @@ -76,7 +77,7 @@ public ApiResponse<GetResponse<SMSResponseData>> PasswordlessLoginByPhone(string var resourcePath = "identity/v2/auth/login/passwordlesslogin/otp"; - return ConfigureAndExecute<GetResponse<SMSResponseData>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<GetResponse<SMSResponseData>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to send a Passwordless Login verification link to the provided Email ID @@ -87,7 +88,7 @@ public ApiResponse<GetResponse<SMSResponseData>> PasswordlessLoginByPhone(string /// <returns>Response containing Definition of Complete Validation data</returns> /// 9.18.1 - public ApiResponse<PostResponse> PasswordlessLoginByEmail(string email, string passwordLessLoginTemplate = null, + public async Task<ApiResponse<PostResponse>> PasswordlessLoginByEmail(string email, string passwordLessLoginTemplate = null, string verificationUrl = null) { if (string.IsNullOrWhiteSpace(email)) @@ -110,7 +111,7 @@ public ApiResponse<PostResponse> PasswordlessLoginByEmail(string email, string p var resourcePath = "identity/v2/auth/login/passwordlesslogin/email"; - return ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to send a Passwordless Login Verification Link to a customer by providing their UserName @@ -121,7 +122,7 @@ public ApiResponse<PostResponse> PasswordlessLoginByEmail(string email, string p /// <returns>Response containing Definition of Complete Validation data</returns> /// 9.18.2 - public ApiResponse<PostResponse> PasswordlessLoginByUserName(string username, string passwordLessLoginTemplate = null, + public async Task<ApiResponse<PostResponse>> PasswordlessLoginByUserName(string username, string passwordLessLoginTemplate = null, string verificationUrl = null) { if (string.IsNullOrWhiteSpace(username)) @@ -144,7 +145,7 @@ public ApiResponse<PostResponse> PasswordlessLoginByUserName(string username, st var resourcePath = "identity/v2/auth/login/passwordlesslogin/email"; - return ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to verify the Passwordless Login verification link. Note: If you are using Passwordless Login by Phone you will need to use the Passwordless Login Phone Verification API @@ -155,7 +156,7 @@ public ApiResponse<PostResponse> PasswordlessLoginByUserName(string username, st /// <returns>Response containing User Profile Data and access token</returns> /// 9.19 - public ApiResponse<AccessToken<Identity>> PasswordlessLoginVerification(string verificationToken, string fields = "", + public async Task<ApiResponse<AccessToken<Identity>>> PasswordlessLoginVerification(string verificationToken, string fields = "", string welcomeEmailTemplate = null) { if (string.IsNullOrWhiteSpace(verificationToken)) @@ -178,7 +179,7 @@ public ApiResponse<AccessToken<Identity>> PasswordlessLoginVerification(string v var resourcePath = "identity/v2/auth/login/passwordlesslogin/email/verify"; - return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.GET, resourcePath, queryParameters, null); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Authentication/PhoneAuthenticationApi.cs b/Source/LoginRadiusSDK.V2/Api/Authentication/PhoneAuthenticationApi.cs index afdde02..f1cf978 100644 --- a/Source/LoginRadiusSDK.V2/Api/Authentication/PhoneAuthenticationApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Authentication/PhoneAuthenticationApi.cs @@ -12,6 +12,7 @@ using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; using LoginRadiusSDK.V2.Models.RequestModels; using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Authentication { @@ -27,7 +28,7 @@ public class PhoneAuthenticationApi : LoginRadiusResource /// <returns>Response containing User Profile Data and access token</returns> /// 9.2.3 - public ApiResponse<AccessToken<Identity>> LoginByPhone(PhoneAuthenticationModel phoneAuthenticationModel, string fields = "", + public async Task<ApiResponse<AccessToken<Identity>>> LoginByPhone(PhoneAuthenticationModel phoneAuthenticationModel, string fields = "", string loginUrl = null, string smsTemplate = null) { if (phoneAuthenticationModel == null) @@ -53,7 +54,7 @@ public ApiResponse<AccessToken<Identity>> LoginByPhone(PhoneAuthenticationModel var resourcePath = "identity/v2/auth/login"; - return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(phoneAuthenticationModel)); + return await ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(phoneAuthenticationModel)); } /// <summary> /// This API is used to send the OTP to reset the account password. @@ -63,7 +64,7 @@ public ApiResponse<AccessToken<Identity>> LoginByPhone(PhoneAuthenticationModel /// <returns>Response Containing Validation Data and SMS Data</returns> /// 10.4 - public ApiResponse<UserProfilePostResponse<SMSResponseData>> ForgotPasswordByPhoneOTP(string phone, string smsTemplate = null) + public async Task<ApiResponse<UserProfilePostResponse<SMSResponseData>>> ForgotPasswordByPhoneOTP(string phone, string smsTemplate = null) { if (string.IsNullOrWhiteSpace(phone)) { @@ -85,7 +86,7 @@ public ApiResponse<UserProfilePostResponse<SMSResponseData>> ForgotPasswordByPho var resourcePath = "identity/v2/auth/password/otp"; - return ConfigureAndExecute<UserProfilePostResponse<SMSResponseData>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<UserProfilePostResponse<SMSResponseData>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API is used to reset the password @@ -94,7 +95,7 @@ public ApiResponse<UserProfilePostResponse<SMSResponseData>> ForgotPasswordByPho /// <returns>Response containing Definition of Complete Validation data</returns> /// 10.5 - public ApiResponse<PostResponse> ResetPasswordByPhoneOTP(ResetPasswordByOTPModel resetPasswordByOTPModel) + public async Task<ApiResponse<PostResponse>> ResetPasswordByPhoneOTP(ResetPasswordByOTPModel resetPasswordByOTPModel) { if (resetPasswordByOTPModel == null) { @@ -107,7 +108,7 @@ public ApiResponse<PostResponse> ResetPasswordByPhoneOTP(ResetPasswordByOTPModel var resourcePath = "identity/v2/auth/password/otp"; - return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordByOTPModel)); + return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(resetPasswordByOTPModel)); } /// <summary> /// This API is used to validate the verification code sent to verify a user's phone number @@ -119,7 +120,7 @@ public ApiResponse<PostResponse> ResetPasswordByPhoneOTP(ResetPasswordByOTPModel /// <returns>Response containing User Profile Data and access token</returns> /// 11.1.1 - public ApiResponse<AccessToken<Identity>> PhoneVerificationByOTP(string otp, string phone, + public async Task<ApiResponse<AccessToken<Identity>>> PhoneVerificationByOTP(string otp, string phone, string fields = "", string smsTemplate = null) { if (string.IsNullOrWhiteSpace(otp)) @@ -151,7 +152,7 @@ public ApiResponse<AccessToken<Identity>> PhoneVerificationByOTP(string otp, str var resourcePath = "identity/v2/auth/phone/otp"; - return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API is used to consume the verification code sent to verify a user's phone number. Use this call for front-end purposes in cases where the user is already logged in by passing the user's access token. @@ -162,7 +163,7 @@ public ApiResponse<AccessToken<Identity>> PhoneVerificationByOTP(string otp, str /// <returns>Response containing Definition of Complete Validation data</returns> /// 11.1.2 - public ApiResponse<PostResponse> PhoneVerificationOTPByAccessToken(string accessToken, string otp, + public async Task<ApiResponse<PostResponse>> PhoneVerificationOTPByAccessToken(string accessToken, string otp, string smsTemplate = null) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -186,7 +187,7 @@ public ApiResponse<PostResponse> PhoneVerificationOTPByAccessToken(string access var resourcePath = "identity/v2/auth/phone/otp"; - return ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, null); + return await ConfigureAndExecute<PostResponse>(HttpMethod.PUT, resourcePath, queryParameters, null); } /// <summary> /// This API is used to resend a verification OTP to verify a user's Phone Number. The user will receive a verification code that they will need to input @@ -196,7 +197,7 @@ public ApiResponse<PostResponse> PhoneVerificationOTPByAccessToken(string access /// <returns>Response Containing Validation Data and SMS Data</returns> /// 11.2.1 - public ApiResponse<UserProfilePostResponse<SMSResponseData>> PhoneResendVerificationOTP(string phone, string smsTemplate = null) + public async Task<ApiResponse<UserProfilePostResponse<SMSResponseData>>> PhoneResendVerificationOTP(string phone, string smsTemplate = null) { if (string.IsNullOrWhiteSpace(phone)) { @@ -218,7 +219,7 @@ public ApiResponse<UserProfilePostResponse<SMSResponseData>> PhoneResendVerifica var resourcePath = "identity/v2/auth/phone/otp"; - return ConfigureAndExecute<UserProfilePostResponse<SMSResponseData>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<UserProfilePostResponse<SMSResponseData>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API is used to resend a verification OTP to verify a user's Phone Number in cases in which an active token already exists @@ -229,7 +230,7 @@ public ApiResponse<UserProfilePostResponse<SMSResponseData>> PhoneResendVerifica /// <returns>Response Containing Validation Data and SMS Data</returns> /// 11.2.2 - public ApiResponse<UserProfilePostResponse<SMSResponseData>> PhoneResendVerificationOTPByToken(string accessToken, string phone, + public async Task<ApiResponse<UserProfilePostResponse<SMSResponseData>>> PhoneResendVerificationOTPByToken(string accessToken, string phone, string smsTemplate = null) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -257,7 +258,7 @@ public ApiResponse<UserProfilePostResponse<SMSResponseData>> PhoneResendVerifica var resourcePath = "identity/v2/auth/phone/otp"; - return ConfigureAndExecute<UserProfilePostResponse<SMSResponseData>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<UserProfilePostResponse<SMSResponseData>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API is used to update the login Phone Number of users @@ -268,7 +269,7 @@ public ApiResponse<UserProfilePostResponse<SMSResponseData>> PhoneResendVerifica /// <returns>Response Containing Validation Data and SMS Data</returns> /// 11.5 - public ApiResponse<UserProfilePostResponse<SMSResponseData>> UpdatePhoneNumber(string accessToken, string phone, + public async Task<ApiResponse<UserProfilePostResponse<SMSResponseData>>> UpdatePhoneNumber(string accessToken, string phone, string smsTemplate = null) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -296,7 +297,7 @@ public ApiResponse<UserProfilePostResponse<SMSResponseData>> UpdatePhoneNumber(s var resourcePath = "identity/v2/auth/phone"; - return ConfigureAndExecute<UserProfilePostResponse<SMSResponseData>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); + return await ConfigureAndExecute<UserProfilePostResponse<SMSResponseData>>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(bodyParameters)); } /// <summary> /// This API is used to check the Phone Number exists or not on your site. @@ -305,7 +306,7 @@ public ApiResponse<UserProfilePostResponse<SMSResponseData>> UpdatePhoneNumber(s /// <returns>Response containing Definition Complete ExistResponse data</returns> /// 11.6 - public ApiResponse<ExistResponse> CheckPhoneNumberAvailability(string phone) + public async Task<ApiResponse<ExistResponse>> CheckPhoneNumberAvailability(string phone) { if (string.IsNullOrWhiteSpace(phone)) { @@ -319,7 +320,7 @@ public ApiResponse<ExistResponse> CheckPhoneNumberAvailability(string phone) var resourcePath = "identity/v2/auth/phone"; - return ConfigureAndExecute<ExistResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<ExistResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to delete the Phone ID on a user's account via the access_token @@ -328,7 +329,7 @@ public ApiResponse<ExistResponse> CheckPhoneNumberAvailability(string phone) /// <returns>Response containing Definition of Delete Request</returns> /// 11.7 - public ApiResponse<DeleteResponse> RemovePhoneIDByAccessToken(string accessToken) + public async Task<ApiResponse<DeleteResponse>> RemovePhoneIDByAccessToken(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -342,7 +343,7 @@ public ApiResponse<DeleteResponse> RemovePhoneIDByAccessToken(string accessToken var resourcePath = "identity/v2/auth/phone"; - return ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); + return await ConfigureAndExecute<DeleteResponse>(HttpMethod.DELETE, resourcePath, queryParameters, null); } /// <summary> /// This API registers the new users into your Cloud Storage and triggers the phone verification process. @@ -357,7 +358,7 @@ public ApiResponse<DeleteResponse> RemovePhoneIDByAccessToken(string accessToken /// <returns>Response containing Definition of Complete Validation, UserProfile data and Access Token</returns> /// 17.1.2 - public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> UserRegistrationByPhone(AuthUserRegistrationModel authUserRegistrationModel, string sott, + public async Task<ApiResponse<UserProfilePostResponse<AccessToken<Identity>>>> UserRegistrationByPhone(AuthUserRegistrationModel authUserRegistrationModel, string sott, string fields = "", string options = "", string smsTemplate = null, string verificationUrl = null, string welcomeEmailTemplate = null) { if (authUserRegistrationModel == null) @@ -396,7 +397,7 @@ public ApiResponse<UserProfilePostResponse<AccessToken<Identity>>> UserRegistrat var resourcePath = "identity/v2/auth/register"; - return ConfigureAndExecute<UserProfilePostResponse<AccessToken<Identity>>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(authUserRegistrationModel)); + return await ConfigureAndExecute<UserProfilePostResponse<AccessToken<Identity>>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(authUserRegistrationModel)); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Authentication/RiskBasedAuthenticationApi.cs b/Source/LoginRadiusSDK.V2/Api/Authentication/RiskBasedAuthenticationApi.cs index 589f883..9ea3d4e 100644 --- a/Source/LoginRadiusSDK.V2/Api/Authentication/RiskBasedAuthenticationApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Authentication/RiskBasedAuthenticationApi.cs @@ -11,6 +11,7 @@ using LoginRadiusSDK.V2.Models.ResponseModels; using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; using LoginRadiusSDK.V2.Models.RequestModels; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Authentication { @@ -40,7 +41,7 @@ public class RiskBasedAuthenticationApi : LoginRadiusResource /// <returns>Response containing User Profile Data and access token</returns> /// 9.2.4 - public ApiResponse<AccessToken<Identity>> RBALoginByEmail(EmailAuthenticationModel emailAuthenticationModel, string emailTemplate = null, + public async Task<ApiResponse<AccessToken<Identity>>> RBALoginByEmail(EmailAuthenticationModel emailAuthenticationModel, string emailTemplate = null, string fields = "", string loginUrl = null, bool? passwordDelegation = null, string passwordDelegationApp = null, string rbaBrowserEmailTemplate = null, string rbaBrowserSmsTemplate = null, string rbaCityEmailTemplate = null, string rbaCitySmsTemplate = null, string rbaCountryEmailTemplate = null, string rbaCountrySmsTemplate = null, string rbaIpEmailTemplate = null, string rbaIpSmsTemplate = null, string rbaOneclickEmailTemplate = null, @@ -125,7 +126,7 @@ public ApiResponse<AccessToken<Identity>> RBALoginByEmail(EmailAuthenticationMod var resourcePath = "identity/v2/auth/login"; - return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(emailAuthenticationModel)); + return await ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(emailAuthenticationModel)); } /// <summary> /// This API retrieves a copy of the user data based on the Username @@ -151,7 +152,7 @@ public ApiResponse<AccessToken<Identity>> RBALoginByEmail(EmailAuthenticationMod /// <returns>Response containing User Profile Data and access token</returns> /// 9.2.5 - public ApiResponse<AccessToken<Identity>> RBALoginByUserName(UserNameAuthenticationModel userNameAuthenticationModel, string emailTemplate = null, + public async Task<ApiResponse<AccessToken<Identity>>> RBALoginByUserName(UserNameAuthenticationModel userNameAuthenticationModel, string emailTemplate = null, string fields = "", string loginUrl = null, bool? passwordDelegation = null, string passwordDelegationApp = null, string rbaBrowserEmailTemplate = null, string rbaBrowserSmsTemplate = null, string rbaCityEmailTemplate = null, string rbaCitySmsTemplate = null, string rbaCountryEmailTemplate = null, string rbaCountrySmsTemplate = null, string rbaIpEmailTemplate = null, string rbaIpSmsTemplate = null, string rbaOneclickEmailTemplate = null, @@ -236,7 +237,7 @@ public ApiResponse<AccessToken<Identity>> RBALoginByUserName(UserNameAuthenticat var resourcePath = "identity/v2/auth/login"; - return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(userNameAuthenticationModel)); + return await ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(userNameAuthenticationModel)); } /// <summary> /// This API retrieves a copy of the user data based on the Phone @@ -262,7 +263,7 @@ public ApiResponse<AccessToken<Identity>> RBALoginByUserName(UserNameAuthenticat /// <returns>Response containing User Profile Data and access token</returns> /// 9.2.6 - public ApiResponse<AccessToken<Identity>> RBALoginByPhone(PhoneAuthenticationModel phoneAuthenticationModel, string emailTemplate = null, + public async Task<ApiResponse<AccessToken<Identity>>> RBALoginByPhone(PhoneAuthenticationModel phoneAuthenticationModel, string emailTemplate = null, string fields = "", string loginUrl = null, bool? passwordDelegation = null, string passwordDelegationApp = null, string rbaBrowserEmailTemplate = null, string rbaBrowserSmsTemplate = null, string rbaCityEmailTemplate = null, string rbaCitySmsTemplate = null, string rbaCountryEmailTemplate = null, string rbaCountrySmsTemplate = null, string rbaIpEmailTemplate = null, string rbaIpSmsTemplate = null, string rbaOneclickEmailTemplate = null, @@ -347,7 +348,7 @@ public ApiResponse<AccessToken<Identity>> RBALoginByPhone(PhoneAuthenticationMod var resourcePath = "identity/v2/auth/login"; - return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(phoneAuthenticationModel)); + return await ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(phoneAuthenticationModel)); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Authentication/SmartLoginApi.cs b/Source/LoginRadiusSDK.V2/Api/Authentication/SmartLoginApi.cs index 8303785..4b416d7 100644 --- a/Source/LoginRadiusSDK.V2/Api/Authentication/SmartLoginApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Authentication/SmartLoginApi.cs @@ -11,6 +11,7 @@ using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; using LoginRadiusSDK.V2.Models.ResponseModels; using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Authentication { @@ -24,7 +25,7 @@ public class SmartLoginApi : LoginRadiusResource /// <returns>Complete verified response data</returns> /// 8.4.1 - public ApiResponse<VerifiedResponse> SmartLoginTokenVerification(string verificationToken, string welcomeEmailTemplate = null) + public async Task<ApiResponse<VerifiedResponse>> SmartLoginTokenVerification(string verificationToken, string welcomeEmailTemplate = null) { if (string.IsNullOrWhiteSpace(verificationToken)) { @@ -42,7 +43,7 @@ public ApiResponse<VerifiedResponse> SmartLoginTokenVerification(string verifica var resourcePath = "identity/v2/auth/email/smartlogin"; - return ConfigureAndExecute<VerifiedResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<VerifiedResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API sends a Smart Login link to the user's Email Id. @@ -55,7 +56,7 @@ public ApiResponse<VerifiedResponse> SmartLoginTokenVerification(string verifica /// <returns>Response containing Definition of Complete Validation data</returns> /// 9.17.1 - public ApiResponse<PostResponse> SmartLoginByEmail(string clientGuid, string email, + public async Task<ApiResponse<PostResponse>> SmartLoginByEmail(string clientGuid, string email, string redirectUrl = null, string smartLoginEmailTemplate = null, string welcomeEmailTemplate = null) { if (string.IsNullOrWhiteSpace(clientGuid)) @@ -87,7 +88,7 @@ public ApiResponse<PostResponse> SmartLoginByEmail(string clientGuid, string ema var resourcePath = "identity/v2/auth/login/smartlogin"; - return ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API sends a Smart Login link to the user's Email Id. @@ -100,7 +101,7 @@ public ApiResponse<PostResponse> SmartLoginByEmail(string clientGuid, string ema /// <returns>Response containing Definition of Complete Validation data</returns> /// 9.17.2 - public ApiResponse<PostResponse> SmartLoginByUserName(string clientGuid, string username, + public async Task<ApiResponse<PostResponse>> SmartLoginByUserName(string clientGuid, string username, string redirectUrl = null, string smartLoginEmailTemplate = null, string welcomeEmailTemplate = null) { if (string.IsNullOrWhiteSpace(clientGuid)) @@ -132,7 +133,7 @@ public ApiResponse<PostResponse> SmartLoginByUserName(string clientGuid, string var resourcePath = "identity/v2/auth/login/smartlogin"; - return ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<PostResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to check if the Smart Login link has been clicked or not @@ -142,7 +143,7 @@ public ApiResponse<PostResponse> SmartLoginByUserName(string clientGuid, string /// <returns>Response containing User Profile Data and access token</returns> /// 9.21.1 - public ApiResponse<AccessToken<Identity>> SmartLoginPing(string clientGuid, string fields = "") + public async Task<ApiResponse<AccessToken<Identity>>> SmartLoginPing(string clientGuid, string fields = "") { if (string.IsNullOrWhiteSpace(clientGuid)) { @@ -160,7 +161,7 @@ public ApiResponse<AccessToken<Identity>> SmartLoginPing(string clientGuid, stri var resourcePath = "identity/v2/auth/login/smartlogin/ping"; - return ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<AccessToken<Identity>>(HttpMethod.GET, resourcePath, queryParameters, null); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Social/NativeSocialApi.cs b/Source/LoginRadiusSDK.V2/Api/Social/NativeSocialApi.cs index 66f7269..410b960 100644 --- a/Source/LoginRadiusSDK.V2/Api/Social/NativeSocialApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Social/NativeSocialApi.cs @@ -9,6 +9,7 @@ using LoginRadiusSDK.V2.Common; using LoginRadiusSDK.V2.Util; using LoginRadiusSDK.V2.Models.ResponseModels; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Social { @@ -21,7 +22,7 @@ public class NativeSocialApi : LoginRadiusResource /// <returns>Response containing Definition of Complete Token data</returns> /// 20.3 - public ApiResponse<AccessToken> GetAccessTokenByFacebookAccessToken(string fbAccessToken) + public async Task<ApiResponse<AccessToken>> GetAccessTokenByFacebookAccessToken(string fbAccessToken) { if (string.IsNullOrWhiteSpace(fbAccessToken)) { @@ -35,7 +36,7 @@ public ApiResponse<AccessToken> GetAccessTokenByFacebookAccessToken(string fbAcc var resourcePath = "api/v2/access_token/facebook"; - return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The API is used to get LoginRadius access token by sending Twitter's access token. It will be valid for the specific duration of time specified in the response. @@ -45,7 +46,7 @@ public ApiResponse<AccessToken> GetAccessTokenByFacebookAccessToken(string fbAcc /// <returns>Response containing Definition of Complete Token data</returns> /// 20.4 - public ApiResponse<AccessToken> GetAccessTokenByTwitterAccessToken(string twAccessToken, string twTokenSecret) + public async Task<ApiResponse<AccessToken>> GetAccessTokenByTwitterAccessToken(string twAccessToken, string twTokenSecret) { if (string.IsNullOrWhiteSpace(twAccessToken)) { @@ -64,7 +65,7 @@ public ApiResponse<AccessToken> GetAccessTokenByTwitterAccessToken(string twAcce var resourcePath = "api/v2/access_token/twitter"; - return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The API is used to get LoginRadius access token by sending Google's access token. It will be valid for the specific duration of time specified in the response. @@ -75,7 +76,7 @@ public ApiResponse<AccessToken> GetAccessTokenByTwitterAccessToken(string twAcce /// <returns>Response containing Definition of Complete Token data</returns> /// 20.5 - public ApiResponse<AccessToken> GetAccessTokenByGoogleAccessToken(string googleAccessToken, string clientId = null, + public async Task<ApiResponse<AccessToken>> GetAccessTokenByGoogleAccessToken(string googleAccessToken, string clientId = null, string refreshToken = null) { if (string.IsNullOrWhiteSpace(googleAccessToken)) @@ -98,7 +99,7 @@ public ApiResponse<AccessToken> GetAccessTokenByGoogleAccessToken(string googleA var resourcePath = "api/v2/access_token/google"; - return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API is used to Get LoginRadius Access Token using google jwt id token for google native mobile login/registration. @@ -107,7 +108,7 @@ public ApiResponse<AccessToken> GetAccessTokenByGoogleAccessToken(string googleA /// <returns>Response containing Definition of Complete Token data</returns> /// 20.6 - public ApiResponse<AccessToken> GetAccessTokenByGoogleJWTAccessToken(string idToken) + public async Task<ApiResponse<AccessToken>> GetAccessTokenByGoogleJWTAccessToken(string idToken) { if (string.IsNullOrWhiteSpace(idToken)) { @@ -121,7 +122,7 @@ public ApiResponse<AccessToken> GetAccessTokenByGoogleJWTAccessToken(string idTo var resourcePath = "api/v2/access_token/googlejwt"; - return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The API is used to get LoginRadius access token by sending Linkedin's access token. It will be valid for the specific duration of time specified in the response. @@ -130,7 +131,7 @@ public ApiResponse<AccessToken> GetAccessTokenByGoogleJWTAccessToken(string idTo /// <returns>Response containing Definition of Complete Token data</returns> /// 20.7 - public ApiResponse<AccessToken> GetAccessTokenByLinkedinAccessToken(string lnAccessToken) + public async Task<ApiResponse<AccessToken>> GetAccessTokenByLinkedinAccessToken(string lnAccessToken) { if (string.IsNullOrWhiteSpace(lnAccessToken)) { @@ -144,7 +145,7 @@ public ApiResponse<AccessToken> GetAccessTokenByLinkedinAccessToken(string lnAcc var resourcePath = "api/v2/access_token/linkedin"; - return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The API is used to get LoginRadius access token by sending Foursquare's access token. It will be valid for the specific duration of time specified in the response. @@ -153,7 +154,7 @@ public ApiResponse<AccessToken> GetAccessTokenByLinkedinAccessToken(string lnAcc /// <returns>Response containing Definition of Complete Token data</returns> /// 20.8 - public ApiResponse<AccessToken> GetAccessTokenByFoursquareAccessToken(string fsAccessToken) + public async Task<ApiResponse<AccessToken>> GetAccessTokenByFoursquareAccessToken(string fsAccessToken) { if (string.IsNullOrWhiteSpace(fsAccessToken)) { @@ -167,7 +168,7 @@ public ApiResponse<AccessToken> GetAccessTokenByFoursquareAccessToken(string fsA var resourcePath = "api/v2/access_token/foursquare"; - return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The API is used to get LoginRadius access token by sending Vkontakte's access token. It will be valid for the specific duration of time specified in the response. @@ -176,7 +177,7 @@ public ApiResponse<AccessToken> GetAccessTokenByFoursquareAccessToken(string fsA /// <returns>Response containing Definition of Complete Token data</returns> /// 20.15 - public ApiResponse<AccessToken> GetAccessTokenByVkontakteAccessToken(string vkAccessToken) + public async Task<ApiResponse<AccessToken>> GetAccessTokenByVkontakteAccessToken(string vkAccessToken) { if (string.IsNullOrWhiteSpace(vkAccessToken)) { @@ -190,7 +191,7 @@ public ApiResponse<AccessToken> GetAccessTokenByVkontakteAccessToken(string vkAc var resourcePath = "api/v2/access_token/vkontakte"; - return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The API is used to get LoginRadius access token by sending Google's AuthCode. It will be valid for the specific duration of time specified in the response. @@ -199,7 +200,7 @@ public ApiResponse<AccessToken> GetAccessTokenByVkontakteAccessToken(string vkAc /// <returns>Response containing Definition of Complete Token data</returns> /// 20.16 - public ApiResponse<AccessToken> GetAccessTokenByGoogleAuthCode(string googleAuthcode) + public async Task<ApiResponse<AccessToken>> GetAccessTokenByGoogleAuthCode(string googleAuthcode) { if (string.IsNullOrWhiteSpace(googleAuthcode)) { @@ -213,7 +214,7 @@ public ApiResponse<AccessToken> GetAccessTokenByGoogleAuthCode(string googleAuth var resourcePath = "api/v2/access_token/google"; - return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Api/Social/SocialApi.cs b/Source/LoginRadiusSDK.V2/Api/Social/SocialApi.cs index e4e4117..85c2af5 100644 --- a/Source/LoginRadiusSDK.V2/Api/Social/SocialApi.cs +++ b/Source/LoginRadiusSDK.V2/Api/Social/SocialApi.cs @@ -13,6 +13,7 @@ using LoginRadiusSDK.V2.Models.ResponseModels.OtherObjects; using LoginRadiusSDK.V2.Models.RequestModels; using LoginRadiusSDK.V2.Models.ResponseModels.UserProfile; +using System.Threading.Tasks; namespace LoginRadiusSDK.V2.Api.Social { @@ -25,7 +26,7 @@ public class SocialApi : LoginRadiusResource /// <returns>Response containing Definition of Complete Token data</returns> /// 20.1 - public ApiResponse<AccessToken> ExchangeAccessToken(string token) + public async Task<ApiResponse<AccessToken>> ExchangeAccessToken(string token) { if (string.IsNullOrWhiteSpace(token)) { @@ -39,7 +40,7 @@ public ApiResponse<AccessToken> ExchangeAccessToken(string token) var resourcePath = "api/v2/access_token"; - return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Refresh Access Token API is used to refresh the provider access token after authentication. It will be valid for up to 60 days on LoginRadius depending on the provider. In order to use the access token in other APIs, always refresh the token using this API.<br><br><b>Supported Providers :</b> Facebook,Yahoo,Google,Twitter, Linkedin.<br><br> Contact LoginRadius support team to enable this API. @@ -49,7 +50,7 @@ public ApiResponse<AccessToken> ExchangeAccessToken(string token) /// <returns>Response containing Definition of Complete Token data</returns> /// 20.2 - public ApiResponse<AccessToken> RefreshAccessToken(string accessToken, int? expiresIn = 0) + public async Task<ApiResponse<AccessToken>> RefreshAccessToken(string accessToken, int? expiresIn = 0) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -67,7 +68,7 @@ public ApiResponse<AccessToken> RefreshAccessToken(string accessToken, int? expi var resourcePath = "api/v2/access_token/refresh"; - return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This API validates access token, if valid then returns a response with its expiry otherwise error. @@ -76,7 +77,7 @@ public ApiResponse<AccessToken> RefreshAccessToken(string accessToken, int? expi /// <returns>Response containing Definition of Complete Token data</returns> /// 20.9 - public ApiResponse<AccessToken> ValidateAccessToken(string accessToken) + public async Task<ApiResponse<AccessToken>> ValidateAccessToken(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -91,7 +92,7 @@ public ApiResponse<AccessToken> ValidateAccessToken(string accessToken) var resourcePath = "api/v2/access_token/validate"; - return ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<AccessToken>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This api invalidates the active access token or expires an access token validity. @@ -100,7 +101,7 @@ public ApiResponse<AccessToken> ValidateAccessToken(string accessToken) /// <returns>Response containing Definition for Complete Validation data</returns> /// 20.10 - public ApiResponse<PostMethodResponse> InValidateAccessToken(string accessToken) + public async Task<ApiResponse<PostMethodResponse>> InValidateAccessToken(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -115,7 +116,7 @@ public ApiResponse<PostMethodResponse> InValidateAccessToken(string accessToken) var resourcePath = "api/v2/access_token/invalidate"; - return ConfigureAndExecute<PostMethodResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<PostMethodResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This api is use to get all active session by Access Token. @@ -124,7 +125,7 @@ public ApiResponse<PostMethodResponse> InValidateAccessToken(string accessToken) /// <returns>Response containing Definition for Complete active sessions</returns> /// 20.11.1 - public ApiResponse<UserActiveSession> GetActiveSession(string token) + public async Task<ApiResponse<UserActiveSession>> GetActiveSession(string token) { if (string.IsNullOrWhiteSpace(token)) { @@ -139,7 +140,7 @@ public ApiResponse<UserActiveSession> GetActiveSession(string token) var resourcePath = "api/v2/access_token/activesession"; - return ConfigureAndExecute<UserActiveSession>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<UserActiveSession>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This api is used to get all active sessions by AccountID(UID). @@ -148,7 +149,7 @@ public ApiResponse<UserActiveSession> GetActiveSession(string token) /// <returns>Response containing Definition for Complete active sessions</returns> /// 20.11.2 - public ApiResponse<UserActiveSession> GetActiveSessionByAccountID(string accountId) + public async Task<ApiResponse<UserActiveSession>> GetActiveSessionByAccountID(string accountId) { if (string.IsNullOrWhiteSpace(accountId)) { @@ -163,7 +164,7 @@ public ApiResponse<UserActiveSession> GetActiveSessionByAccountID(string account var resourcePath = "api/v2/access_token/activesession"; - return ConfigureAndExecute<UserActiveSession>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<UserActiveSession>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// This api is used to get all active sessions by ProfileId. @@ -172,7 +173,7 @@ public ApiResponse<UserActiveSession> GetActiveSessionByAccountID(string account /// <returns>Response containing Definition for Complete active sessions</returns> /// 20.11.3 - public ApiResponse<UserActiveSession> GetActiveSessionByProfileID(string profileId) + public async Task<ApiResponse<UserActiveSession>> GetActiveSessionByProfileID(string profileId) { if (string.IsNullOrWhiteSpace(profileId)) { @@ -187,7 +188,7 @@ public ApiResponse<UserActiveSession> GetActiveSessionByProfileID(string profile var resourcePath = "api/v2/access_token/activesession"; - return ConfigureAndExecute<UserActiveSession>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<UserActiveSession>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// <b>Supported Providers:</b> Facebook, Google, Live, Vkontakte.<br><br> This API returns the photo albums associated with the passed in access tokens Social Profile. @@ -196,7 +197,7 @@ public ApiResponse<UserActiveSession> GetActiveSessionByProfileID(string profile /// <returns>Response Containing List of Album Data</returns> /// 22.2.1 - public ApiResponse<List<Album>> GetAlbums(string accessToken) + public async Task<ApiResponse<List<Album>>> GetAlbums(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -209,7 +210,7 @@ public ApiResponse<List<Album>> GetAlbums(string accessToken) var resourcePath = "api/v2/album"; - return ConfigureAndExecute<List<Album>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<List<Album>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// <b>Supported Providers:</b> Facebook, Google, Live, Vkontakte.<br><br> This API returns the photo albums associated with the passed in access tokens Social Profile. @@ -219,7 +220,7 @@ public ApiResponse<List<Album>> GetAlbums(string accessToken) /// <returns>Response Model containing Albums with next cursor</returns> /// 22.2.2 - public ApiResponse<CursorResponse<Album>> GetAlbumsWithCursor(string accessToken, string nextCursor) + public async Task<ApiResponse<CursorResponse<Album>>> GetAlbumsWithCursor(string accessToken, string nextCursor) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -237,7 +238,7 @@ public ApiResponse<CursorResponse<Album>> GetAlbumsWithCursor(string accessToken var resourcePath = "api/v2/album"; - return ConfigureAndExecute<CursorResponse<Album>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<CursorResponse<Album>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Audio API is used to get audio files data from the user's social account.<br><br><b>Supported Providers:</b> Live, Vkontakte @@ -246,7 +247,7 @@ public ApiResponse<CursorResponse<Album>> GetAlbumsWithCursor(string accessToken /// <returns>Response Containing List of Audio Data</returns> /// 24.2.1 - public ApiResponse<List<Audio>> GetAudios(string accessToken) + public async Task<ApiResponse<List<Audio>>> GetAudios(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -259,7 +260,7 @@ public ApiResponse<List<Audio>> GetAudios(string accessToken) var resourcePath = "api/v2/audio"; - return ConfigureAndExecute<List<Audio>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<List<Audio>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Audio API is used to get audio files data from the user's social account.<br><br><b>Supported Providers:</b> Live, Vkontakte @@ -269,7 +270,7 @@ public ApiResponse<List<Audio>> GetAudios(string accessToken) /// <returns>Response Model containing Audio with next cursor</returns> /// 24.2.2 - public ApiResponse<CursorResponse<Audio>> GetAudiosWithCursor(string accessToken, string nextCursor) + public async Task<ApiResponse<CursorResponse<Audio>>> GetAudiosWithCursor(string accessToken, string nextCursor) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -287,7 +288,7 @@ public ApiResponse<CursorResponse<Audio>> GetAudiosWithCursor(string accessToken var resourcePath = "api/v2/audio"; - return ConfigureAndExecute<CursorResponse<Audio>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<CursorResponse<Audio>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Check In API is used to get check Ins data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Vkontakte @@ -296,7 +297,7 @@ public ApiResponse<CursorResponse<Audio>> GetAudiosWithCursor(string accessToken /// <returns>Response Containing List of CheckIn Data</returns> /// 25.2.1 - public ApiResponse<List<CheckIn>> GetCheckIns(string accessToken) + public async Task<ApiResponse<List<CheckIn>>> GetCheckIns(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -309,7 +310,7 @@ public ApiResponse<List<CheckIn>> GetCheckIns(string accessToken) var resourcePath = "api/v2/checkin"; - return ConfigureAndExecute<List<CheckIn>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<List<CheckIn>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Check In API is used to get check Ins data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Vkontakte @@ -319,7 +320,7 @@ public ApiResponse<List<CheckIn>> GetCheckIns(string accessToken) /// <returns>Response Model containing Checkins with next cursor</returns> /// 25.2.2 - public ApiResponse<CursorResponse<CheckIn>> GetCheckInsWithCursor(string accessToken, string nextCursor) + public async Task<ApiResponse<CursorResponse<CheckIn>>> GetCheckInsWithCursor(string accessToken, string nextCursor) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -337,7 +338,7 @@ public ApiResponse<CursorResponse<CheckIn>> GetCheckInsWithCursor(string accessT var resourcePath = "api/v2/checkin"; - return ConfigureAndExecute<CursorResponse<CheckIn>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<CursorResponse<CheckIn>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Contact API is used to get contacts/friends/connections data from the user's social account.This is one of the APIs that makes up the LoginRadius Friend Invite System. The data will normalized into LoginRadius' standard data format. This API requires setting permissions in your LoginRadius Dashboard. <br><br><b>Note:</b> 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. <br><br><b>Supported Providers:</b> Facebook, Foursquare, Google, LinkedIn, Live, Twitter, Vkontakte, Yahoo @@ -347,7 +348,7 @@ public ApiResponse<CursorResponse<CheckIn>> GetCheckInsWithCursor(string accessT /// <returns>Response containing Definition of Contact Data with Cursor</returns> /// 27.1 - public ApiResponse<CursorResponse<Contact>> GetContacts(string accessToken, string nextCursor = "") + public async Task<ApiResponse<CursorResponse<Contact>>> GetContacts(string accessToken, string nextCursor = "") { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -364,7 +365,7 @@ public ApiResponse<CursorResponse<Contact>> GetContacts(string accessToken, stri var resourcePath = "api/v2/contact"; - return ConfigureAndExecute<CursorResponse<Contact>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<CursorResponse<Contact>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Event API is used to get the event data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Live @@ -373,7 +374,7 @@ public ApiResponse<CursorResponse<Contact>> GetContacts(string accessToken, stri /// <returns>Response Containing List of Events Data</returns> /// 28.2.1 - public ApiResponse<List<Events>> GetEvents(string accessToken) + public async Task<ApiResponse<List<Events>>> GetEvents(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -386,7 +387,7 @@ public ApiResponse<List<Events>> GetEvents(string accessToken) var resourcePath = "api/v2/event"; - return ConfigureAndExecute<List<Events>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<List<Events>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Event API is used to get the event data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Live @@ -396,7 +397,7 @@ public ApiResponse<List<Events>> GetEvents(string accessToken) /// <returns>Response Model containing Events with next cursor</returns> /// 28.2.2 - public ApiResponse<CursorResponse<Events>> GetEventsWithCursor(string accessToken, string nextCursor) + public async Task<ApiResponse<CursorResponse<Events>>> GetEventsWithCursor(string accessToken, string nextCursor) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -414,7 +415,7 @@ public ApiResponse<CursorResponse<Events>> GetEventsWithCursor(string accessToke var resourcePath = "api/v2/event"; - return ConfigureAndExecute<CursorResponse<Events>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<CursorResponse<Events>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// Get the following user list from the user's social account.<br><br><b>Supported Providers:</b> Twitter @@ -423,7 +424,7 @@ public ApiResponse<CursorResponse<Events>> GetEventsWithCursor(string accessToke /// <returns>Response Containing List of Contacts Data</returns> /// 29.2.1 - public ApiResponse<List<Contact>> GetFollowings(string accessToken) + public async Task<ApiResponse<List<Contact>>> GetFollowings(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -436,7 +437,7 @@ public ApiResponse<List<Contact>> GetFollowings(string accessToken) var resourcePath = "api/v2/following"; - return ConfigureAndExecute<List<Contact>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<List<Contact>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// Get the following user list from the user's social account.<br><br><b>Supported Providers:</b> Twitter @@ -446,7 +447,7 @@ public ApiResponse<List<Contact>> GetFollowings(string accessToken) /// <returns>Response containing Definition of Contact Data with Cursor</returns> /// 29.2.2 - public ApiResponse<CursorResponse<Contact>> GetFollowingsWithCursor(string accessToken, string nextCursor) + public async Task<ApiResponse<CursorResponse<Contact>>> GetFollowingsWithCursor(string accessToken, string nextCursor) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -464,7 +465,7 @@ public ApiResponse<CursorResponse<Contact>> GetFollowingsWithCursor(string acces var resourcePath = "api/v2/following"; - return ConfigureAndExecute<CursorResponse<Contact>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<CursorResponse<Contact>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Group API is used to get group data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Vkontakte @@ -473,7 +474,7 @@ public ApiResponse<CursorResponse<Contact>> GetFollowingsWithCursor(string acces /// <returns>Response Containing List of Groups Data</returns> /// 30.2.1 - public ApiResponse<List<Group>> GetGroups(string accessToken) + public async Task<ApiResponse<List<Group>>> GetGroups(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -486,7 +487,7 @@ public ApiResponse<List<Group>> GetGroups(string accessToken) var resourcePath = "api/v2/group"; - return ConfigureAndExecute<List<Group>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<List<Group>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Group API is used to get group data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Vkontakte @@ -496,7 +497,7 @@ public ApiResponse<List<Group>> GetGroups(string accessToken) /// <returns>Response Model containing Groups with next cursor</returns> /// 30.2.2 - public ApiResponse<CursorResponse<Group>> GetGroupsWithCursor(string accessToken, string nextCursor) + public async Task<ApiResponse<CursorResponse<Group>>> GetGroupsWithCursor(string accessToken, string nextCursor) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -514,7 +515,7 @@ public ApiResponse<CursorResponse<Group>> GetGroupsWithCursor(string accessToken var resourcePath = "api/v2/group"; - return ConfigureAndExecute<CursorResponse<Group>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<CursorResponse<Group>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Like API is used to get likes data from the user's social account.<br><br><b>Supported Providers:</b> Facebook @@ -523,7 +524,7 @@ public ApiResponse<CursorResponse<Group>> GetGroupsWithCursor(string accessToken /// <returns>Response Containing List of Likes Data</returns> /// 31.2.1 - public ApiResponse<List<Like>> GetLikes(string accessToken) + public async Task<ApiResponse<List<Like>>> GetLikes(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -536,7 +537,7 @@ public ApiResponse<List<Like>> GetLikes(string accessToken) var resourcePath = "api/v2/like"; - return ConfigureAndExecute<List<Like>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<List<Like>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Like API is used to get likes data from the user's social account.<br><br><b>Supported Providers:</b> Facebook @@ -546,7 +547,7 @@ public ApiResponse<List<Like>> GetLikes(string accessToken) /// <returns>Response Model containing Likes with next cursor</returns> /// 31.2.2 - public ApiResponse<CursorResponse<Like>> GetLikesWithCursor(string accessToken, string nextCursor) + public async Task<ApiResponse<CursorResponse<Like>>> GetLikesWithCursor(string accessToken, string nextCursor) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -564,7 +565,7 @@ public ApiResponse<CursorResponse<Like>> GetLikesWithCursor(string accessToken, var resourcePath = "api/v2/like"; - return ConfigureAndExecute<CursorResponse<Like>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<CursorResponse<Like>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Mention API is used to get mentions data from the user's social account.<br><br><b>Supported Providers:</b> Twitter @@ -573,7 +574,7 @@ public ApiResponse<CursorResponse<Like>> GetLikesWithCursor(string accessToken, /// <returns>Response Containing List of Status Data</returns> /// 32.1 - public ApiResponse<List<Status>> GetMentions(string accessToken) + public async Task<ApiResponse<List<Status>>> GetMentions(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -586,7 +587,7 @@ public ApiResponse<List<Status>> GetMentions(string accessToken) var resourcePath = "api/v2/mention"; - return ConfigureAndExecute<List<Status>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<List<Status>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// Post Message API is used to post messages to the user's contacts.<br><br><b>Supported Providers:</b> Twitter, LinkedIn <br><br>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.<br><br>GET & POST Message API work the same way except the API method is different @@ -598,7 +599,7 @@ public ApiResponse<List<Status>> GetMentions(string accessToken) /// <returns>Response containing Definition for Complete Validation data</returns> /// 33.1 - public ApiResponse<PostMethodResponse> PostMessage(string accessToken, string message, + public async Task<ApiResponse<PostMethodResponse>> PostMessage(string accessToken, string message, string subject, string to) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -627,7 +628,7 @@ public ApiResponse<PostMethodResponse> PostMessage(string accessToken, string me var resourcePath = "api/v2/message"; - return ConfigureAndExecute<PostMethodResponse>(HttpMethod.POST, resourcePath, queryParameters, null); + return await ConfigureAndExecute<PostMethodResponse>(HttpMethod.POST, resourcePath, queryParameters, null); } /// <summary> /// The Page API is used to get the page data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, LinkedIn @@ -637,7 +638,7 @@ public ApiResponse<PostMethodResponse> PostMessage(string accessToken, string me /// <returns>Response containing Definition of Complete page data</returns> /// 34.1 - public ApiResponse<Page> GetPage(string accessToken, string pageName) + public async Task<ApiResponse<Page>> GetPage(string accessToken, string pageName) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -655,7 +656,7 @@ public ApiResponse<Page> GetPage(string accessToken, string pageName) var resourcePath = "api/v2/page"; - return ConfigureAndExecute<Page>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<Page>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Photo API is used to get photo data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Foursquare, Google, Live, Vkontakte @@ -665,7 +666,7 @@ public ApiResponse<Page> GetPage(string accessToken, string pageName) /// <returns>Response Containing List of Photos Data</returns> /// 35.1 - public ApiResponse<List<Photo>> GetPhotos(string accessToken, string albumId) + public async Task<ApiResponse<List<Photo>>> GetPhotos(string accessToken, string albumId) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -683,7 +684,7 @@ public ApiResponse<List<Photo>> GetPhotos(string accessToken, string albumId) var resourcePath = "api/v2/photo"; - return ConfigureAndExecute<List<Photo>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<List<Photo>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Post API is used to get post message data from the user's social account.<br><br><b>Supported Providers:</b> Facebook @@ -692,7 +693,7 @@ public ApiResponse<List<Photo>> GetPhotos(string accessToken, string albumId) /// <returns>Response Containing List of Posts Data</returns> /// 36.1 - public ApiResponse<List<Post>> GetPosts(string accessToken) + public async Task<ApiResponse<List<Post>>> GetPosts(string accessToken) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -705,7 +706,7 @@ public ApiResponse<List<Post>> GetPosts(string accessToken) var resourcePath = "api/v2/post"; - return ConfigureAndExecute<List<Post>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<List<Post>>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Status API is used to update the status on the user's wall.<br><br><b>Supported Providers:</b> Facebook, Twitter, LinkedIn @@ -721,7 +722,7 @@ public ApiResponse<List<Post>> GetPosts(string accessToken) /// <returns>Response conatining Definition of Validation and Short URL data</returns> /// 37.2 - public ApiResponse<PostMethodResponse<ShortUrlResponse>> StatusPosting(string accessToken, string caption, + public async Task<ApiResponse<PostMethodResponse<ShortUrlResponse>>> StatusPosting(string accessToken, string caption, string description, string imageUrl, string status, string title, string url, string shorturl = "0") { @@ -770,7 +771,7 @@ public ApiResponse<PostMethodResponse<ShortUrlResponse>> StatusPosting(string ac var resourcePath = "api/v2/status"; - return ConfigureAndExecute<PostMethodResponse<ShortUrlResponse>>(HttpMethod.POST, resourcePath, queryParameters, null); + return await ConfigureAndExecute<PostMethodResponse<ShortUrlResponse>>(HttpMethod.POST, resourcePath, queryParameters, null); } /// <summary> /// The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> 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.<br><br> POST Input Parameter Format: application/x-www-form-urlencoded @@ -780,7 +781,7 @@ public ApiResponse<PostMethodResponse<ShortUrlResponse>> StatusPosting(string ac /// <returns>Response containing Definition for Complete status data</returns> /// 37.6 - public ApiResponse<StatusUpdateResponse> TrackableStatusPosting(string accessToken, StatusModel statusModel) + public async Task<ApiResponse<StatusUpdateResponse>> TrackableStatusPosting(string accessToken, StatusModel statusModel) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -797,7 +798,7 @@ public ApiResponse<StatusUpdateResponse> TrackableStatusPosting(string accessTok var resourcePath = "api/v2/status/trackable"; - return ConfigureAndExecute<StatusUpdateResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(statusModel)); + return await ConfigureAndExecute<StatusUpdateResponse>(HttpMethod.POST, resourcePath, queryParameters, ConvertToJson(statusModel)); } /// <summary> /// The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> 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. @@ -812,7 +813,7 @@ public ApiResponse<StatusUpdateResponse> TrackableStatusPosting(string accessTok /// <returns>Response containing Definition for Complete status data</returns> /// 37.7 - public ApiResponse<StatusUpdateResponse> GetTrackableStatusStats(string accessToken, string caption, + public async Task<ApiResponse<StatusUpdateResponse>> GetTrackableStatusStats(string accessToken, string caption, string description, string imageUrl, string status, string title, string url) { if (string.IsNullOrWhiteSpace(accessToken)) @@ -856,7 +857,7 @@ public ApiResponse<StatusUpdateResponse> GetTrackableStatusStats(string accessTo var resourcePath = "api/v2/status/trackable/js"; - return ConfigureAndExecute<StatusUpdateResponse>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<StatusUpdateResponse>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Trackable status API works very similar to the Status API but it returns a Post id that you can use to track the stats(shares, likes, comments) for a specific share/post/status update. This API requires setting permissions in your LoginRadius Dashboard.<br><br> 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.<br><br> <b>Note:</b> 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. @@ -865,7 +866,7 @@ public ApiResponse<StatusUpdateResponse> GetTrackableStatusStats(string accessTo /// <returns>Response containing Definition of Complete Status Update data</returns> /// 37.8 - public ApiResponse<StatusUpdateStats> TrackableStatusFetching(string postId) + public async Task<ApiResponse<StatusUpdateStats>> TrackableStatusFetching(string postId) { if (string.IsNullOrWhiteSpace(postId)) { @@ -879,7 +880,7 @@ public ApiResponse<StatusUpdateStats> TrackableStatusFetching(string postId) var resourcePath = "api/v2/status/trackable"; - return ConfigureAndExecute<StatusUpdateStats>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<StatusUpdateStats>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// 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 @@ -889,7 +890,7 @@ public ApiResponse<StatusUpdateStats> TrackableStatusFetching(string postId) /// <returns>Response containing Definition for Complete UserProfile data</returns> /// 38.1 - public ApiResponse<UserProfile> GetSocialUserProfile(string accessToken, string fields = "") + public async Task<ApiResponse<UserProfile>> GetSocialUserProfile(string accessToken, string fields = "") { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -906,7 +907,7 @@ public ApiResponse<UserProfile> GetSocialUserProfile(string accessToken, string var resourcePath = "api/v2/userprofile"; - return ConfigureAndExecute<UserProfile>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<UserProfile>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// 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. @@ -916,7 +917,7 @@ public ApiResponse<UserProfile> GetSocialUserProfile(string accessToken, string /// <returns>Response containing Definition for Complete UserProfile data</returns> /// 38.2 - public ApiResponse<UserProfile> GetRefreshedSocialUserProfile(string accessToken, string fields = "") + public async Task<ApiResponse<UserProfile>> GetRefreshedSocialUserProfile(string accessToken, string fields = "") { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -933,7 +934,7 @@ public ApiResponse<UserProfile> GetRefreshedSocialUserProfile(string accessToken var resourcePath = "api/v2/userprofile/refresh"; - return ConfigureAndExecute<UserProfile>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<UserProfile>(HttpMethod.GET, resourcePath, queryParameters, null); } /// <summary> /// The Video API is used to get video files data from the user's social account.<br><br><b>Supported Providers:</b> Facebook, Google, Live, Vkontakte @@ -943,7 +944,7 @@ public ApiResponse<UserProfile> GetRefreshedSocialUserProfile(string accessToken /// <returns>Response containing Definition of Video Data with Cursor</returns> /// 39.2 - public ApiResponse<CursorResponse<Video>> GetVideos(string accessToken, string nextCursor) + public async Task<ApiResponse<CursorResponse<Video>>> GetVideos(string accessToken, string nextCursor) { if (string.IsNullOrWhiteSpace(accessToken)) { @@ -961,7 +962,7 @@ public ApiResponse<CursorResponse<Video>> GetVideos(string accessToken, string n var resourcePath = "api/v2/video"; - return ConfigureAndExecute<CursorResponse<Video>>(HttpMethod.GET, resourcePath, queryParameters, null); + return await ConfigureAndExecute<CursorResponse<Video>>(HttpMethod.GET, resourcePath, queryParameters, null); } } } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/BaseConstants.cs b/Source/LoginRadiusSDK.V2/BaseConstants.cs old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/Common/JwtTokenValidation.cs b/Source/LoginRadiusSDK.V2/Common/JwtTokenValidation.cs new file mode 100644 index 0000000..00e67e4 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Common/JwtTokenValidation.cs @@ -0,0 +1,60 @@ + +#if NETSTANDARD2_0 || NET45 +using System; +using System.IdentityModel.Tokens.Jwt; + +using System.Text; +using Microsoft.IdentityModel.Tokens; +# endif +namespace LoginRadiusSDK.V2.Common +{ +#if NETSTANDARD2_0 || NET45 + + public class JwtTokenValidation + { + + public JwtResponse validateJwtToken(JwtValidationParameters jwt) + + { + if (!string.IsNullOrEmpty(jwt.JwtToken) && !string.IsNullOrWhiteSpace(jwt.Secret)) + { + var tokenHandler = new JwtSecurityTokenHandler(); + try + { + var principal = tokenHandler.ValidateToken(jwt.JwtToken, + new TokenValidationParameters + { + ValidateIssuerSigningKey = jwt.ValidateIssuerSigningKey, + ValidateIssuer = jwt.ValidateIssuer, + ValidateAudience = jwt.ValidateAudience, + ValidIssuer = jwt.Issuer, + ValidAudience = jwt.Audience, + IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(jwt.Secret)) + }, out var rawValidatedToken); + + + return (JwtResponse)rawValidatedToken; + + } + catch (System.Exception e) + { + + return new JwtResponse { Error = e }; + } + } + + return null; + } + + } + + public class JwtResponse : JwtSecurityToken + { + + public System.Exception Error { get; set; } + + } + +#endif +} + diff --git a/Source/LoginRadiusSDK.V2/Common/JwtValidationParameters.cs b/Source/LoginRadiusSDK.V2/Common/JwtValidationParameters.cs new file mode 100644 index 0000000..8b7fdd9 --- /dev/null +++ b/Source/LoginRadiusSDK.V2/Common/JwtValidationParameters.cs @@ -0,0 +1,17 @@ +using System; +namespace LoginRadiusSDK.V2.Common +{ + public class JwtValidationParameters + { + + public string JwtToken { get; set; } + public string Secret { get; set; } + public bool ValidateIssuerSigningKey { get; set; } = true; + public bool ValidateIssuer { get; set; } = false; + public bool ValidateAudience { get; set; } = false; + public string Issuer { get; set; } = ""; + public string Audience { get; set; } = ""; + + } + +} diff --git a/Source/LoginRadiusSDK.V2/Common/LoginRadiusResource.cs b/Source/LoginRadiusSDK.V2/Common/LoginRadiusResource.cs index 5e306bc..56291b5 100644 --- a/Source/LoginRadiusSDK.V2/Common/LoginRadiusResource.cs +++ b/Source/LoginRadiusSDK.V2/Common/LoginRadiusResource.cs @@ -4,6 +4,7 @@ using System.Security.Cryptography; using System.Text; using System.Threading; +using System.Threading.Tasks; using LoginRadiusSDK.V2.Exception; using LoginRadiusSDK.V2.Http; using LoginRadiusSDK.V2.Util; @@ -78,10 +79,10 @@ static LoginRadiusResource() /// <param name="payload">JSON request payload</param> /// <param name="queryParameters"></param> /// <returns>Response object or null otherwise for void API calls</returns> - public static object ConfigureAndExecute(HttpMethod httpMethod, string resource, + public async Task<object> ConfigureAndExecute(HttpMethod httpMethod, string resource, QueryParameters queryParameters, string payload = "") { - return ConfigureAndExecute<object>(httpMethod, resource, queryParameters, payload); + return await ConfigureAndExecute<object>(httpMethod, resource, queryParameters, payload); } static string CreateHash(string apiSecret, string endPoint, string httpMethod, string expiryTime, @@ -126,9 +127,9 @@ static string CreateHash(string apiSecret, string endPoint, string httpMethod, s /// <param name="httpMethod"></param> /// <param name="resource"></param> /// <returns></returns> - protected static ApiResponse<T> ConfigureAndExecute<T>(HttpMethod httpMethod, string resource) + protected async Task<ApiResponse<T>> ConfigureAndExecute<T>(HttpMethod httpMethod, string resource) { - return ConfigureAndExecute<T>(httpMethod, resource, null, null); + return await ConfigureAndExecute<T>(httpMethod, resource, null, null); } /// <summary> @@ -140,9 +141,9 @@ protected static ApiResponse<T> ConfigureAndExecute<T>(HttpMethod httpMethod, st /// <param name="resource"></param> /// <param name="payload"></param> /// <returns></returns> - protected static ApiResponse<T> ConfigureAndExecute<T>(HttpMethod httpMethod,string resource,string payload) + protected async Task<ApiResponse<T>> ConfigureAndExecute<T>(HttpMethod httpMethod,string resource,string payload) { - return ConfigureAndExecute<T>(httpMethod, resource, null, payload); + return await ConfigureAndExecute<T>(httpMethod, resource, null, payload); } /// <summary> @@ -157,7 +158,7 @@ protected static ApiResponse<T> ConfigureAndExecute<T>(HttpMethod httpMethod,str /// <param name="headers"></param> /// <returns>Response object or null otherwise for void API calls</returns> /// <exception cref="HttpException">Thrown if there was an error sending the request.</exception> - protected static ApiResponse<T> ConfigureAndExecute<T>(HttpMethod httpMethod,string resource = "" , + protected async Task<ApiResponse<T>> ConfigureAndExecute<T>(HttpMethod httpMethod,string resource = "" , QueryParameters queryParameters = null, string payload = "", Dictionary<string, string> headers = null) { try @@ -210,7 +211,7 @@ protected static ApiResponse<T> ConfigureAndExecute<T>(HttpMethod httpMethod,str payload = payload ?? ""; - var response = connectionHttp.Execute(payload, httpRequest, payload.Length); + var response = await connectionHttp.Execute(payload, httpRequest, payload.Length); if (response.Contains("errorCode")) { var exception = new ApiResponse<T> @@ -227,7 +228,6 @@ protected static ApiResponse<T> ConfigureAndExecute<T>(HttpMethod httpMethod,str { return (ApiResponse<T>)Convert.ChangeType(response, typeof(T)); } - return new ApiResponse<T> { Response = JsonFormatter.ConvertFromJson<T>(response) }; } diff --git a/Source/LoginRadiusSDK.V2/Exception/ConfigException.cs b/Source/LoginRadiusSDK.V2/Exception/ConfigException.cs old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/Exception/ConnectionException.cs b/Source/LoginRadiusSDK.V2/Exception/ConnectionException.cs old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/Exception/HttpException.cs b/Source/LoginRadiusSDK.V2/Exception/HttpException.cs old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/Exception/LoginRadiusException.cs b/Source/LoginRadiusSDK.V2/Exception/LoginRadiusException.cs old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/Http/HttpConnection.cs b/Source/LoginRadiusSDK.V2/Http/HttpConnection.cs old mode 100755 new mode 100644 index 77c5955..28c7020 --- a/Source/LoginRadiusSDK.V2/Http/HttpConnection.cs +++ b/Source/LoginRadiusSDK.V2/Http/HttpConnection.cs @@ -1,6 +1,7 @@ using System.Collections.Concurrent; using System.IO; using System.Net; +using System.Threading.Tasks; using LoginRadiusSDK.V2.Exception; namespace LoginRadiusSDK.V2.Http @@ -183,7 +184,7 @@ private HttpWebRequest CopyHttpWebRequestHeaders(HttpWebRequest httpRequest, Htt /// <param name="httpRequest"></param> /// <param name="contentLength"></param> /// <returns>A string containing the response from the remote host.</returns> - public string Execute(string payLoad, HttpWebRequest httpRequest, int contentLength) + public async Task<string> Execute(string payLoad, HttpWebRequest httpRequest, int contentLength) { int retriesConfigured = _config.ContainsKey(LRConfigConstants.HttpConnectionRetryConfig) && int.TryParse(_config[LRConfigConstants.HttpConnectionRetryConfig], out int retriesInt) @@ -228,7 +229,7 @@ public string Execute(string payLoad, HttpWebRequest httpRequest, int contentLen #if NetFramework stream = httpRequest.GetRequestStream(); #else - stream = httpRequest.GetRequestStreamAsync().Result; + stream = await httpRequest.GetRequestStreamAsync(); #endif using (StreamWriter writerStream = new StreamWriter(stream)) { @@ -243,7 +244,7 @@ public string Execute(string payLoad, HttpWebRequest httpRequest, int contentLen } WebResponse webResponse = null; #if !NetFramework - webResponse = httpRequest.GetResponseAsync().Result; + webResponse = await httpRequest.GetResponseAsync(); #else webResponse = httpRequest.GetResponse(); #endif @@ -257,8 +258,12 @@ public string Execute(string payLoad, HttpWebRequest httpRequest, int contentLen } using (StreamReader readerStream = new StreamReader(responseWeb.GetResponseStream())) - { + { +#if NET40 ResponseDetails.Body = readerStream.ReadToEnd().Trim(); +#else + ResponseDetails.Body = await readerStream.ReadToEndAsync(); +#endif return ResponseDetails.Body; } } @@ -368,4 +373,5 @@ private void CatchException(WebException ex, HttpWebRequest httpRequest) throw rethrowEx; } } + } \ No newline at end of file diff --git a/Source/LoginRadiusSDK.V2/Http/HttpHeader.cs b/Source/LoginRadiusSDK.V2/Http/HttpHeader.cs old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/Http/HttpResponse.cs b/Source/LoginRadiusSDK.V2/Http/HttpResponse.cs old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/LoginRadiusSDK.V2.csproj b/Source/LoginRadiusSDK.V2/LoginRadiusSDK.V2.csproj old mode 100755 new mode 100644 index 121567b..6560a2e --- a/Source/LoginRadiusSDK.V2/LoginRadiusSDK.V2.csproj +++ b/Source/LoginRadiusSDK.V2/LoginRadiusSDK.V2.csproj @@ -25,12 +25,11 @@ <RepositoryType>Github</RepositoryType> <Company>LoginRadius Inc.</Company> <GeneratePackageOnBuild>True</GeneratePackageOnBuild> - <Version>10.0.0</Version> - <AssemblyVersion>10.0.0.0</AssemblyVersion> - <FileVersion>10.0.0.0</FileVersion> + <Version>11.0.0</Version> + <AssemblyVersion>11.0.0.0</AssemblyVersion> + <FileVersion>11.0.0.0</FileVersion> <RepositoryUrl>/~https://github.com/LoginRadius/dot-net-sdk</RepositoryUrl> <SignAssembly>true</SignAssembly> - <DelaySign>false</DelaySign> <AssemblyOriginatorKeyFile>LoginRadiusSDKV2.snk</AssemblyOriginatorKeyFile> </PropertyGroup> @@ -76,6 +75,12 @@ <DebugSymbols>true</DebugSymbols> </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <AllowUnsafeBlocks>false</AllowUnsafeBlocks> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <AllowUnsafeBlocks>false</AllowUnsafeBlocks> + </PropertyGroup> <ItemGroup Condition=" '$(TargetFramework)' == 'net45' "> <Reference Include="mscorlib" /> <Reference Include="System" /> @@ -124,5 +129,16 @@ <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="2.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.0.0" /> + <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.8.0" /> + </ItemGroup> + <ItemGroup Condition="'$(TargetFramework)' == 'net40'"> + <PackageReference Include="Microsoft.Bcl.Async" Version="1.0.168"> + </PackageReference> + </ItemGroup> + <ItemGroup> + <Reference Include="System.IdentityModel" /> + </ItemGroup> + <ItemGroup Condition="'$(TargetFramework)' == 'net45'"> + <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.8.0" /> </ItemGroup> </Project> diff --git a/Source/LoginRadiusSDK.V2/LoginRadiusSDK.V2.csproj.DotSettings b/Source/LoginRadiusSDK.V2/LoginRadiusSDK.V2.csproj.DotSettings old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/LoginRadiusSDKGlobalConfig.cs b/Source/LoginRadiusSDK.V2/LoginRadiusSDKGlobalConfig.cs old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/Manager/ConfigManager.cs b/Source/LoginRadiusSDK.V2/Manager/ConfigManager.cs old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/Manager/ConnectionManager.cs b/Source/LoginRadiusSDK.V2/Manager/ConnectionManager.cs old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/Manager/SDKConfigHandler.cs b/Source/LoginRadiusSDK.V2/Manager/SDKConfigHandler.cs old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/SDKVersion.cs b/Source/LoginRadiusSDK.V2/SDKVersion.cs old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/Util/LoginRadiusArgumentValidator.cs b/Source/LoginRadiusSDK.V2/Util/LoginRadiusArgumentValidator.cs old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/Util/QueryParameters.cs b/Source/LoginRadiusSDK.V2/Util/QueryParameters.cs old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/Util/SDKUtil.cs b/Source/LoginRadiusSDK.V2/Util/SDKUtil.cs old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/Util/Serialization/ILoginRadiusSerializableObject.cs b/Source/LoginRadiusSDK.V2/Util/Serialization/ILoginRadiusSerializableObject.cs old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/Util/Serialization/JsonFormatter.cs b/Source/LoginRadiusSDK.V2/Util/Serialization/JsonFormatter.cs old mode 100755 new mode 100644 diff --git a/Source/LoginRadiusSDK.V2/Util/Serialization/LoginRadiusSerializableObject.cs b/Source/LoginRadiusSDK.V2/Util/Serialization/LoginRadiusSerializableObject.cs old mode 100755 new mode 100644