I have a web app deployed on Azure. I want to restrict only devices with certificates to access the website. I know the certificate needs to be installed on the client device. But for the server side, I am not sure how to validate it. The website is developed using Java EE.
You could follow the steps below.
1.Navigate to your web app in the portal -> Configuration
-> General settings
-> set Require incoming certificate
to On
. If you want to allow certain paths to remain open for anonymous access, you can define exclusion paths as part of your application configuration, see this link.
2.When forwarding the request to your app code with client certificates enabled, App Service injects an X-ARR-ClientCert
request header with the client certificate.
The client cert is available in your app through a base64 encoded value in the X-ARR-ClientCert
request header, your app code is responsible for validating the client certificate.
There are just ASP.NET sample
and Node.js sample
in the officilal doc, you could take a look and implement it in java.