sec.createCredential( name as String, description as String, username as String?, password as String?, certificate as String?, private-key as String?, signing as Boolean, targets as element(sec.credentialTarget)[], permissions as element(sec.permission)[] ) as (Number|String)
This function creates a new security credential with the specified values.
http://marklogic.com/xdmp/privileges/create-credential
This function must be executed against the security database.
xquery version "1.0-ml"; import module namespace sec = "http://marklogic.com/xdmp/security" at "/MarkLogic/security.xqy"; sec:create-credential("my-secure-credential", "a secure credential", "secure-user", "secure-password", (), (), fn:false(), (), xdmp:permission("secure-role", "execute"))
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.