Ejemplo n.º 1
0
        public void DeleteSessionToken()
        {
            OktaSettings oktaSettings = new OktaSettings();
            oktaSettings.BaseUri = new Uri(Environment.GetEnvironmentVariable("OKTA_TEST_URL"));
            oktaSettings.ApiToken = Environment.GetEnvironmentVariable("OKTA_TEST_KEY");

            String username = Environment.GetEnvironmentVariable("OKTA_TEST_ADMIN_NAME");
            String password = Environment.GetEnvironmentVariable("OKTA_TEST_ADMIN_PASSWORD");

            SessionsClient sessionsClient = new SessionsClient(oktaSettings);

            var session = sessionsClient.Create(username, password);
            sessionsClient.Close(session.Id);
        }
        public bool CloseSession(string sessionId)
        {
            bool result = false;

            try
            {
                _sessionsClient.Close(sessionId);
                result = true;
            }
            catch
            {
                // log exception
            }

            return(result);
        }
Ejemplo n.º 3
0
        public void DeleteSessionToken()
        {
            OktaSettings oktaSettings = new OktaSettings();

            oktaSettings.BaseUri  = new Uri(Environment.GetEnvironmentVariable("OKTA_TEST_URL"));
            oktaSettings.ApiToken = Environment.GetEnvironmentVariable("OKTA_TEST_KEY");

            String username = Environment.GetEnvironmentVariable("OKTA_TEST_ADMIN_NAME");
            String password = Environment.GetEnvironmentVariable("OKTA_TEST_ADMIN_PASSWORD");

            SessionsClient sessionsClient = new SessionsClient(oktaSettings);

            var session = sessionsClient.Create(username, password);

            sessionsClient.Close(session.Id);
        }