auth0/SimpleKeychain

Xcode 8 / Swift 2.3 : keychain.setString returns false

Closed this issue · 7 comments

Hi,

My code was working fine until I migrated to XCode 8 / Swift 2.3.
It is inspired from the Auth0 documentation.
Basically, now, keychain.setString always return false.
So my class property currentIdToken is nil.

Any ideas ?

Thanks
Fred

   import Foundation
   import Lock
   import SimpleKeychain

  // Keys for SimpleKeychain
  struct SimpleKeychainKeys {
      static let service          = "Auth0"
      static let id_token         = "id_token"
      static let refresh_token    = "refresh_token"
      static let profile          = "profile"
  }

  class UserAuth {
      private class var keychain: A0SimpleKeychain {
          return A0SimpleKeychain(service: SimpleKeychainKeys.service)
      }

      class var currentIdToken: String? {
          get {
              let idToken = keychain.stringForKey(SimpleKeychainKeys.id_token)
              return idToken
          }
          set {
              if let newIdToken = newValue {
                  keychain.setString(newIdToken, forKey: SimpleKeychainKeys.id_token)
              }
          }
      }
  }

I checked this morning with the new version of Auth0 for XCode 8.
Auth0 now works fine, but this issue with SimpleKeyChain remains.

Is there anybody out there?

I am facing the same issue, please help.

I think I'll switch to Sam Soffes' SAMKeyChain ...

@sarmadmakhdoom did you check this in SO http://stackoverflow.com/questions/38456471/secitemadd-always-returns-error-34018-in-xcode-8-beta-gm-in-ios-10-simulator?

Seems this now is required for using the keychain (wonders since it was only required when you shared your keychain).

Tried with Xcode 8GM and works

Okay I will try that. I think it will solve the problem.

On Friday, 16 September 2016, Hernan Zalazar notifications@github.com
wrote:

@sarmadmakhdoom https://github.com/sarmadmakhdoom did you check this in
SO http://stackoverflow.com/questions/38456471/secitemadd-
always-returns-error-34018-in-xcode-8-beta-gm-in-ios-10-simulator?

Seems this now is required for using the keychain (wonders since it was
only required when you shared your keychain).

Tried with Xcode 8GM and works


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#34 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADXMTx_QdsTfLV-RpcATuqy5LWsXcrB8ks5qqpfXgaJpZM4J85yb
.

Sarmad Makhdoom
03344714444
http://sarmad.me/

That worked for me! Thanks