JSON WebToken Calculator
This adapter generates, verifies and processes JSON WebTokens.
Former name of the adapter until version 5.5.4: JSON WebToken
Properties
Operation | Defines the operation executed by the adapter Possible values:
|
Parameters
The following parameters are required for the above operations:
CreateJWT | Verify | CreateXML | |
---|---|---|---|
algorithm | required | required | required |
useServerSecret | required if useSecretAsPublicKey is not used. | ||
useSecretAsPublicKey | required if useServerSecret is not used. | ||
secret | required if useSecretAsPublicKey is used. | ||
keystoreUrl | required | required | |
keystoreType | required | required | |
keystorePassword | required | required | |
keyAlias | required | required | |
keyPassword | required | required |
Adapter | Adapter main class (do not change!) Possible values: de.softproject.integration.adapter.json.webtokenJSONWebTokenAdapter: Main class (default) |
algorithm | Algorithm used for the operation Possible values:
|
useServerSecret | Only relevant for HMAC algorithms. Specifies if an integrated server secret or a custom server secret is used. Possible values:
|
useSecretAsPublicKey | Only relevant for RSA and ECDSA algorithms. Determines if the value of the parameter Possible values:
|
secret | Only relevant for HMAC algorithms. Password used to encrypt or decrypt a token. Possible values: Base64 encoded password |
keystoreUrl | URL to the keystore that contains the RSA/ECDSA key pair Possible values: URL to a keystore The keystore must be supported by the Java Security API, e.g. JKS or PKCS#12. |
keystoreType | Type of the keystore that contains the RSA/ECDSA key pair Possible values: Type of the keystore, e.g. |
keystorePassword | Password of the keystore that contains the RSA/ECDSA key pair Possible values: Password |
keyAlias | Alias of the asymmetric key used for RSA/ECDSA algorithms Possible values: Alias of the used key |
keyPassword | Password of the asymmetric key used for RSA/ECDSA algorithms Possible values: Password of the used key |
Status values
1 | The adapter operation was executed successfully:
|
-1 | An error occurred during the execution of the adapter:
|
400 | The token is expired. This status value is only output by the |
Input
The adapter expects different inputs depending on the operation:
Operation
CreateJWT
: An XML document with the following format is expected:- The Header types
typ
(parameter:keystoretype
) andalg
(parameter:algorithm
) is set by the adapter. - Do not use claims with duplicated names.
The Header element is optional and can be declared when needed. For example, Microsoft Azure expects a header declaration.
Sample input
XML<?xml version="1.0" encoding="UTF-8"> <TokenContent> <Headers> <Header name="x5t">hOBcHZi846VCHSJbFAs26Go9VTQ=</Header> <Header name="kid">vdgdINF455FBKWDSEF5gdrgddgg=</Header> </Headers> <Subject name="sub" type="String">1234567890</Subject> <ExpiresAt name="exp" type="Integer">1577750400</ExpiresAt> <NotBefore name="nbf" type="Integer">946684800</NotBefore> <Id name="jti" type="String">007</Id> <Claims> <Claim name="name" type="String">John Doe</Claim> <Claim name="admin" type="boolean">true</Claim> </Claims> </TokenContent>
For additional information on the claims to be used and their XML objects, see iana.org. For non-reserved claims, the names can be arbitrary, but they must not be the same as already reserved claims such as
bsp.
orexp.
The values
String
,Boolean
,Integer
,Long
andDouble
are available astype
.The elements
ExpiresAt
,NotBefore
andIssuedAt
expect information in Unix time format.- The Header types
- Operations
Verify
andCreateXML
: A JSON WebToken is expected, which can be taken from an intermediate step or passed as a text file (.txt
).
Output
The adapter outputs different results depending on the operation:
- Operation
CreateJWT
: A JSON WebToken is stored in the output - Operation
Verify
: If the JWT is valid, it is output - Operation
CreateXML
: The XML document for the JSON WebToken is stored in the output