Why are Certificates more secure than Secrets?

DANILO BATISTA DE QUEIROZ 1 Reputation point
2022-06-09T23:49:01.327+00:00

When using OAuth2, why Certificates are more secure than using Secrets?
If an eavesdropper steals the JWT isn't the same stealing the Secret?

Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
230 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,712 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. 2022-06-10T00:41:29.71+00:00

    Hello @DANILO BATISTA DE QUEIROZ , the main reasons of why Certificates are more secure than Secrets would be:

    1. Certificate assertions are usually short-lived (Eg. 5 to 10 minutes) so if even if intercepted they will provide only limited use. Secrets on the other hand tend to be long-lived.
    2. Secrets are symmetric keys so both client and server need to know about it. With certificates only the client needs to be able to use the private key w/o reading it (which is usually handled by the OS cryptographic system) while the server only needs to know the public key for validation thus you won't need to transmit/share the private key/secret. With a secret you will have to both share and transmit it.

    Access tokens are usually short-lived (max 1 hour by default). Secrets, again, are usually long lived. Also, access tokens are issued to only 1 client while a secret can be used to issue several access tokens for several clients.

    Let us know if this answer was helpful to you or if you need additional assistance. If it was helpful, please remember to accept it so that others in the community with similar questions can more easily find a solution.

    3 people found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.