xdmp.jwtValidate( JWT as String, alg as String, secret as String ) as Boolean
Validates the signature of a JWT.
Parameters | |
---|---|
JWT | JWT that is to be validated. |
alg | Signature algorithm used for the JWT. |
secret | Secret used to decrypt JWT signature. |
'use strict'; xdmp.jwtValidate("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.5mhBHqs5_DTLdINd9p5m7ZJ6XD0Xc55kIaCRY5r6HRA", "HS256", "74657374") => true
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.