DataWeave JWT Library
Common
jwt::Common
This module provides helper functions to create signed JSON Web Tokens.
Index
Functions
| Name | Description |
|---|---|
| JWT | Helper function to generate the header and payload JWT parts of the token. |
| base64Obj | Helper function that converts a JSON object to base64 format. |
| base64URL | Helper function that converts a binary to base64 format with URL-safe alphabet (RFC-4648#5). |
| binaryJson | Helper function that converts a JSON object to binary format. |
Functions
JWT ↑↑
JWT(header: Object, payload: Object)
Helper function to generate the header and payload JWT parts of the token.
Parameters
| Name | Type | Description |
|---|---|---|
header | Object | Header to encode as part of the JWT. |
payload | Object | Payload to encode as part of the JWT. |
JWT(payload: Object)
Helper function to generate the header and payload JWT parts of the token using a default header.
Parameters
| Name | Type | Description |
|---|---|---|
payload | Object | Payload to encode as part of the JWT. |
base64Obj ↑↑
base64Obj(obj: Object)
Helper function that converts a JSON object to base64 format.
Parameters
| Name | Type | Description |
|---|---|---|
obj | Object | JSON object to convert to base64 format. |
base64URL ↑↑
base64URL(str: Binary)
Helper function that converts a binary to base64 format with URL-safe alphabet (RFC-4648#5).
Parameters
| Name | Type | Description |
|---|---|---|
str | Binary | Binary to encode in base64 format. |
binaryJson ↑↑
binaryJson(obj: Object)
Helper function that converts a JSON object to binary format.
Parameters
| Name | Type | Description |
|---|---|---|
obj | Object | JSON object to convert to binary. |