ePages 7.26.0 - DE_EPAGES/Shop/API/JWT.pm

Package package

This package provides the JsonWebToken for the Shop.

Package DE_EPAGES::Shop::API::JWT

@EXPORT_OK
CreateShopJsonWebToken
AddEditorTokenToURL

Functions

AddEditorTokenToURL
CreateShopJsonWebToken

AddEditorTokenToURL

Creates a new JWT with the editor scope and adds it to the given URL

Syntax
AddEditorTokenToURL($Servlet, $URL);
Input
$Servlet (object)
servlet
$URL (string)
cureent URL
Return
$URL (string)
URL with added JWT

CreateShopJsonWebToken

Returns a newly created JSON web token with the shop's alias as subject and the secret taken from the "jwtsecret" key-value pair of the respective store conf. See DE_EPAGES::Core::API::PerlTools::CreateJsonWebToken.

Syntax
CreateShopJsonWebToken($Lifetime, $Shop, $Scope);
Input
$Lifetime (integer)
the token's lifetime in seconds
$Shop (object)
shop object
$Scope (string)
the token's scope (e.g. editor or provisioning)
Return
$JWT (string)
encoded JSON web token