Skip to content

Call WinFormsWebView2 as if it were a class library project (dll) and not an executable (exe). #126

Discussion options

You must be logged in to vote

Hi @gguaita 👋

In that sample, the WinFormsWebView2.WinFormsWebView class does all the work to create the modal form and display a WebView2 component that shows the login UI you interact with, but it is referenced by Form1, it doesn't call Form1.

In Form1.cs you create and set up an OIDC client that the WinFormsWebView class gets passed to as part of the client options.

// Form1.cs

OidcClient _oidcClient;

var options = new OidcClientOptions
{
	Authority = "https://demo.duendesoftware.com",
	ClientId = "interactive.public",
	Scope = "openid email api offline_access",
	RedirectUri = "http://localhost/winforms.client",
	Browser = new WinFormsWebView()
};

_oidcClient = new OidcClient(options);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gguaita
Comment options

Answer selected by maartenba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants