Azure / Azure/api-management-policy-snippets

Get thumbprint from certificate retrieved from Keyvault

Open
#47 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
399
Forks
170
PR merge metrics
No merged PRs in 30d

Description

I am trying to use the policy from the example, Look up Key Vault certificate using Managed Service Identity and call backend.

I am able to get the certificate from the key vault and use if to authenticate to my back end as a client cert. but i am also trying to secure the inbound call on the front end by validating that the caller is sending the same cert.

Using the policy below I am able to retrieve the cert from the keyvault, get the Base64 value out of the cert response. The last step I am missing is how to pull the thumbprint out of that Base64 cert to validate against in the incoming cert thumbprint from context.Request.Certificate.Thumbprint.

The comparison i am struggling with is
```xml

```

Full Inbound Policy
```xml



https://MYKEYVAULTNAME.vault.azure.net/secrets/CLIENTCERTTEST/?api-version=2016-10-01
GET


()["value"].ToString())" />














```

Contributor guide

No contributing guide indexed for this repository

Research direction

Review the linked inbound policy example and the comparison involving context.Request.Certificate.Thumbprint. Determine how the certificate returned by Key Vault should be represented for validation, then update or extend the example so the expected certificate check is documented and reproducible.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
api, authentication, cloud, security
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.