The user credentials are need to obtain access token. Please call the non-silent acquireTokenWithResource methods

青春壹個敷衍的年華 提交于 2020-01-01 19:24:31

问题


I am using ADALiOS into my app for authentication. When user signIn into the app I am getting following error:

"The argument 'cacheItem.scopes' is invalid. Value:(null)." and

"The user credentials are need to obtain access token. Please call the non-silent acquireTokenWithResource methods"

Any help would be appreciated. Thanks


回答1:


This might happen if keychain sharing is disabled. One of the probable solution is:

Solution:

Step 1: Xcode > Target > Capabilities > Keychain Sharing -> Switch to ON

Step 2: add com.microsoft.adalcache into Keychain Group.

Hope this helps.




回答2:


There is a pattern for dealing with iOS that involves firstly looking in the ADAL cache for the credentials (the silent version) - if the credentials are not there, then calling the version that pops up the UI for gathering the credentials (the non-silent version)

You can see this in the example app here: https://github.com/AzureAD/azure-activedirectory-library-for-objc/blob/master/Samples/MyTestiOSApp/MyTestiOSApp/BVTestMainViewController.m



来源:https://stackoverflow.com/questions/36153055/the-user-credentials-are-need-to-obtain-access-token-please-call-the-non-silent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!