marklogic

MarkLogic: how to use the xdmp:jwt-decode() function


We are running Marklogic Enterprise v11.1.0, and I am trying to run the xdmp:jwt-decode() command as defined in the v11 documentation

I do not see any mention of imports that need to be defined. I am hoping I'm missing something simple, but I have had no luck finding anything except the MarkLogic documentation page (linked above).

Has anyone had any luck using this function?

The super basic code I am running from QConsole is:

xquery version "1.0-ml";

let $jwt := "<JWT content here>"
let $jwt-decoded := xdmp:jwt-decode($jwt)

return
  $jwt-decoded

Which results in the following error:

[1.0-ml] XDMP-UNDFUN: (err:XPST0017) Undefined function xdmp:jwt-decode()

Solution

  • It seems that the xdmp:jwt-decode() and xdmp:jwt-validate() functions were published in the Functions and API documentation a little bit early, ahead of the forthcoming 11.2.0 release when they will be introduced as part of the OAuth 2.0 feature.