Closed
Description
Add a user
property to the HttpRequest
that contains an object representing the logged in user.
If a user is logged in, the platform sets the x-ms-client-principal
header, which is in base64 encoded JSON. Both AppService/Functions authentication and Static Web Apps authentication support this header. However, they each have a slightly different schema.
Option 1: automatically decode the header into req.user
and leave it to the developer to figure out which type they are working with.
Option 2: automatically decode the header into req.user
in a common type. The worker takes care of mapping fields from each schema into the corresponding fields in the common type. The developer can expect the same type no matter which auth the app is using.