public static CRMProxyAuthenticator Create(IOptions <ProxyConfig> options) { var credBldr = new CredentialBuilder(); var config = options.Value; var ucred = new UserCredentails(config); for (; ;) { Log.Info(" "); Log.Info(" --- --- --- "); var rx = credBldr.GetCredentials(); try { Log.Info("Authenticating ..."); ucred.Authenticate(rx.Item1, rx.Item2); return(new CRMProxyAuthenticator(config, ucred)); } catch (Exception ex) { Log.Error(ex.ToString()); Log.Info("Press any key to continue"); Console.ReadKey(); } } }
private CRMProxyAuthenticator(ProxyConfig config, UserCredentails creds) { _creds = creds; _config = config; }