MarkLogic 12 EA 1 Product Documentation
xdmp.jwtDecode

xdmp.jwtDecode(
   JWT as String
) as Object

Summary

Extracts the contents of a JWT object.

Parameters
JWT JWT that is to be decoded.

Example

'use strict';

xdmp:jwtDecode("eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.NHVaYe26MbtOYhSKkoKYdFVomg4i8ZJd8_-RU8VNbftc4TSMb4bXP3l3YlNWACwyXPGffz5aXHc6lty1Y2t4SWRqGteragsVdZufDn5BlnJl9pdR_kdVFUsra2rWKEofkZeIC4yWytE58sMIihvo9H1ScmmVwBcQP6XETqYd0aSHp1gOa9RdUPDvoXQ5oqygTqVtxaDr6wUFKrKItgBMzWIdNZ6y7O9E0DhEPTbE9rfBo6KTFsHAZnMg4k68CDp2woYIaXbmYTWcvbzIuHO7_37GT79XdIwkm95QJ7hYC9RiwrV7mesbY4PAahERJawntho0my942XheVLmGwLMBkQ")

=> {
  "header": {
    "alg": "RS256", 
    "typ": "JWT"
  }, 
  "payload": {
    "admin": "true", 
    "iat": "1516239022", 
    "name": "John Doe", 
    "sub": "1234567890"
  }
}
Powered by MarkLogic Server | Terms of Use | Privacy Policy