{"action":"created","issue":{"url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-objc/issues/274","labels_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-objc/issues/274/labels{/name}","comments_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-objc/issues/274/comments","events_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-objc/issues/274/events","html_url":"https://github.com/AzureAD/azure-activedirectory-library-for-objc/issues/274","id":59844721,"number":274,"title":"KeychainTokenCacheStore doesn't work by default sharedGroup is explicitly set to nil","user":{"login":"samirahmed","id":839972,"avatar_url":"https://avatars.githubusercontent.com/u/839972?v=3","gravatar_id":"","url":"https://api.github.com/users/samirahmed","html_url":"https://github.com/samirahmed","followers_url":"https://api.github.com/users/samirahmed/followers","following_url":"https://api.github.com/users/samirahmed/following{/other_user}","gists_url":"https://api.github.com/users/samirahmed/gists{/gist_id}","starred_url":"https://api.github.com/users/samirahmed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samirahmed/subscriptions","organizations_url":"https://api.github.com/users/samirahmed/orgs","repos_url":"https://api.github.com/users/samirahmed/repos","events_url":"https://api.github.com/users/samirahmed/events{/privacy}","received_events_url":"https://api.github.com/users/samirahmed/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-04T19:04:41Z","updated_at":"2015-03-04T19:13:22Z","closed_at":"2015-03-04T19:13:22Z","body":"I have found an issue (after 2 days of debugging ... :sob: ) which results in the `ADKeychainTokenCacheStore` failing silently and triggering `AD_ERROR_USER_INPUT_NEEDED`\r\n\r\nIn the latest version ... `1.2.1` the `ADKeychainTokenCacheStore` is initialized by default with a shared group [in this commit](https://github.com/AzureAD/azure-activedirectory-library-for-objc/commit/d107bb55d8e7ba54d84038e1d50e79de293f4cc7#diff-5ca732cc8853566388d1cef0aacad952R53)\r\n\r\nUnfortunately that change combined with this [change to set the accessToken](https://github.com/AzureAD/azure-activedirectory-library-for-objc/commit/d107bb55d8e7ba54d84038e1d50e79de293f4cc7#diff-e0907fea53b08f53ca383d4e86fd0040R52) means that a shared access group is always set. \r\n\r\nI don't know if this is intentional or not but I do know that in the previous version since `sharedGroup` would default to `nil` it would work and by updating to `1.2.1` it has broken my app.\r\n\r\nWhats worse is that since there is a macro that [skips the sharedGroup check in the simulator](https://github.com/AzureAD/azure-activedirectory-library-for-objc/commit/d107bb55d8e7ba54d84038e1d50e79de293f4cc7#diff-e0907fea53b08f53ca383d4e86fd0040R73) ... this problem only reproduces on the device and not the simulator making it very tricky to actually find.\r\n\r\nThe symptoms of this issue are that an explicit user prompted auth succeeds... but then all silent calls fail since the TokenCache has zero tokens in it (not sure where/why the exact failure comes from)\r\n\r\nTo ensure that this was a problem with the `ADKeychainTokenCacheStore` I created an in memory token Cache store myself ... and verified that this was indeed the problem"},"comment":{"url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-objc/issues/comments/77224560","html_url":"https://github.com/AzureAD/azure-activedirectory-library-for-objc/issues/274#issuecomment-77224560","issue_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-objc/issues/274","id":77224560,"user":{"login":"kpanwar","id":5713915,"avatar_url":"https://avatars.githubusercontent.com/u/5713915?v=3","gravatar_id":"","url":"https://api.github.com/users/kpanwar","html_url":"https://github.com/kpanwar","followers_url":"https://api.github.com/users/kpanwar/followers","following_url":"https://api.github.com/users/kpanwar/following{/other_user}","gists_url":"https://api.github.com/users/kpanwar/gists{/gist_id}","starred_url":"https://api.github.com/users/kpanwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kpanwar/subscriptions","organizations_url":"https://api.github.com/users/kpanwar/orgs","repos_url":"https://api.github.com/users/kpanwar/repos","events_url":"https://api.github.com/users/kpanwar/events{/privacy}","received_events_url":"https://api.github.com/users/kpanwar/received_events","type":"User","site_admin":false},"created_at":"2015-03-04T19:13:21Z","updated_at":"2015-03-04T19:13:21Z","body":"please check out the change logs for all the updates and fixes. I am closing this issue because it is by design. Having a default value sets a clear story for sharing cache across multiple apps from the same publisher. Imagine all the MS products using a different cache name and not being able to share tokens."}}