IRISLIB database
JWT Class Reference

This class provides methods to create and validate JSON Web Tokens, as defined in RFC 7519. More...

Inheritance diagram for JWT:
Collaboration diagram for JWT:

Static Public Member Functions

_.Library.Status Create (_.Library.DynamicObject sigJOSE, _.Library.DynamicObject encJOSE, _.Library.DynamicObject claims, _.Library.String sigJWKS, _.Library.String encJWKS, _.Library.String JWT)
 This class provides methods to create and validate JSON Web Tokens, as defined in RFC 7519. More...
 
_.Library.Status Validate (_.Library.String JWT, _.Library.String sigJWKS, _.Library.String encJWKS, _.Library.Boolean acceptUnsecured, _.Library.DynamicObject claims, _.Library.DynamicArray operations)
 This method validates a JSON Web Token (JWT). More...
 

Additional Inherited Members

- Public Member Functions inherited from RegisteredObject
_.Library.Status OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount)
 This callback method is invoked when the current object is added to the SaveSet,. More...
 
_.Library.Status OnClose ()
 This callback method is invoked by the <METHOD>Close</METHOD> method to. More...
 
_.Library.Status OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned)
 This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More...
 
_.Library.Status OnNew ()
 This callback method is invoked by the <METHOD>New</METHOD> method to. More...
 
_.Library.Status OnValidateObject ()
 This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More...
 
- Static Public Attributes inherited from RegisteredObject
 CAPTION = None
 Optional name used by the Form Wizard for a class when generating forms. More...
 
 JAVATYPE = None
 The Java type to be used when exported.
 
 PROPERTYVALIDATION = None
 This parameter controls the default validation behavior for the object. More...
 

Detailed Description

This class provides methods to create and validate JSON Web Tokens, as defined in RFC 7519.

Member Function Documentation

◆ Create()

This class provides methods to create and validate JSON Web Tokens, as defined in RFC 7519.

This method creates a JSON Web Token (JWT).



Input parameters:

  • sigJOSE - Object representation of the JSON Object Signing and Encryption (JOSE) Header to be used if this JWT is going to be signed.
  • encJOSE - Object representation of the JSON Object Signing and Encryption (JOSE) Header to be used if this JWT is going to be encrypted.
  • claims - Object representation of the claims to be contained in the JWT.
  • sigJWKS - The JSON Web Key Set (JWKS) that contains the key to be used for signing this JWT (if it is going to be signed). This defaults to null.
  • encJWKS - The JWKS that contains the key to be used for encrypting this JWT (if it is going to be encrypted). This defaults to null.


Output parameters:

  • JWT - The JWT that is created.


Return value:

  • A status indicating whether or not a JWT could be created given the provided inputs, where error values indicate that a JWT could not be created and describe the reason why.


Notes:

  • If sigJOSE is defined, then sigJWKS must also be defined unless the signing algorithm is "none".
  • If encJOSE is defined, then encJWKS must also be defined.
  • If both sigJOSE and encJOSE are defined, then the JWT will be signed, then encrypted as recommended in RFC 7519 section 11.2.
  • sigJWKS and encJWKS can be the same JWKS, but if both signing and encryption are to be used then the arguments must both be passed (even if they contain the same value).

◆ Validate()

_.Library.Status Validate ( _.Library.String  JWT,
_.Library.String  sigJWKS,
_.Library.String  encJWKS,
_.Library.Boolean  acceptUnsecured,
_.Library.DynamicObject  claims,
_.Library.DynamicArray  operations 
)
static

This method validates a JSON Web Token (JWT).



Input parameters:

  • JWT - The JWT to be validated.
  • sigJWKS - The JSON Web Key Set (JWKS) that contains the key to be used for verifying this JWT's signature (if it was signed). This defaults to null.
  • encJWKS - The JWKS that contains the key to be used for decrypting this JWT (if it was encrypted). This defaults to null.
  • acceptUnsecured - Boolean value indicating whether to accept unsecured JWTs or not. This defaults to false.


Output parameters:

  • claims - Object representation of the claims contained in the JWT.


Return value:

  • A status indicating whether or not the provided JWT was validated given the provided JWKSs, where error values indicate that the JWT is not valid and describe the reason why.


Notes:

  • sigJWKS and encJWKS can be the same JWKS, but if both signing and encryption were used then the arguments must both be passed (even if they contain the same value).