예제 #1
0
        public async void LaunchBrowserIfAuthenticatedOnSignOut()
        {
            bool?      browserLaunched = false;
            OidcClient client          = new OidcClient(new OktaConfig("testoktaid", "https://dev-00000.oktapreview.com", "com.test:/redirect", "com.test:/logout"));

            client.OnLaunchBrowser = (url) => browserLaunched = true;
            client.SignOutOfOktaAsync(new OktaState("testAccessToken", "testTokenType"));
            Assert.True(browserLaunched);
        }
예제 #2
0
        public void NotLaunchBrowserIfNotAuthenticatedOnSignOut()
        {
            bool?      browserLaunched = false;
            OidcClient client          = new OidcClient(new OktaConfig("testoktaid", "https://dev-00000.oktapreview.com", "com.test:/redirect", "com.test:/logout"));

            client.OnLaunchBrowser = (url) => browserLaunched = true;
            client.SignOutOfOktaAsync(new OktaState(string.Empty, string.Empty));
            Assert.False(browserLaunched);
        }
예제 #3
0
        public void SetStateCodeVerifierAndChallengeOnSignOut()
        {
            OidcClient client = new OidcClient(new OktaConfig("testoktaid", "https://dev-00000.oktapreview.com", "com.test:/redirect", "com.test:/logout"));

            Assert.True(string.IsNullOrEmpty(client.State_Internal));
            Assert.True(string.IsNullOrEmpty(client.CodeChallenge_Internal));
            Assert.True(string.IsNullOrEmpty(client.CodeVerifier_Internal));

            client.SignOutOfOktaAsync(new OktaState("testAccessToken", "testTokenType"));

            Assert.False(string.IsNullOrEmpty(client.State_Internal));
            Assert.False(string.IsNullOrEmpty(client.CodeChallenge_Internal));
            Assert.False(string.IsNullOrEmpty(client.CodeVerifier_Internal));
        }