# kSecUseDataProtectionKeychain and CredentialsManager

**URL:** <https://community.auth0.com/t/ksecusedataprotectionkeychain-and-credentialsmanager/170123>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [January 24, 2025, 4:45pm UTC](https://community.auth0.com/t/ksecusedataprotectionkeychain-and-credentialsmanager/170123 "2025-01-24T16:45:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![colin.lee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/colin.lee/32/71465_2.png) [@colin.lee](https://community.auth0.com/u/colin.lee)\
**Post date:** [January 24, 2025, 4:45pm UTC](https://community.auth0.com/t/ksecusedataprotectionkeychain-and-credentialsmanager/170123/1 "2025-01-24T16:45:36Z")

</div>

When I want to log in on MacOS, CredentialsManager stores the credentials in the login keychain. This is a problem, since it results in a scary popup for users. Since CredentialsManager is an Auth0 product aiming to solve our login problems, there should be some way to ensure MacOS 10.15+ users benefit from the kSecUseDataProtectionKeychain, which will never show these scary prompts to our users.

I noticed that SimpleKeychain already supports this attribute, but SimpleKeychain is quite a bit more annoying to implement when all we need is this one attribute set.

Is there a feature coming to CredentialsManager to support kSecUseDataProtectionKeychain?

---

<div class="post-metadata">

**Author:** ![colin.lee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/colin.lee/32/71465_2.png) [@colin.lee](https://community.auth0.com/u/colin.lee)\
**Post date:** [January 24, 2025, 5:15pm UTC](https://community.auth0.com/t/ksecusedataprotectionkeychain-and-credentialsmanager/170123/2 "2025-01-24T17:15:45Z")

</div>

Actually, I think I may have figured out a workaround until there’s proper support.

```auto
        let keychain = if #available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, watchOS 6.0, *) {
            SimpleKeychain(attributes: [kSecUseDataProtectionKeychain as String: true])
        } else {
            SimpleKeychain()
        }

        credentialsManager = CredentialsManager(authentication: Auth0.authentication(
            clientId: AUTH0_CLIENT_ID, domain: AUTH0_DOMAIN, session: .shared
        ), storage: keychain)

```

---

<div class="post-metadata">

**Author:** ![marybeth.hunter](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marybeth.hunter/32/61955_2.png) [@marybeth.hunter](https://community.auth0.com/u/marybeth.hunter)\
**Post date:** [January 24, 2025, 6:35pm UTC](https://community.auth0.com/t/ksecusedataprotectionkeychain-and-credentialsmanager/170123/4 "2025-01-24T18:35:52Z")

</div>

Hi @colin.lee,

Welcome to the Auth0 Community!

Thanks for your post and workaround! I have reached out to the SDK team to see if there are any plans for this update, and I will let you know what I hear back.

Thanks,

Mary Beth

---

<div class="post-metadata">

**Author:** ![marybeth.hunter](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marybeth.hunter/32/61955_2.png) [@marybeth.hunter](https://community.auth0.com/u/marybeth.hunter)\
**Post date:** [January 28, 2025, 2:27pm UTC](https://community.auth0.com/t/ksecusedataprotectionkeychain-and-credentialsmanager/170123/5 "2025-01-28T14:27:38Z")

</div>

Hi @colin.lee,

The team has gotten back to me! We have reference of [kSecUseDataProtectionKeychain](https://github.com/auth0/SimpleKeychain/blob/665756d4e259b4444f20e3d49e4ebf4385c38551/EXAMPLES.md?plain=1#L23) in SimpleKeychain library. Is the ask to support this in any particular SDK?

Thanks,

Mary Beth

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [February 11, 2025, 2:27pm UTC](https://community.auth0.com/t/ksecusedataprotectionkeychain-and-credentialsmanager/170123/6 "2025-02-11T14:27:54Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
