Skip to content

Improve X-MS-CLIENT-PRINCIPAL payload parsing and error handling #864

@yorek

Description

@yorek

When working locally and using the X-MS-CLIENT-PRINCIPAL header to simulate an authenticated call, as long as the JSON provided in the header is a correct JSON, no error is raised, even if there are none of the expected elements, as described here: https://learn.microsoft.com/en-us/azure/static-web-apps/user-information?tabs=javascript

For example. this JSON (passed as base64 encoded string) will be accepted without any warning or error:

{"message": "hello world"}

of course, this will not authenticate the request, but there is no way for the developer to know that the request as not been authenticated.

Would be great if we can

  1. error or warn if we receive an X-MS-CLIENT-PRINCIPAL that doesn't contain any of the needed information
  2. log what role the request has been assigned to

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions