I'm working at building an auth token server using a Python Azure Function with HTTP trigger. The goal is to use mutual TLS (mTLS) authentication.
The way it will work:
requestor-id
: an identifier used for lookupsX-ARR-ClientCert
: a string representation of their .pem
certificate.pem
has been previously sharedpyOpenSSL
, the Function will load the two .pem
files and compare the request cert and the retrieved certs:not_valid_before/after
datescommon name
issuer
thumbprint
My question is:
If you want to mutual TLS (mTLS) authentication in Azure function app, you just need to enable client certificates. After doing that, Function App Service injects an X-ARR-ClientCert
request header with the client certificate. Function App Service does not do anything with this client certificate other than forwarding it to your app. Your app code is responsible for validating the client certificate. FOr more details, please refer to here and here