使用ADAL JS静默获取令牌

时间:2016-02-12 16:56:37

标签: azure-active-directory adal adal.js

我已经通过Open ID Connect与Azure AD建立了会话,如何从浏览器静默获取令牌,我的意思是没有浏览器重定向,是否可以使用ADAL JS?

1 个答案:

答案 0 :(得分:2)

it is possible. If you are using Angular, all you need to do is specifying the resource you want to target at init time, in the endpoints structure - see https://azure.microsoft.com/en-us/documentation/samples/active-directory-angularjs-singlepageapp-dotnet-webapi/. If you aren't using Angular, you can use the lower level functions available in adal.js. In particular, see AuthenticationContext.prototype.acquireToken in https://github.com/AzureAD/azure-activedirectory-library-for-js/blob/master/lib/adal.js