Class WindowInterop
Provides a mechanism to interact with an OAuth token window.
[Export(typeof(ITokenWindowInterop))]
[Shared]
public class WindowInterop : ITokenWindowInterop
- Inheritance
-
WindowInterop
- Implements
- Inherited Members
Methods
OpenWindowAsync(IJSRuntime, ILocalStorageService, string, string)
Opens a new window asynchronously with the specified URL and features, using the provided JS runtime and local storage service. Also, it handles the local storage entries for "token" and "fetching" before opening the window. The method waits for the "fetching" entry to be set in local storage, signaling the completion of token fetching, before returning.
public Task OpenWindowAsync(IJSRuntime jsRuntime, ILocalStorageService localStorage, string url, string feature = "toolbar=no,scrollbars=yes,resizable=yes,top=500,left=500,width=450,height=500")
Parameters
jsRuntimeIJSRuntimeThe JS runtime to use for opening the window.
localStorageILocalStorageServiceThe local storage service to use for storing and retrieving tokens.
urlstringThe URL to open in the new window.
featurestringThe features of the new window. Defaults to "toolbar=no,scrollbars=yes,resizable=yes,top=500,left=500,width=450,height=500".
Returns
- Task
A task representing the asynchronous operation.
Exceptions
- InvalidOperationException
The popup could not be opened, typically because
_content/Arc4u.OAuth2.Blazor/CreatePopupWindow.jsis not referenced by the application.- TimeoutException
The login was not completed within 5 minutes, for example because the popup was closed.