我有一个Net Core MVC项目,配置为对Azure B2C进行身份验证,如此_1451478中所示 . 此项目的一个要求是从运行Net Core WebAPI的Web服务获取数据 . 我的Azure租户已配置为此设置,我可以获取用于调用webapi的令牌 . 在调用ConfidentialClientApplication AcquireTokenSilent方法时,如果缓存中的令牌已过期,则会抛出UIRequiredException . 我'm able to catch this exception using a global filter and simply return a challenge result with the application'的OpenId默认值和当前请求的路径,它在后台刷新令牌 . 但是,这仅适用于整页重新加载,不适用于xmlhttprequests . 当从浏览器启动xml http请求时,它似乎是一种清除令牌的明确方法 . 当我从浏览器向MVC客户端发出异步请求时,如何获取刷新令牌以调用我的后端服务?