C# Class Microsoft.Identity.Client.SilentWebUI

Inheritance: WebUI, IDisposable
Show file Open project: AzureAD/microsoft-authentication-library-for-dotnet

Public Methods

Method Description
Dispose ( ) : void
SilentWebUI ( ) : System

Protected Methods

Method Description
Dispose ( bool disposing ) : void
OnAuthenticate ( string headers ) : AuthorizationResult

Callers expect the call to show the authentication dialog to be synchronous. This is easy in the interactive case as ShowDialog is a synchronous call. However, ShowDialog will always show the dialog. It can not be hidden. So it can not be used in the silent case. Instead we need to do the equivalent of creating our own modal dialog. We start a new thread, launch an invisible window on that thread. The original calling thread blocks until the secondary UI thread completes.

Private Methods

Method Description
Cleanup ( ) : void
StartUIThread ( string headers ) : Thread
ThrowIfTransferredException ( ) : void
UIDoneHandler ( object sender, SilentWebUIDoneEventArgs e ) : void
WaitForCompletionOrTimeout ( Thread uiThread ) : void

Waits on the UI Thread to complete normally for NavigationOverallTimeout. After it attempts shutdown the UI thread graceful followed by aborting the thread if a graceful shutdown is not successful.

Method Details

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

OnAuthenticate() protected method

Callers expect the call to show the authentication dialog to be synchronous. This is easy in the interactive case as ShowDialog is a synchronous call. However, ShowDialog will always show the dialog. It can not be hidden. So it can not be used in the silent case. Instead we need to do the equivalent of creating our own modal dialog. We start a new thread, launch an invisible window on that thread. The original calling thread blocks until the secondary UI thread completes.
protected OnAuthenticate ( string headers ) : AuthorizationResult
headers string
return Microsoft.Identity.Client.Internal.AuthorizationResult

SilentWebUI() public method

public SilentWebUI ( ) : System
return System