public void VerifyCloseCombine(Guid merchantId, string smsCode, string googleCode) { var merchant = new MerchantAccountDAC().GetById(merchantId); List <CombinedVerifyOption> options = new List <CombinedVerifyOption> { new CombinedVerifyOption { AuthType = (byte)ValidationFlag.Cellphone, Code = smsCode }, new CombinedVerifyOption { AuthType = (byte)ValidationFlag.GooogleAuthenticator, Code = googleCode } }; UserSecrets userSecrets = new UserSecrets { ValidationFlag = merchant.ValidationFlag, GoogleAuthSecretKey = merchant.AuthSecretKey }; SecurityVerify.CombinedVerify(SystemPlatform.FiiiPOS, merchant.Id.ToString(), userSecrets, options, null); var model = SecurityVerify.GetModel <CloseGoogleAuth>(new CustomVerifier("CloseGoogleAuth"), SystemPlatform.FiiiPOS, merchant.Id.ToString()); model.CombinedVerified = true; SecurityVerify.SetModel(new CustomVerifier("CloseGoogleAuth"), SystemPlatform.FiiiPOS, merchant.Id.ToString(), model); }
public void VerifyWithdrawCombine(Guid accountId, string smsCode, string googleCode, string divisionCode) { UserAccount user = new UserAccountDAC().GetById(accountId); List <CombinedVerifyOption> options = new List <CombinedVerifyOption> { new CombinedVerifyOption { AuthType = (byte)ValidationFlag.Cellphone, Code = smsCode }, new CombinedVerifyOption { AuthType = (byte)ValidationFlag.GooogleAuthenticator, Code = googleCode } }; UserSecrets userSecrets = new UserSecrets { ValidationFlag = user.ValidationFlag, GoogleAuthSecretKey = user.AuthSecretKey }; SecurityVerify.CombinedVerify(SystemPlatform.FiiiPay, user.Id.ToString(), userSecrets, options, divisionCode); var model = SecurityVerify.GetModel <WithdrawVerify>(new CustomVerifier("UserWithdraw"), SystemPlatform.FiiiPay, user.Id.ToString()); model.CombinedVerified = true; SecurityVerify.SetModel(new CustomVerifier("UserWithdraw"), SystemPlatform.FiiiPay, user.Id.ToString(), model); }
public void VerifyModifyCellphoneCombine(Guid accountId, string smsCode, string googleCode) { MerchantAccount merchant = new MerchantAccountDAC().GetById(accountId); if (merchant == null) { throw new CommonException(ReasonCode.ACCOUNT_NOT_EXISTS, Resources.用户不存在); } List <CombinedVerifyOption> options = new List <CombinedVerifyOption> { new CombinedVerifyOption { AuthType = (byte)ValidationFlag.Cellphone, Code = smsCode }, new CombinedVerifyOption { AuthType = (byte)ValidationFlag.GooogleAuthenticator, Code = googleCode } }; UserSecrets userSecrets = new UserSecrets { ValidationFlag = merchant.ValidationFlag, GoogleAuthSecretKey = merchant.AuthSecretKey }; SecurityVerify.CombinedVerify(SystemPlatform.FiiiPOS, accountId.ToString(), userSecrets, options); var model = SecurityVerify.GetModel <ModifyCellphoneVerify>(new CustomVerifier("ModifyCellphone"), SystemPlatform.FiiiPOS, accountId.ToString()); model.CombinedVerified = true; SecurityVerify.SetModel(new CustomVerifier("ModifyCellphone"), SystemPlatform.FiiiPOS, accountId.ToString(), model); }
public void SetSecrets(UserSecrets secrets) { using (var prefs = Application.Context.GetSharedPreferences("IC6.Xwitter", FileCreationMode.Private)) { using (var prefEditor = prefs.Edit()) { prefEditor.PutString(OAuth.OAuthToken.ToString(), secrets.OAuthToken); prefEditor.PutString(OAuth.OAuthSecret.ToString(), secrets.OAuthSecret); prefEditor.Commit(); } } }
protected LrService( ILogger logger, ILrAuthProvider authProvider) { Logger = logger; AuthProvider = authProvider; this.Lr = new LrProvider( new BaseClientService.Initializer { Serializer = new WebFormsToJsonSerializer() }); this.UserSecrets = this.AuthProvider.GetUserSecrets(); this.CommonSecrets = this.AuthProvider.GetCommonSecrets(); }
public MainPageViewModel(ILoginStore loginStoreSvc, ILinqToTwitterAuthorizer authorizeSvc) { _loginStoreService = loginStoreSvc; _userSecrets = loginStoreSvc.GetSecrets(); _authSvc = authorizeSvc; if (_userSecrets != null) { _auth = _authSvc.GetAuthorizer(consumerKey, consumerSecret, _userSecrets.OAuthToken, _userSecrets.OAuthSecret); } }
public UserSecrets GetSecrets() { using (var prefs = Application.Context.GetSharedPreferences("IC6.Xwitter", FileCreationMode.Private)) { var secrets = new UserSecrets() { OAuthToken = prefs.GetString(OAuth.OAuthToken.ToString(), null), OAuthSecret = prefs.GetString(OAuth.OAuthSecret.ToString(), null) }; if (secrets.OAuthSecret == null || secrets.OAuthToken == null) { return(null); } return(secrets); } }
public void VerifyBindCombine(UserAccount user, string smsCode) { List <CombinedVerifyOption> options = new List <CombinedVerifyOption> { new CombinedVerifyOption { AuthType = (byte)ValidationFlag.Cellphone, Code = smsCode } }; UserSecrets userSecrets = new UserSecrets { ValidationFlag = user.ValidationFlag }; SecurityVerify.CombinedVerify(SystemPlatform.FiiiPay, user.Id.ToString(), userSecrets, options, null); var model = SecurityVerify.GetModel <BindGoogleAuth>(new CustomVerifier("BindGoogleAuth"), SystemPlatform.FiiiPay, user.Id.ToString()); model.CombinedVerified = true; SecurityVerify.SetModel(new CustomVerifier("BindGoogleAuth"), SystemPlatform.FiiiPay, user.Id.ToString(), model); }
public void VerifyResetPinCombine(Guid accountId, string idNumber, string smsCode, string googleCode) { MerchantAccount merchant = new MerchantAccountDAC().GetById(accountId); if (merchant == null) { throw new CommonException(ReasonCode.ACCOUNT_NOT_EXISTS, Resources.用户不存在); } List <CombinedVerifyOption> options = new List <CombinedVerifyOption> { new CombinedVerifyOption { AuthType = (byte)ValidationFlag.Cellphone, Code = smsCode }, new CombinedVerifyOption { AuthType = (byte)ValidationFlag.GooogleAuthenticator, Code = googleCode } }; UserSecrets userSecrets = new UserSecrets { ValidationFlag = merchant.ValidationFlag, GoogleAuthSecretKey = merchant.AuthSecretKey }; MerchantProfile profile = new MerchantProfileAgent().GetMerchantProfile(accountId); if (profile != null && profile.L1VerifyStatus == FiiiPay.Entities.Enums.VerifyStatus.Certified) { options.Add(new CombinedVerifyOption { AuthType = (byte)ValidationFlag.IDNumber, Code = idNumber }); userSecrets.IdentityNo = profile.IdentityDocNo; } SecurityVerify.CombinedVerify(SystemPlatform.FiiiPOS, accountId.ToString(), userSecrets, options); var model = new ResetPinVerify { CombinedVerified = true }; SecurityVerify.SetModel(new CustomVerifier("ResetPin"), SystemPlatform.FiiiPOS, accountId.ToString(), model); }
public void VerifyResetPinCombine(Guid accountId, string idNumber, string smsCode, string googleCode) { UserAccount user = new UserAccountDAC().GetById(accountId); List <CombinedVerifyOption> options = new List <CombinedVerifyOption> { new CombinedVerifyOption { AuthType = (byte)ValidationFlag.Cellphone, Code = smsCode }, new CombinedVerifyOption { AuthType = (byte)ValidationFlag.GooogleAuthenticator, Code = googleCode } }; UserSecrets userSecrets = new UserSecrets { ValidationFlag = user.ValidationFlag, GoogleAuthSecretKey = user.AuthSecretKey }; UserProfile profile = new UserProfileAgent().GetUserProfile(user.Id); if (profile != null && profile.L1VerifyStatus == VerifyStatus.Certified) { options.Add(new CombinedVerifyOption { AuthType = (byte)ValidationFlag.IDNumber, Code = idNumber }); userSecrets.IdentityNo = profile.IdentityDocNo; } SecurityVerify.CombinedVerify(SystemPlatform.FiiiPay, user.Id.ToString(), userSecrets, options); var model = new ResetPinVerify() { CombinedVerified = true }; SecurityVerify.SetModel(new CustomVerifier("ResetPin"), SystemPlatform.FiiiPay, user.Id.ToString(), model); }
public void VerifyUpdateCellphoneCombine(UserAccount user, string smsCode, string googleCode) { List <CombinedVerifyOption> options = new List <CombinedVerifyOption> { new CombinedVerifyOption { AuthType = (byte)ValidationFlag.Cellphone, Code = smsCode }, new CombinedVerifyOption { AuthType = (byte)ValidationFlag.GooogleAuthenticator, Code = googleCode } }; UserSecrets userSecrets = new UserSecrets { ValidationFlag = user.ValidationFlag, GoogleAuthSecretKey = user.AuthSecretKey }; SecurityVerify.CombinedVerify(SystemPlatform.FiiiPay, user.Id.ToString(), userSecrets, options); var model = SecurityVerify.GetModel <UpdateCellphoneVerify>(new CustomVerifier("UpdateCellphone"), SystemPlatform.FiiiPay, user.Id.ToString()); model.CombinedVerified = true; SecurityVerify.SetModel(new CustomVerifier("UpdateCellphone"), SystemPlatform.FiiiPay, user.Id.ToString(), model); }
public async Task InitMapperAsync(bool includeSyncUsers, bool twoPtUsersOnProject) { await Mapper.InitAsync(UserSecrets.Get("user01"), ProjectSecret(includeSyncUsers), ParatextUsersOnProject(twoPtUsersOnProject), "paratextId"); }
internal static Social GetUsersSocial(this UserSecrets us, string name) { return(us.Socials?.FirstOrDefault(s => s.Name == name)); }
public async Task SetSecretsAsync(UserSecrets secrets) { await SetSecretsAsync(secrets.OAuthToken, secrets.OAuthSecret); }