From 01a00c13a27497ea793206ca232069921e8ea120 Mon Sep 17 00:00:00 2001 From: Michael Wolfenden Date: Tue, 10 Sep 2024 13:58:36 +1000 Subject: [PATCH] `AsJWT` works without removing the scheme first --- policy-expressions/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/policy-expressions/README.md b/policy-expressions/README.md index 5be25df..6c375f2 100644 --- a/policy-expressions/README.md +++ b/policy-expressions/README.md @@ -77,7 +77,7 @@ return body.ToString(); **Read claim from bearer token** ```c# -context.Request.Headers.GetValueOrDefault("Authorization")?.Split(' ')?[1].AsJwt()?.Claims["claim-name"].FirstOrDefault() +context.Request.Headers.GetValueOrDefault("Authorization").AsJwt()?.Claims["claim-name"].FirstOrDefault() ``` ## Interact with client certificates @@ -109,4 +109,4 @@ context.Request.Certificate.Thumbprint == "EXPECTED-THUMBPRINT-IN-UPPER-CASE" **Check if client certificate is uploaded in API Management, based on thumbprint** ```c# context.Deployment.Certificates.Any(c => c.Value.Thumbprint == context.Request.Certificate.Thumbprint) == true -``` \ No newline at end of file +```