CefSharp Browser control not working with Azure AD Conditional access - azure-active-directory

We configured our Azure AD application registration to use “Conditional Access” restrictions to lock down the application to machines that are registered to the domain. Unfortunately, in order to successfully authenticate with Conditional Access enabled on chromium based browsers, a browser extension is required
There is quite a bit of documentation around this on Microsoft’s website
• Conditional Access require managed device - Azure Active Directory | Microsoft Docs
• Conditions in Conditional Access policy - Azure Active Directory | Microsoft Docs
when the user trying to log in with cefsharp browser control we see the following error. Tried enabling the browser extension did not help

Sadly CefSharp will not work with Device Management policy.
To prove device identity on Windows, the Windows broker (WAM) needs to intercept the network traffic and inject the device id. The following browsers are supported: Edge, old IE, Chrome with Windows Accounts extension and I'm not sure about Firefox.
Since CefSharp is based on Chromium but does not have the extension (and, afaik, there is no way to install it), WAM cannot inject the device ID in the requests made to AAD.
Possible workaround:
use WebView2 SDK on Windows, which is based on Edge, which is also based on Chromium... At the time of writing, Mac support is planned but not released.
And use Cef on Mac and Linux.

Due to the nature of this issue and complexity behind it, I had to migrate off CefSharp to use the new WebView2 browser component until there is a supported approach released for CefSharp and other third-party browsers to inject logic like the code below. The EdgeWebView2 works by enabling the SSO flag get_AllowSingleSignOnUsingOSPrimaryAccount
C# .NET example code below using the EdgeWebView2 browser component (as of writing this is the only way I know to defeat the authentication message "You can't get there from here"):
CoreWebView2EnvironmentOptions envOptions = new CoreWebView2EnvironmentOptions()
{
AllowSingleSignOnUsingOSPrimaryAccount = true
};
CoreWebView2Environment env = CoreWebView2Environment.CreateAsync(options: envOptions).Result;
webview.EnsureCoreWebView2Async(env);
webview.Source = new Uri("https://portal.azure.com/");

Related

How to bypass Browser add-ons from Blocking Azure Application Insight Logs

I'm using Application Insights JS SDK React Plugin to log application insights data to Azure. This data publishing could get blocked by some browser extensions such as Ad Blocker, Privacy Badger, etc. In my case analytics got blocked by Privacy Badger while experimenting.
I know it can be prevented by disabling relevant add-ons for the particular site from the browser. Just wondering is there a particular way to prevent this from implementation side without asking users to disable their add-ons.
Have you considered building a proxy to forward traffic to your own domain before then passing it off to App Insights?
https://github.com/shaneochotny/ApplicationInsights-JS-Proxy
Show how to proxy requests from the Application Insights Javascript SDK instead of sending telemetry directly to dc.services.visualstudio.com. This allows you to do things such as use your own custom domain and/or hide the Instrumentation Key.
There are step by step instructions in that link to configure this

Is it possible to access wifi direct API and other windows APIs in PWA for windows 10?

I'm planning to create an application for windows that needs access wifi direct api to allow service discovery and advertisement. I come from web and react native background, so after seeing so many options to go with on the microsoft website, i'm not sure what should I go with.
On the microsoft's choose your platform page (https://learn.microsoft.com/en-us/windows/apps/desktop/choose-your-platform), they also mentioned PWAs (although close to the bottom). And after checking the PWA page, i'm not sure if it allows access (and to what extent) to the native API, the wifi direct api in particular.
So can someone please tell me if it's possible to access wifi direct api in a PWA and should I really go with PWAs?
Is it possible to access wifi direct API and other windows APIs in PWA for windows 10?
If you plan to build your UWP application through PWA and use some WinRT-API, you need to use Visual Studio 2017.
PWA could access native api with WinRT, but Windows will remove Edge-UWP step by step in the feature, it is may not good recommendation.
For accessing navtive api with WinRT, please refer here. Please note before access WinRT, you need to add the webset uri then set WinRT access as all in package.appxmanifest Content URIs tab.

