CEF Embedded Camera Security on Mac OSX

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CEF Embedded Camera Security on Mac OSX

Postby FelixCat » Fri Jan 21, 2022 12:44 pm

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
FelixCat
Techie
 
Posts: 14
Joined: Tue Jan 11, 2022 10:58 am

Re: CEF Embedded Camera Security on Mac OSX

Postby magreenblatt » Fri Jan 21, 2022 2:04 pm

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
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: CEF Embedded Camera Security on Mac OSX

Postby FelixCat » Fri Jan 21, 2022 2:41 pm

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....) ?
FelixCat
Techie
 
Posts: 14
Joined: Tue Jan 11, 2022 10:58 am

Re: CEF Embedded Camera Security on Mac OSX

Postby FelixCat » Fri Jan 21, 2022 3:33 pm

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).
Last edited by FelixCat on Fri Jan 21, 2022 5:16 pm, edited 1 time in total.
FelixCat
Techie
 
Posts: 14
Joined: Tue Jan 11, 2022 10:58 am

Re: CEF Embedded Camera Security on Mac OSX

Postby FelixCat » Fri Jan 21, 2022 5:16 pm

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
FelixCat
Techie
 
Posts: 14
Joined: Tue Jan 11, 2022 10:58 am

Re: CEF Embedded Camera Security on Mac OSX

Postby magreenblatt » Fri Jan 21, 2022 7:15 pm

There’s some discussion of entitlements at viewtopic.php?f=6&t=16481. It may require the app to be notarized.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: CEF Embedded Camera Security on Mac OSX

Postby FelixCat » Mon Jan 24, 2022 2:42 pm

Thank-you for this info. I think this is on track... I'll post back any results.

- fc
FelixCat
Techie
 
Posts: 14
Joined: Tue Jan 11, 2022 10:58 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 25 guests