PowerBuilder - Basic Authentication example
The Basic Authentication example has a demonstration of how you can navigate to a page that is protected by basic authentication.

The screenshot above shows what it looks like if you navigate to our example page.
If you click on the "protected area" link, then you'll get the following:

Now click on cancel, you'll get the error page.
Press the back button to return to the start page.
Now check the "Automatic login" checkbox at the bottom right and click on the "protected area" link again.
This time, it will give you access to the page without throwing up the username+password dialog.
In other words, the login was done programmatically.

Ok, so how does all of this work?
The main parts of the form are a simplified version of the Web Browser example.
Then there's the extra checkbox and this bit in the edgewebbrowser control.
event onbasicauthenticationrequested(oleobject args)
IF AutologinCheckbox.checked = true THEN
Args.Response.UserName = "test"
Args.Response.Password = "vapp5eGvJeXsDuTOEK62"
END IF
end event
The only time the OnBasicAuthenticationRequested event triggers is when the web page has a basic authentication http request challenge. The args parameter is of type AntViewBasicAuthenticationRequestedEventArgs and provides a way to handle the response.
In our example code we provide the username/password based on a checkbox setting.
In a real live scenario you probably want to check the Source property to identify the web page for when you want to provide a username and password.
AntView - The MS Edge WebView2 ActiveX control Date last changed: 11/05/2025