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); }
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); }
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)); }