Hello, I am currently researching to develop an application where I want to apply the MacOS updates without the password prompt shown to the users.
I did some research on this and understand that an MDM solution can apply these patches without user intervention.
Are there any other ways we can achieve this? Any leads are much appreciated.
Prioritize user privacy and data security in your app. Discuss best practices for data handling, user consent, and security measures to protect user information.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I'm writing an app on macOS that stores passwords in the Keychain and later retrieves them using SecItemCopyMatching(). This works fine 90% of the time. However, occasionally, the call to SecItemCopyMatching() fails with errSecAuthFailed (-25293). When this occurs, simply restarting the app resolves the issue; otherwise, it will consistently fail with errSecAuthFailed.
What I suspect is that the Keychain access permission has a time limitation for a process. This issue always seems to arise when I keep my app running for an extended period.
Hi everyone,
I’m encountering an unexpected Keychain behavior in a production environment and would like to confirm whether this is expected or if I’m missing something.
In my app, I store a deviceId in the Keychain based on the classic KeychainItemWrapper implementation. I extended it by explicitly setting:
kSecAttrAccessible = kSecAttrAccessibleAfterFirstUnlock
My understanding is that kSecAttrAccessibleAfterFirstUnlock should allow Keychain access while the app is running in the background, as long as the device has been unlocked at least once after reboot.
However, after the app went live, I observed that when the app performs background execution (e.g., triggered by background tasks / silent push), Keychain read attempts intermittently fail with:
errSecInteractionNotAllowed (-25308)
This seems inconsistent with the documented behavior of kSecAttrAccessibleAfterFirstUnlock.
Additional context:
The issue never occurs in foreground.
The issue does not appear on development devices.
User devices are not freshly rebooted when this happens.
The Keychain item is created successfully; only background reads fail.
Setting the accessibility to kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly produces the same result.
Questions:
Under what circumstances can kSecAttrAccessibleAfterFirstUnlock still cause a -25308 error?
Is there any known restriction when accessing Keychain while the app is running in background execution contexts?
Could certain system states (Low Power Mode, Background App Refresh conditions, device lock state, etc.) cause Keychain reads to be blocked unexpectedly?
Any insights or similar experiences would be greatly appreciated. Thank you!
I'm trying to export and re-import a P-256 private key that was originally generated via SecKeyCreateRandomKey(), but I keep running into roadblocks. The key is simply exported via SecItemExport() with format formatWrappedPKCS8, and I did set a password just to be sure.
Do note that I must use the file-based keychain, as the data protection keychain requires a restricted entitlement and I'm not going to pay a yearly fee just to securely store some private keys for a personal project. The 7-day limit for unsigned/self-signed binaries isn't feasible either.
Here's pretty much everything I could think of trying:
Simply using SecItemImport() does import the key, but I cannot set kSecAttrLabel and more importantly: kSecAttrApplicationTag. There just isn't any way to pass these attributes upfront, so it's always imported as Imported Private Key with an empty comment. Keys don't support many attributes to begin with and I need something that's unique to my program but shared across all the relevant key entries, otherwise it's impossible to query for only my program's keys. kSecAttrLabel is already used for something else and is always unique, which really only leaves kSecAttrApplicationTag. I've already accepted that this can be changed via Keychain Access, as this attribute should end up as the entry's comment. At least, that's how it works with SecKeyCreateRandomKey() and SecItemCopyMatching(). I'm trying to get that same behaviour for imports.
Running SecItemUpdate() afterwards to set these 2 attributes doesn't work either, as now the kSecAttrApplicationTag is suddenly used for the entry's label instead of the comment. Even setting kSecAttrComment (just to be certain) doesn't change the comment. I think kSecAttrApplicationTag might be a creation-time attribute only, and since SecItemImport() already created a SecKey I will never be able to set this. It likely falls back to updating the label because it needs to target something that is still mutable?
Using SecItemImport() with a nil keychain (i.e. create a transient key), then persisting that with SecItemAdd() via kSecValueRef does allow me to set the 2 attributes, but now the ACL is lost. Or more precise: the ACL does seem to exist as any OS prompts do show the label I originally set for the ACL, but in Keychain Access it shows as Allow all applications to access this item. I'm looking to enable Confirm before allowing access and add my own program to the Always allow access by these applications list. Private keys outright being open to all programs is of course not acceptable, and I can indeed access them from other programs without any prompts.
Changing the ACL via SecKeychainItemSetAccess() after SecItemAdd() doesn't seem to do anything. It apparently succeeds but nothing changes. I also reopened Keychain Access to make sure it's not a UI "caching" issue.
Creating a transient key first, then getting the raw key via SecKeyCopyExternalRepresentation() and passing that to SecItemAdd() via kSecValueData results in The specified attribute does not exist. This error only disappears if I remove almost all of the attributes. I can pass only kSecValueData, kSecClass and kSecAttrApplicationTag, but then I get The specified item already exists in the keychain errors. I found a doc that explains what determines uniqueness, so here are the rest of the attributes I'm using for SecItemAdd():
kSecClass: not mentioned as part of the primary key but still required, otherwise you'll get One or more parameters passed to a function were not valid.
kSecAttrLabel: needed for my use case and not part of the primary key either, but as I said this results in The specified attribute does not exist.
kSecAttrApplicationLabel: The specified attribute does not exist. As I understand it this should be the SHA1 hash of the public key, passed as Data. Just omitting it would certainly be an option if the other attributes actually worked, but right now I'm passing it to try and construct a truly unique primary key.
kSecAttrApplicationTag: The specified item already exists in the keychain.
kSecAttrKeySizeInBits: The specified attribute does not exist.
kSecAttrEffectiveKeySize: The specified attribute does not exist.
kSecAttrKeyClass: The specified attribute does not exist.
kSecAttrKeyType: The specified attribute does not exist.
It looks like only kSecAttrApplicationTag is accepted, but still ignored for the primary key. Even entering something that is guaranteed to be unique still results in The specified item already exists in the keychain, so I think might actually be targeting literally any key. I decided to create a completely new keychain and import it there (which does succeed), but the key is completely broken. There's no Kind and Usage at the top of Keychain Access and the table view just below it shows symmetric key instead of private. The kSecAttrApplicationTag I'm passing is still being used as the label instead of the comment and there's no ACL. I can't even delete this key because Keychain Access complains that A missing value was detected. It seems like the key doesn't really contain anything unique for its primary key, so it will always match any existing key.
Using SecKeyCreateWithData() and then using that key as the kSecValueRef for SecItemAdd() results in A required entitlement isn't present. I also have to add kSecUseDataProtectionKeychain: false to SecItemAdd() (even though that should already be the default) but then I get The specified item is no longer valid. It may have been deleted from the keychain. This occurs even if I decrypt the PKCS8 manually instead of via SecItemImport(), so it's at least not like it's detecting the transient key somehow. No combination of kSecAttrIsPermanent, kSecUseDataProtectionKeychain and kSecUseKeychain on either SecKeyCreateWithData() or SecItemAdd() changes anything.
I also tried PKCS12 despite that it always expects an "identity" (key + cert), while I only have (and need) a private key. Exporting as formatPKCS12 and importing it with itemTypeAggregate (or itemTypeUnknown) does import the key, and now it's only missing the kSecAttrApplicationTag as the original label is automatically included in the PKCS12. The outItems parameter contains an empty list though, which sort of makes sense because I'm not importing a full "identity". I can at least target the key by kSecAttrLabel for SecItemUpdate(), but any attempt to update the comment once again changes the label so it's not really any better than before.
SecPKCS12Import() doesn't even import anything at all, even though it does return errSecSuccess while also passing kSecImportExportKeychain explicitly.
Is there literally no way?
In iOS 18, i use CNContactPickerViewController to access to Contacts (i know it is one-time access).
After first pick up one contact, the Setting > Apps > my app > Contacts shows Private Access without any option to close it.
Is there any way to close it and undisplay it ?
I tried to uninstall and reinstall my app, but it didn't work.
I created an app in Xcode using ApplescriptObjC that is supposed to communicate with Finder and Adobe Illustrator. It has been working for the last 8 years, until now I have updated it for Sonoma and it no longer triggers the alerts for the user to approve the communication. It sends the Apple Events, but instead of the alert dialog I get this error in Console:
"Sandboxed application with pid 15728 attempted to lookup App: "Finder"/"finder"/"com.apple.finder" 654/0x0:0x1d01d MACSstill-hintable sess=100017 but was denied due to sandboxing."
The Illustrator error is prdictably similar.
I added this to the app.entitlements file:
<key>com.apple.security.automation.apple-events</key>
<array>
<string>com.apple.finder</string>
<string>com.adobe.illustrator</string>
</array>
I added this to Info.plist:
<key>NSAppleEventsUsageDescription</key>
<string>This app requires access to Finder and Adobe Illustrator for automation.</string>
I built the app, signed with the correct Developer ID Application Certificate.
I've also packaged it into a signed DMG and installed it, with the same result as running it from Xcode.
I tried stripping it down to just the lines of code that communicate with Finder and Illustrator, and built it with a different bundle identifier with the same result.
What am I missing?
I have a small command-line app I've been using for years to process files. I have it run by an Automator script, so that I can drop files onto it. It stopped working this morning.
At first, I could still run the app from the command line, without Automator. But then after I recompiled the app, now I cannot even do that. When I run it, it's saying 'zsh: killed' followed by my app's path. What is that?
The app does run if I run it from Xcode.
How do I fix this?
Topic:
Privacy & Security
SubTopic:
General
Hi,
I develop a Mac application, initially on Catalina/Xcode12, but I recently upgrade to Monterey/Xcode13. I'm about to publish a new version: on Monterey all works as expected, but when I try the app on Sequoia, as a last step before uploading to the App Store, I encountered some weird security issues:
The main symptom is that it's no longer possible to save any file from the app using the Save panel, although the User Select File entitlement is set to Read/Write.
I've tried reinstalling different versions of the app, including the most recent downloaded from TestFlight. But, whatever the version, any try to save using the panel (e.g. on the desktop) results in a warning telling that I don't have authorization to record the file to that folder.
Moreover, when I type spctl -a -t exec -v /Applications/***.app in the terminal, it returns rejected, even when the application has been installed by TestFlight.
An EtreCheck report tells that my app is not signed, while codesign -dv /Applications/***.app returns a valid signature. I'm lost...
It suspect a Gate Keeper problem, but I cannot found any info on the web about how this system could be reset. I tried sudo spctl --reset-default, but it returns This operation is no longer supported...
I wonder if these symptoms depend on how the app is archived and could be propagated to my final users, or just related to a corrupted install of Sequoia on my local machine. My feeling is that a signature problem should have been detected by the archive validation, but how could we be sure?
Any idea would be greatly appreciated, thanks!
Hi
https://appleid.apple.com/auth/authorize?client_id=com.adobe.services.adobeid-na1.web
shows:
invalid_request
But https://appleid.apple.com/auth/authorize?client_id=xrqxnpjgps
shows:
invalid_client
I've created a Primary App ID and ticked "Sign In with Apple".
I've created a Service ID and ticked "Sign In with Apple" (identifier is xrqxnpjgps).
When I click "Configure" for the "Sign In with Apple" of the Service ID, it is linked to the Primary App ID.
Why do I get an invalid_client error?
I've contacted the support by mail, and have been redirected here, does someone here have the ability/access/knowledge/will to figure out the cause and then tell me?
Regards
Topic:
Privacy & Security
SubTopic:
Sign in with Apple
Hi,
I'm working on developing my own CryptoTokenKit (CTK) extension to enable codesign with HSM-backed keys. Here's what I’ve done so far:
The container app sets up the tokenConfiguration with TKTokenKeychainCertificate and TKTokenKeychainKey.
The extension registers successfully and is visible via pluginkit when launching the container app.
The virtual smartcard appears when running security list-smartcards.
The certificate, key, and identity are all visible using security export-smartcard -i [card].
However, nothing appears in the Keychain.
After adding logging and reviewing output in the Console, I’ve observed the following behavior when running codesign:
My TKTokenSession is instantiated correctly, using my custom TKToken implementation — so far, so good.
However, none of the following TKTokenSession methods are ever called:
func tokenSession(_ session: TKTokenSession, beginAuthFor operation: TKTokenOperation, constraint: Any) throws -> TKTokenAuthOperation
func tokenSession(_ session: TKTokenSession, supports operation: TKTokenOperation, keyObjectID: TKToken.ObjectID, algorithm: TKTokenKeyAlgorithm) -> Bool
func tokenSession(_ session: TKTokenSession, sign dataToSign: Data, keyObjectID: Any, algorithm: TKTokenKeyAlgorithm) throws -> Data
func tokenSession(_ session: TKTokenSession, decrypt ciphertext: Data, keyObjectID: Any, algorithm: TKTokenKeyAlgorithm) throws -> Data
func tokenSession(_ session: TKTokenSession, performKeyExchange otherPartyPublicKeyData: Data, keyObjectID objectID: Any, algorithm: TKTokenKeyAlgorithm, parameters: TKTokenKeyExchangeParameters) throws -> Data
The only relevant Console log is:
default 11:31:15.453969+0200 PersistentToken [0x154d04850] invalidated because the client process (pid 4899) either cancelled the connection or exited
There’s no crash report related to the extension, so my assumption is that ctkd is closing the connection for some unknown reason.
Is there any way to debug this further?
Thank you for your help.
Hello Apple Developer Community,
We have been experiencing a persistent notification issue in our application, Flowace, after updating to macOS 15 and above. The issue is affecting our customers but does not occur on our internal test machines.
Issue Description
When users share their screen using Flowace, they receive a repetitive system notification stating:
"Flowace has accessed your screen and system audio XX times in the past 30 days. You can manage this in settings."
This pop-up appears approximately every minute, even though screen sharing and audio access work correctly. This behavior was not present in macOS 15.1.1 or earlier versions and appears to be related to recent privacy enhancements in macOS.
Impact on Users
The frequent pop-ups disrupt workflows, making it difficult for users to focus while using screen-sharing features.
No issues are detected in Privacy & Security Settings, where Flowace has the necessary permissions.
The issue is not reproducible on our internal test machines, making troubleshooting difficult.
Our application is enterprise level and works all the time, so technically this pop only comes after a period of not using the app.
Request for Assistance
We would like to understand:
Has anyone else encountered a similar issue in macOS 15+?
Is there official Apple documentation explaining this new privacy behavior?
Are there any interim fixes to suppress or manage these notifications?
What are Apple's prospects regarding this feature in upcoming macOS updates?
A demonstration of the issue can be seen in the following video: https://youtu.be/njA6mam_Bgw
Any insights, workarounds, or recommendations would be highly appreciated!
Thank you in advance for your help.
Best,
Anuj Patil
Flowace Team
Our background monitoring application uses a Unix executable that requests Screen Recording permission via CGRequestScreenCaptureAccess(). This worked correctly in macOS Tahoe 26.0.1, but broke in 26.1.
Issue:
After calling CGRequestScreenCaptureAccess() in macOS Tahoe 26.1:
System dialog appears and opens System Settings
Our executable does NOT appear in the Screen Recording list
Manually adding via "+" button grants permission internally, but the executable still doesn't show in the UI
Users cannot verify or revoke permissions
Background:
Unix executable runs as a background process (not from Terminal)
Uses Accessibility APIs to retrieve window titles
Same issue occurs with Full Disk Access permissions
Environment:
macOS Tahoe 26.1 (worked in 26.0.1)
Background process (not launched from Terminal)
Questions:
Is this a bug or intentional design change in 26.1?
What's the recommended approach for background executables to properly register with TCC?
Are there specific requirements (Info.plist, etc.) needed?
This significantly impacts user experience as they cannot manage permissions through the UI.
Any guidance would be greatly appreciated. Thank you
Hi Apple Team and Community,
We encountered a sudden and widespread failure related to the App Attest service on Friday, July 25, starting at around 9:22 AM UTC.
After an extended investigation, our network engineers noted that the size of the attestation objects received from the attestKey call grew in size notably starting at that time. As a result, our firewall began blocking the requests from our app made to our servers with the Base64-encoded attestation objects in the payload, as these requests began triggering our firewall's max request length rule.
Could Apple engineers please confirm whether there was any change rolled out by Apple at or around that time that would cause the attestation object size to increase?
Can anyone else confirm seeing this?
Any insights from Apple or others would be appreciated to ensure continued stability.
Thanks!
The Core Problem
After Users sign out from the App, the app isn’t properly retrieving the user on second sign in. Instead, it’s treating the user as “Unknown” and saving a new entry in CloudKit and locally. Is there a tutorial aside from 'Juice' that is recent and up to date?
I requested permission to use the Family Controls entitlement two weeks ago, and I have not received a response or status update. I have been to that page where it says "Thank you! We'll get back to you soon!" so many times.
Since around March 4, 2025 off and on, we've been receiving 500 errors back from the validate_device_token endpoint on development and production. Today (March 6) we are constantly getting 500 error back.
https://api.development.devicecheck.apple.com/v1/validate_device_token
This was working previously before then. No change has happened on our end since then.
This is a critical piece for our infrastructure.
Thanks in advance.
-Matt
Our application uses device check api to validate the device token in staging server. We are using "https://api.development.devicecheck.apple.com/v1/validate_device_token"for this.But the response is 500 internal server error.
Our production build is working fine.We pointed the build to "https://api.devicecheck.apple.com/v1/validate_device_token" url.We are using the same device check key for both development and production server.
Device check was working fine in development server also.Suddenly it started to failed with out making any changes in our code.
Private relay emails are not being delivered, even though we've followed the guidance here,
https://developer.apple.com/help/account/capabilities/configure-private-email-relay-service/
iCloud, gmail etc. get delivered fine but as soon as its a private relay email address they get bounced as unauthorized sender.
We've tried a couple of domains but here I'll document test.x.domain.com
We have registered domains (test.x.domain.com), also the sender communication emails just to be safe (noreply at test.x.domain.com).
Passed SPF Authentication, DKIM Authentication.
ESP account shows as all green checks in mailgun.
Is there any way to track down what the actual rejection reason is?
{
"@timestamp": "2025-08-20T14:30:59.801Z",
"account": {
"id": "6425b45fb2fd1e28f4e0110a"
},
"delivery-status": {
"attempt-no": 1,
"bounce-type": "soft",
"certificate-verified": true,
"code": 550,
"enhanced-code": "5.1.1",
"first-delivery-attempt-seconds": 0.014,
"message": "5.1.1 <bounce+b53c9e.27949-6qj4xaisn4k=privaterelay.appleid.com@test.x.domain.com>: unauthorized sender",
"mx-host": "smtp3.privaterelay.appleid.com",
"session-seconds": 1.7229999999999999,
"tls": true
},
"domain": {
"name": "test.x.domain.com"
},
"envelope": {
"sender": "noreply@test.x.domain.com",
"sending-ip": "111.22.101.215",
"targets": "6qj4xaisn4k@privaterelay.appleid.com",
"transport": "smtp"
},
"event": "failed",
"flags": {
"is-authenticated": true,
"is-delayed-bounce": false,
"is-routed": false,
"is-system-test": false,
"is-test-mode": false
},
"id": "1gtVBeZYQ0yO1SzipVP99Q",
"log-level": "error",
"message": {
"headers": {
"from": "\"Test Mail\" <noreply@test.x.domain.com>",
"message-id": "20250820143058.7cac292cf03993f2@test.x.domain.com",
"subject": "Test Mail",
"to": "6qj4xaisn4k@privaterelay.appleid.com"
},
"size": 22854
},
"primary-dkim": "s1._domainkey.test.x.domain.com",
"reason": "generic",
"recipient": "6qj4xaisn4k@privaterelay.appleid.com",
"recipient-domain": "privaterelay.appleid.com",
"recipient-provider": "Apple",
"severity": "permanent",
"storage": {
"env": "production",
"key": "BAABAgFDX5nmZ7fqxxxxxxZNzEVxPmZ8_YQ",
"region": "europe-west1",
"url": [
"https://storage-europe-west1.api.mailgun.net/v3/domains/test.x.domain.com/messages/BAABAgFDXxxxxxxxxxxxxxNzEVxPmZ8_YQ"
]
},
"user-variables": {}
}
Hello,
When using ASWebAuthenticationSession with an HTTPS callback URL (Universal Link), I receive the following error:
Authorization error: The operation couldn't be completed.
Application with identifier jp.xxxx.yyyy.dev is not associated with domain xxxx-example.go.link.
Using HTTPS callbacks requires Associated Domains using the webcredentials service type for xxxx-example.go.link.
I checked Apple’s official documentation but couldn’t find any clear statement that webcredentials is required when using HTTPS callbacks in ASWebAuthenticationSession.
What I’d like to confirm:
Is webcredentials officially required when using HTTPS as a callback URL with ASWebAuthenticationSession?
If so, is there any official documentation or technical note that states this requirement?
Environment
iOS 18.6.2
Xcode 16.4
Any clarification or official references would be greatly appreciated.
Thank you.
Topic:
Privacy & Security
SubTopic:
General
Tags:
iOS
Security
Authentication Services
Universal Links
we can get token but when send to verity from apple. it reture Error : {"responseCode":"400","responseMessage":"Missing or incorrectly formatted device token payload"}