Page 1 of 1

CEF Embedded Camera Security on Mac OSX

PostPosted: Fri Jan 21, 2022 12:44 pm
by FelixCat
Hello All.

I am running OSX 12.1 "Monterey". My embedded app is using WebRTC. When I launch the page, I do not get a prompt for permission to use the camera. On (this version?) of Mac OSX, the only way to GET permissions is to have the OS prompt you the first time it attempts access. Unfortunately, it never prompts, so permission is impossible (without draconian, unsupportable measures). There is no way on OSX to pro-actively give permissions. (Dumb).

Oddly, the same page when run from the chrome browser does indeed prompt and all is well. But hitting the same page with CEF embedded, I never get a prompt. Anyone know why? I tried editing the "plist" for the app, but it doesn't yield any different results.

Has anyone else run into this issue? Anyone know how to solve this mess?

- fc

Re: CEF Embedded Camera Security on Mac OSX

PostPosted: Fri Jan 21, 2022 2:04 pm
by magreenblatt
Are you running with `--enable-media-stream --use-fake-device-for-media-stream" command-line flags? See also https://bitbucket.org/chromiumembedded/cef/issues/2582

Re: CEF Embedded Camera Security on Mac OSX

PostPosted: Fri Jan 21, 2022 2:41 pm
by FelixCat
Thanks for your reply. I did try using "--enable-media-stream". This did not seem to affect anything. I'll try adding --use-fake-device-for-media-stream.

What is the purpose of the later? (--use-fake....) ?

Re: CEF Embedded Camera Security on Mac OSX

PostPosted: Fri Jan 21, 2022 3:33 pm
by FelixCat
That did have an effect.

Now, the first time I ran I got a prompt asking me to allow access to my login keychain.

Then, instead of access denied, I got and error that some other app was using the device (but none was).

Re: CEF Embedded Camera Security on Mac OSX

PostPosted: Fri Jan 21, 2022 5:16 pm
by FelixCat
I am seeing this error in the debug output when running the "cefsimple.app":

@"2022-01-21 16:58:16.322462-0500 cefsimple Helper (Plugin)[12334:86078] [access] This app has crashed because it has a hardened runtime and attempted to access privacy-sensitive data without an entitlement indicating its intent to access this data. The app must have the '[b]com.apple.security.device.camera' entitlement.\r\n"[/b]

I tried setting the "Capabilities" for Hardened Runtime and Sandbox in XCode, both for cefsimple.app and cefsimple Helper (Plugin). I see that Xcode generates an entitlements file for both the apps (cefsimple.entitlements and cefsimple_Helper_plugin.entitlements), but the error still occurs.

I'm completely stuck as to how this can be solved. Does anyone out there have any experience with this? I realize this might be beyond the normal scope of this forum, perhaps - if so, does anyone know of other resources to investigate? I've completely exhausted google searches and apple developer docs.

- fc

Re: CEF Embedded Camera Security on Mac OSX

PostPosted: Fri Jan 21, 2022 7:15 pm
by magreenblatt
There’s some discussion of entitlements at viewtopic.php?f=6&t=16481. It may require the app to be notarized.

Re: CEF Embedded Camera Security on Mac OSX

PostPosted: Mon Jan 24, 2022 2:42 pm
by FelixCat
Thank-you for this info. I think this is on track... I'll post back any results.

- fc