public Form1() { InitializeComponent(); userName = UserNameTextBox.Text; password = PasswordTextBox.Text; this.securityHelper = new SecurityHelper(userName, password); this.appSettingsHelper = new RegistryAppSettingsHelper(this.securityHelper); this.client = AuthenticationClientUtils.CreateAuthenticationClient(this.appSettingsHelper); this.stateController = new AuthnStateController(this.client, this.appSettingsHelper, userName); }
public static CustomAuthnClient CreateAuthenticationClient(IAppSettingsHelper appSettingsHelper) { string urlDetails = appSettingsHelper.GetBaseUrl(); if (urlDetails != null) { OktaClientConfiguration oktaClientConfiguration = new OktaClientConfiguration { OktaDomain = urlDetails, }; var customClientParams = GetDefaultCustomClientParams(oktaClientConfiguration); CustomAuthnClient customAuthnClient = new CustomAuthnClient(customClientParams.Item1, customClientParams.Item2, customClientParams.Item3); return(customAuthnClient); } else { throw new Exception("Could not reach out registry to get okta base URL"); } }