Programmatically login to site with Apache basic authentication from WPF .net application

We have a requirement to open a web site URL in default browser of the client machine from our WPF application. All this time we were using simple Process.Start(URL) and it was working fine. Until now where one of customer has this "URL" behind basic authentication. The site they want us to browse using URL is hosted on Apache web server. From what I know, if we have https://username:password#domain.com it directly takes us in site without the username/password challenge and it works fine in Chrome and Firefox, however newer version on IE stopped supporting it for security reasons.
Can someone suggest some alternate approach to achieve same considering following objectives ?
List item
Browse to URL with passing in username password.
Open default browser in client's desktop machine.
Don't want to user browser control
At minimum should work in 3 browsers - IE, Firefox and Chrome
We cannot make changes to client desktop's machine, so solution shouldn't require any special settings.
The workaround for developers from the Microsoft Support site : http://support.microsoft.com/kb/834489
Workarounds for application and Web site developers
URLs that are opened by objects that call WinInet or Urlmon functions
For objects that use an HTTP or an HTTPS URL that includes user
information when they call a WinInet or Urlmon function such as
InternetOpenURL, rewrite the object to use one of the following
methods to send user information to the Web site: Use the
InternetSetOption function and include the following option flags:
INTERNET_OPTION_USERNAME INTERNET_OPTION_PASSWORD Note For these
flags, the InternetSetOption option must have a handle returned by the
InternetConnect function. Therefore, if the application uses the
InternetOpenUrl function, modify the application to use the
InternetConnect, HttpOpenRequest and HttpSendRequest WinInet
functions. For more information about how to use these functions,
visit the following Microsoft Web sites:
http://msdn2.microsoft.com/en-us/library/Aa384363
http://msdn2.microsoft.com/en-us/library/Aa384233
http://msdn2.microsoft.com/en-us/library/aa384247.aspx Use the
IAuthenticate Interface. For more information about how to use the
IAuthenticate Interface, visit the following Microsoft Web site:
http://msdn2.microsoft.com/en-us/library/ms775080.aspx
Was this option tried ?

Chrome Extension: retrieve AD credentials from session to auto-login on Wordpress

I need to create a Chrome extension that will allow us to get the user's credentials so that he will be automatically loging into the intranet (heavily-modified Wordpress).
I know for sure that Firefox can access Registry and AD credentials, but with the erratic updates and extensions that are constantly disabled by those, we can't afford to manually check every time firefox has an update.
I've searched on Google and so far I haven't found any answer. I've checked on Google labs and also on the Chrome extension store to see if there was a similar extension, but I found nothing either.
I've seen ADM released by chrome but this is for network administrators who want to centralize settings.
Any one has a clue on this?
This is not well documented, but after some research I found that this capability is built into Chrome. All you need to do is add the Wordpress site to the "Intranet" zone on a Windows PC.
The setting is accessible from Chrome (even though it is a Windows setting):
Settings/Advanced/Change Proxy Settings/Security/Local Intranet/Sites

Silverlight 5 trust application issue

In silverlight5 beta, it supports trust application which allows loading local files. I tried and it works fantastic in both OOB and in browser mode. One question is that, when put my cap on the server, it works fine in OOB mode but doesn't work in browser. I think debugging locally and deployment is different. Is there a way to request the trust in browser as I tried locally?
Thanks,
Howard 
There are a number of steps needed:-
The XAP needs to be signed using a code-signing certificate
Then on the client machine
A tweak to the registry on the client machine that needs to run a trusted app inbrowser
The code signing certificate then needs to be installed on the client machine.
Those last two in a real world deployment would be configured using a Group Policy.
See the Beta document topic How to: Enable Trusted Applications to Run Inside the Browser.

Resources