generate_jwt

The generate_jwt statement is used to generate an RFC 7515-compliant JWT (JSON Web Token) which can be used, for example, for Google Cloud OAuth 2.0 Server to Server Authentication.

Syntax

generate_jwt keykey component1 [... componentN]asresult

Details

The generate_jwt statement performs the following actions:

  • encodes all components as Base64URL

  • concatenates all components using a dot separator (.)

  • hashes the concatenated result using SHA256

  • signs the hash with a provided PEM-encoded key using the RSA algorithm

  • encodes the resulting signature as Base64URL

  • builds JWT by concatenating the two results using a dot separator (.)

  • stores the final result in the variable specified by the result parameter

Example

To acquire a Google Cloud OAuth 2.0 access token:

Last updated

Was this helpful?