0

In Azure API management policy, it tries to get claim name from JWT. It works fine when we have normal english text. However, it fails when name contains any Unicode chars("Jąhn") then it fails. Following is code snippet:

var jwt = context.Request.Headers.GetValueOrDefault("Authorization").AsJwt();                     
return jwt?.Claims.GetValueOrDefault("name") ?? "unknown";
Manas Kumar
  • 2,411
  • 3
  • 16
  • 23
  • JWT is base64 encoded. Have you checked https://stackoverflow.com/questions/55201011/what-characters-are-allowed-in-a-jwt-token and https://stackoverflow.com/questions/56222808/decrypt-bearer-token-in-azure-api-management-to-get-acr-values – SauravDas-MT Nov 19 '21 at 11:37
  • Did the above reference thread resolve your problem ? – SauravDas-MT Nov 22 '21 at 09:41

0 Answers0