google / gtm-oauth2

Google Toolbox for Mac - OAuth 2 Controllers
Apache License 2.0
126 stars 70 forks source link

canAuthorize returns false in simulator but true on real device (iOS 10) #76

Closed metagon closed 8 years ago

metagon commented 8 years ago

Hello,

I'm currently developing an app that uses Google authentication that stores the token in the keychain. Today I updated to Xcode 8/Swift 3 etc. and noticed a strange issue that only occurs on the simulator. After successfully logging in, I can make requests to the backend and everything works fine, but when I relaunch the App, it asks me to log in again. Seems like it can't access the keychain. On my physical device, this doesn't happen.

Thank you in advance!

thomasvl commented 8 years ago

There's a bug in the iOS 10 simulator keychain support where things like to error out (that used to work). So we're looking at hacking around it by just using NSUserDefaults for that one configuration.

metagon commented 8 years ago

Thank you for the quick response. I was going mad about this issue, trying to figure out what's wrong with my code.

thomasvl commented 8 years ago

Fyi - https://github.com/google/gtm-oauth2/pull/77 in flight. I might not do a CocoaPods release right away just to confirm this doesn't cause other problems.