Exemplo n.º 1
0
        public async Task <IActionResult> GetUser(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "users/{userPrincipalName}")] HttpRequest req,
            string userPrincipalName,
            ILogger log)
        {
            var user = await graphServiceClient.Users[userPrincipalName].Request().Select(userProperties).GetAsync();

            log.LogInformation("Customer: {Customer}", user.AdditionalData[extensionService.GetExtensionByName(CustomerClaim)]);
            return(new OkObjectResult(user));
        }
Exemplo n.º 2
0
 public Functions(IConfidentialClientApplication confidentialClientApplication, IGraphServiceClient graphServiceClient, ExtensionService extensionService, AuthorizationService authorizationService, IApiService apiService)
 {
     this.confidentialClientApplication = confidentialClientApplication;
     this.graphServiceClient            = graphServiceClient;
     this.extensionService     = extensionService;
     this.authorizationService = authorizationService;
     this.apiService           = apiService;
     userProperties            = $"{nameof(User.Id)}, {nameof(User.DisplayName)}, {nameof(User.GivenName)}, {nameof(User.Surname)}, {nameof(User.Identities)}, {extensionService.GetExtensionByName(CustomerClaim)}";
 }