When you configure an OpenID Connect (OIDC) identity provider (IdP) in Resource Access Management (RAM), you must provide the SHA-1 thumbprint of the IdP's root Certificate Authority (CA) certificate to ensure secure communication. This tutorial describes how to use the OpenSSL CLI to obtain this thumbprint.
Prerequisites
You have the OpenSSL CLI installed and configured in your system's PATH.
You have the issuer URL of your OIDC IdP (such as
https://oauth.aliyun.com).
Obtain the thumbprint
This tutorial uses oauth.aliyun.com as an example IdP hostname. Replace this with the hostname from your IdP's issuer URL.
Step 1: Get the IdP's certificate chain
Use the OpenSSL s_client command to connect to your IdP's server and display its SSL/TLS certificate chain.
Open a terminal or command prompt.
Run the following command. Replace
<your-idp-hostname>with the hostname of your IdP.openssl s_client -servername <your-idp-hostname> -showcerts -connect <your-idp-hostname>:443Example:
openssl s_client -servername oauth.aliyun.com -showcerts -connect oauth.aliyun.com:443
The command will print detailed connection information followed by one or more certificates in PEM format.
Step 2: Isolate the root CA certificate
The output from the previous step shows a certificate chain. To create a thumbprint for Alibaba Cloud, you must use the root CA certificate, which is the last certificate in the chain shown in the output.
In the command output, scroll to the last certificate block. It will be enclosed by
-----BEGIN CERTIFICATE-----and-----END CERTIFICATE-----markers.-----BEGIN CERTIFICATE----- MIIEaTCCA1GgAwIBAgILBAAAAAABRE7wQkcwDQYJKoZIhvcNAQELBQAwVzELMAkG A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv ... b2N4c2+2n8/fo+ZPA75kO3rKde2b6Xo4Y+5JBzGAeS8g9yS32k2p5yvN9g== -----END CERTIFICATE-----Copy the entire content of this last certificate, including the
-----BEGIN CERTIFICATE-----and-----END CERTIFICATE-----markers.Paste the copied text into a new file and save it as
ca.crt.
Step 3: Calculate the SHA-1 thumbprint
Now, use the OpenSSL x509 command to calculate the SHA-1 fingerprint of the saved root CA certificate file.
In your terminal, run the following command:
openssl x509 -in certificate.crt -fingerprint -sha1 -nooutThe command will output the SHA-1 fingerprint.
SHA1 Fingerprint=90:2E:F2:DE:EB:3C:5B:13******Remove the
SHA1 Fingerprint=prefix and all colons (:) from the output. The resulting string is the thumbprint.902EF2DEEB3C5B13******
You can now use this thumbprint when creating or updating your OIDC IdP configuration in the RAM console.