This section presents the steps that you need to follow to create a key collection, start using public keys to verify JWT signatures in client requests, and update the key collection used by your property.

Suppose a company issues JWTs to identify clients and authorize them to access specific topics. The company needs to provide a key collection with a public key in the property's JWT behavior to make sure that the JWTs in client requests are properly validated. Here are the steps to do that:

  1. Create a key collection.
  1. Create a key collection version and set the primaryKey object member.
  1. Optionally, activate the key collection version on staging.
  1. Refer to the key collection in the property's JWT behavior.

  2. Activate the key collection version on production

If for security reasons, the company decides to rotate public key used by the property, it can simply do so by updating the key collection referenced in the JWT behavior. Here are the steps to do that:

  1. Create a key collection version and set the secondaryKey object member.
  1. Optionally, activate the key collection version on staging.
  1. Activate the key collection version on production.
  1. Create a key collection version where you replace the primaryKey value with the secondaryKey value.
  1. Optionally, activate the key collection version on staging
  1. Activate the key collection version on production.