Skip to content

WebGateConsultingAG/AzureFunctionUtils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebGate.Azure.FunctionsUtils

WebGate.Azure.FunctionsUtils provides assets to support Azure Functions. The main purpose is to make the life of a developer easier.


FunctionRunContext

The FunctionRunContext encapsulates the extraction of the PrincipalClaims token. The context delivers functionality to determinate the user and also its roles.

Create a new UserFunctionRunContext

The UserFunctionRunContext will be created by a HttpRequest. All information related to the current user, are extracted.

[Function("MyCoolFunction")]
    public async Task<IActionResult> MyCoolFunction([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "users/me")] HttpRequest req)
    {
        var userFunctionRunContext = new UserFunctionRunContext(req);
        //Do some stuff with the graphAPI to find the User by its UserID
        var myGraphUser = await doSomeCoolStuff(userFunctionRunContext.GetUserId());
        return new OkObjectResult(myGraphUser);
    }

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages