Shortcode gwp_jwt_link

You can use a shortcode to create a link with a JWT token.

This example shortcode will use the Private key saved in the settings of Form ID 1 (the Form we want to fill with JWT claims), links to the page on your site where the form is embedded and includes the JWT claim ‘text’ filled with a Merge Tag from the form you use this shortcode in.

[gwp_jwt_link form_id='1' form_url='' text='{Text:1}']

The shortcode returns a clean url.

You can also generate a link by using the shortcode like this:

[gwp_jwt_link form_id='1' form_url='' text='{Text:1}']Link text[/gwp_jwt_link]

This will return a html link.

The available shortcode settings are:

  • form_id (required): this is the ID of the Form you want to populate with JWT claims.
  • form_url: this is the url of the page where the url should point to.
  • form_url_postfix: possibility to add your own extra parameters to the url.
  • url_param: change the token parameter (default is ‘gwp_token’).
  • return_format: ‘url’ (default) or ‘token’, which only returns the token.
  • disable_iat: disables the issued at date.
  • exp: setting an expiration date to the link (so for more detailed instructions below).

Expiration date

You can set the ‘exp’ claim to configure a expiration date of the token. For filling the expiration claim you can use any date format.

[gwp_jwt_link form_id='1' form_url='' text='{Text:1}' exp='08/03/2022']Link text[/gwp_jwt_link]

Disable IAT (issued at date)

You can disable the issued at date (iat) in the token by adding disable_iat=true.

[gwp_jwt_link form_id='1' form_url='' text='{Text:1}' disable_iat='true']Link text[/gwp_jwt_link]

Last updated: 07-03-2024

JWT Prefillv1.2.7

For this functionality (using JSON Webtokens to populate fields) you need to activate the GravityWP - JWT Prefill Add-on.

Read more