tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
79.64k stars 2.37k forks source link

[feat] Code Signing macOS Application in development mode #7930

Open wyhaya opened 9 months ago

wyhaya commented 9 months ago

Describe the problem

In development mode, Tauri does not code-sign macOS app. If your app needs to call some API that require permission control, you will need to re-authorize each time.

Example:

preview

If your application saves 100 passwords in the keychain, every time you run tauri dev, macOS will think it is a new unauthorized app, so you will have to enter the password 100 times in this dialog, which greatly affects the development experience.


Code signing in development mode will especially make sense if your app needs to access any of the ones listed below.

2

Describe the solution you'd like

When run tauri dev, check the environment variables listed here: Code Signing macOS Applications. If configured, sign the app.

Alternatives considered

No response

Additional context

No response

thewh1teagle commented 5 months ago

@wyhaya Can you tell what's the solution? Or even a workaround? Should I sign the app with self signed cert everytime it reloads? Is there a simple solution it will work with cargo tauri dev?

thewh1teagle commented 5 months ago

After many many solutions I tried including AID repair to the disk, and playing with different options in keychain I found something that worked and stopped this password prompt without errors:

  1. Open keychain app from launchpad
  2. Find the key (probably with the name of your app) in Login / Local Items
  3. Right click on it and choose copy
  4. Navigate to system keys, right click and paste the key
  5. Delete the key from login
  6. Double click the key in system
  7. Switch to access control and choose 'Allow all applications to access this key'
  8. Save changes
  9. Restart the app and no more password prompts.
rtiagom commented 1 month ago

@thewh1teagle Unfortunately that doesn't seem to work for me.