- Flexera Community
- :
- Cloud Management Platform
- :
- Cloud Management Platform Forum
- :
- Unknown function 'jwt_encode'
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unknown function 'jwt_encode'
I try to create jwt token using jwt_encode($algorithm, $payload, $key, $header_fields) (from https://docs.rightscale.com/ss/reference/rcl/v2/ss_RCL_functions.html#miscellaneous-jwt_encode)
But when I upload CAT file to Designer I got - Unknown function 'jwt_encode' at line 16, column 16 Use valid Cloud Application Template syntax
My code is similar to:
$payload = {"target_audience": $some_endpoint, "iss": "email", "sub": "email", "aud": "url", "exp": 1644320037, "iat": 1644320037}
$key = "key"
$header = {"alg": "RS256", "typ": "JWT"}
$jwt = jwt_encode("RS256", $payload, $key, $header)
COULD YOU HELP ME WITH THAT?
Thank you, Vasyl Stavinskyi
- Mark as New
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'd have to see more of the file, but I suspect the problem may be that your code is outside of an RCL definition and therefore cannot be parsed as RCL code. An RCL definition looks like:
define do_something($some_endpoint)
$payload = {"target_audience": $some_endpoint, "iss": "email", "sub": "email", "aud": "url", "exp": 1644320037, "iat": 1644320037}
$key = "key"
$header = {"alg": "RS256", "typ": "JWT"}
$jwt = jwt_encode("RS256", $payload, $key, $header)
...
end
- Mark as New
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually I have the same separated method in my CAT file
