如何解决Microsoft.Identity.Web 库使用 Azure Cosmos DB 为 ASP.NET Core 应用分发令牌缓存我们如何重新使用缓存的令牌?
我从以下网站进行了实施:
我使用这个 NuGet 包来存储令牌:Microsoft.Extensions.Caching.Cosmos
services.AddcosmosCache((CosmosCacheOptions cacheOptions) =>
{
cacheOptions.ContainerName = Configuration["CosmosCacheContainer"];
cacheOptions.DatabaseName = Configuration["CosmosCacheDatabase"];
cacheOptions.ClientBuilder = new CosmosClientBuilder(Configuration["CosmosConnectionString"]);
cacheOptions.CreateIfNotExists = true;
});
services.AddMicrosoftWebAppAuthentication(Configuration)
.AddMicrosoftWebAppCallsWebApi(Configuration,new string[] { "User.Read","Mail.Read" })
.AdddistributedTokenCaches();
Token 成功保存到 Cosmos DB。
现在我有两个问题:
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。