Пример #1
0
        protected void Button2_Click1(object sender, EventArgs e)
        {
            OktaSettings oktaSettings = new Okta.Core.OktaSettings();

            oktaSettings.ApiToken = "00jSoRPyhdLF9MBypNmvkdm0LEXKZAc4tam7lw1Dqq";
            oktaSettings.BaseUri  = new Uri("https://org.oktapreview.com");

            SessionsClient sessionsClient = new SessionsClient(oktaSettings);

            try
            {
                sessionsClient.CreateSession(sessionToken.Text);
                ResultOfMFA.Text = "Successful MFA with Okta";
            }
            catch (OktaException)
            {
                //Invalid session validation, don't let them through
                ResultOfMFA.Text = "Invalid MFA with Okta";
            }
            ResultOfMFA.Style.Add("display", "block");
        }
 public Session CreateSession(string sessionToken)
 {
     return(_sessionsClient.CreateSession(sessionToken));
 }