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

╄→гoц情女王★ 提交于 2019-12-12 10:23:24

问题


In my swift project, I am using convergence dev branch source code. I have added ADALiOS files manually in my project. Currently retrieving access token from refresh token is a problem.

Till last week my project was working all fine but as I opened my project on Mondat i.e. 20th March, 2016, I don't know how and why my app is not able to save access token in local cache. So whenever I tried to get access token silently it is unable to retrieve it from local cache. For every call 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."

From my side I haven't done any changes. I am able to see that new release has been done in convergence branch. Please suggest me how could I solve it also can someone suggest me whether server side changes has also been done or not because of which I am facing this issue?

For the same project settings we are using adalios in our android app and web page also. But those guys are not going through any such issue only iOS team is facing it.

If anyone has any idea please help me.


回答1:


After reading full ADALiOS file structure I got to know that there are 2 imp web requests going, first is to get auth code, in this call selected "policy" is present in URL. Other call is made after my access token has expired, so to get new access token it is passing refresh token. Particularly in this call I noticed that no policy has been provided in URL. So manually I did some changes to it and added policy in the URL. After that my app is working all good and now I don't have to login again and again.




回答2:


This might happen if keychain sharing is disabled. One solution might be:

  1. Xcode > Target > Capabilities > Keychain Sharing -> Switch to ON
  2. Add com.microsoft.adalcache into Keychain Group.

Hope this helps.



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

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