You need a valid client certificate to use the client certificate grant authentication type.
To get the client certificate, register your Microsoft Dynamics 365 for Sales web application and create a new application user for the registered application.
From the command line, run the following commands from any machine and use the certificates in the Azure Active Directory application.
To create a public-private key pair, run the following command:
keytool -genkey -alias <keypair_name1> -keyalg <key_algorithm> -validity <number_days> -keystore <path and file name of the generated certificate> -storetype <store_type> -keypass <key_password> -storepass <store_password>
To import the root CA certificate(s) followed by the user's signed certificate to the keystore, run the following commands:
keytool -import -trustcacerts -alias <keypair_name2> -file <CA_certificate_name> -keystore <path and file name of the generated certificate>
keytool -import -trustcacerts -alias <keypair_name2> -file <CA_certificate_name> -keystore <path and file name of the generated certificate>
keytool -import -trustcacerts -alias <keypair_name1> -file <user's_signed_certificate_name> -keystore <path and file name of the generated certificate>
These steps might vary depending on the types of files you receive from the CA. If you receive a single file with all the certificates, perform only step b. Do not perform these steps for self-signed certificates.
To export the certificate from the keystore, run the following command:
keytool -export -alias <keypair_name1> -file <certificate_name> -keystore <path and file name of the generated certificate>
A tab opens on the right requesting for App and User details.
Create a new application user and enter the details shown in the following image:
You can choose an App, a Business Unit, and Security role for the new application user.
Click
Create
.
Keep the generated application ID, keystore file, keystore password, key alias, and key password handy to use in a Microsoft Dynamics 365 for Sales connection.