什么是 AuthorizationLevel.User 以及如何正确使用它?

Rod*_*ner 8 azure azure-functions

我刚刚将我的函数应用程序配置为使用 azure Active Directory。之后,我想通过更改 HttpTrigger 属性的枚举来停用功能级身份验证。然后我发现可以切换到“用户”授权级别,其描述为:

允许访问包含有效身份验证令牌的请求

部署函数后,我只收到 401 个未经授权的请求,因此我切换回匿名授权级别。

public enum AuthorizationLevel
    {
        //
        // Summary:
        //     Allow access to anonymous requests.
        Anonymous = 0,
        //
        // Summary:
        //     Allow access to requests that include a valid authentication token
        User = 1,
        //
        // Summary:
        //     Allow access to requests that include a function key
        Function = 2,
        //
        // Summary:
        //     Allows access to requests that include a system key
        System = 3,
        //
        // Summary:
        //     Allow access to requests that include the master key
        Admin = 4
    }
Run Code Online (Sandbox Code Playgroud)

所以我的问题是,如何正确使用“用户”授权级别?我可以在启用 Azure Active Directory 的情况下使用它吗?

bre*_*sam 6

User目前不支持。它最终将用于支持应用服务身份验证,但目前还行不通。

  • 遇到同样的问题!还不支持吗? (4认同)