jwtClaimGetJSON (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

All

Firmware version:

1.70.00


jwtClaimGetJSON reads a claim from the JWT object as a JSON encoded string

If no claim name is provided, the entire claim is returned.

 

Input:

jwt : SYSHANDLE

A handle to the JWT object.

 

name : STRING

The name of the claim to read. Use an empty string to get the entire claim.

 

Output:

value : STRING

The value of the claim.

 

 

 

Returns: INT

1

- Success

0

- Function is not supported.

-1

- Invalid name.

-2

- Could not find JWT object.

-4

- Could not find claim.

 

 

Declaration:

FUNCTION jwtClaimGetJSON : INT;
VAR_INPUT
  jwt   : SYSHANDLE;
  name  : STRING;
  value : ACCESS STRING;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  rc  : INT;
  str : STRING;
  jwt : SYSHANDLE;
END_VAR;
 
BEGIN
  ...
  // Read claim
  rc := jwtClaimGetJSON(jwt := jwt, name := "map", value := str);
  ...
END;
 
END_PROGRAM;