Azure Function (InProcess) .Net 6.0 中的授权问题,有人使用 nuget 包 DarkLoop.Azure.Functions.Authorization.InProcess/4.1.0

问题描述 投票:0回答:1

我有使用.Net 6.0 InProcess模式开发的azure函数。我已使用下面的代码进行身份验证,但它现在无法在 azure 门户上的最新运行时运行。 Azure 函数未加载,部署后“同步触发器”调用由于此 AuthN 而失败。

enter image description here

这是启动文件代码:

enter image description here

我正在尝试使用另一种方法来使用找到的 nuget 包来实现 AuthN **“DarkLoop.Azure.Functions.Authorization”** 但没有运气。我在令牌验证时遇到以下错误。 enter image description here

这是我正在尝试的代码:

enter image description here

根据最新运行时版本 > 4.1 的 Microsoft 文档,azure 函数无法使用 Bearer 方案和 AspNetCore 身份验证机制。

我正在针对 swagger 的隐式流进行测试,但同样也必须针对客户端凭证流进行测试。

**对此的任何帮助/线索将不胜感激。 **

根据最新运行时版本 > 4.1 的 Microsoft 文档,azure 函数无法使用 Bearer 方案和 AspNetCore 身份验证机制。 根据此博客,此代码肯定有效,但事实并非如此。

authentication .net-6.0 azure-functions-runtime
1个回答
0
投票

您是否尝试过仅在

Authority
上配置
Audience
AddJwtFunctionsBearer

许多人认为受众与客户 ID 相同。确保您的受众与您的 应用注册 > 公开 API > API ID URI 中的受众相同,并且令牌在

aud
声明中携带此值。

© www.soinside.com 2019 - 2024. All rights reserved.