jwtClaimAdd (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

All

Firmware version:

1.70.00


jwtClaimAdd adds a new string claim to the JWT object.

If the claim already exists, it must be deleted first with jwtClaimDelete.

 

Input:

jwt : SYSHANDLE

A handle to the JWT object.

 

name : STRING

The name of the claim to add.

 

value : STRING

The string to add.

 

 

 

Returns: INT

1

- Success

0

- Function is not supported.

-1

- Invalid name.

-2

- Could not find JWT object.

-6

- Header already exists.

-99

- Failed to add claim.

 

 

Declaration:

FUNCTION jwtHeaderAdd : INT;
VAR_INPUT
  jwt   : SYSHANDLE;
  name  : STRING;
  value : STRING;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  rc  : INT;
  jwt : SYSHANDLE;
END_VAR;
 
BEGIN
  ...
  // Add claim
  rc := jwtClaimAdd(jwt := jwt, name := "name", value := "John Doe");
  ...
END;
 
END_PROGRAM;