JSON Web Token1.0
JSON Web Token
1.0
This feature allows the runtime to create JSON Web Tokens(JWT).
Enabling this feature
To enable the JSON Web Token 1.0 feature, add the following element declaration into your server.xml
file, inside the featureManager
element:
<feature>jwt-1.0</feature>
Examples
The following example shows how to configure the server to construct a JSON Web Token (JWT) for an application:
<keyStore id="defaultKeyStore" password="keyspass"/>
<jwtBuilder expiresInSeconds="600" id="myBuilder" issuer="https://example.com" keyAlias="default"/>
The ID
attribute for the jwtBuilder
element named myBuilder
identifies the JWT builder, and uses the default keyAlias
attribute to locate the private key. The issuer
attribute in the example is the URL http://example.com
that identifies who issued the JSON Web Token. The expiry
attribute indicates the token expiration time, which is 600 seconds.