What's AuthorizationLevel.User and how to use it correctly?

Viewed 5166

I just configured my function app to use azure active directory. After that I wanted to deactivated the function level authentication by changing the enum at the HttpTrigger Attribute. Then I discovered that there is the possibility to switch to "User" AuthorizationLevel which is described as:

Allow access to requests that include a valid authentication token

After I deployed my Function I only get 401 unauthorized requests, so i switched back to Anonymous authorization level.

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
    }

So my question is, how to use "user" authorization level correctly? And can I use it with azure active directory enabled?

3 Answers

User isn't currently supported. It will eventually be used to support App Service authentication, but that doesn't work today.

As of today user level is still unsupported, its scheduled for:

v2 GA release (which also doesn't have a specific date, other than later this year).

Progress can be tracked here; Support EasyAuth #33.

It's supported now. You can check the discussion here: issue-auth

Related