Hi,
The passwords are stored into Security DB, in collection “http://marklogic.com/xdmp/users”.
In these documents, the digest-password element value is md5(username+":"+realm+":"+password)
See http://en.wikipedia.org/wiki/Digest_access_authentication
Assuming you have a user “user” with password “password” and set the realm as “public” when installing marklogic, you can check with the following :
(:XQuery:)
xdmp:exists(
cts:search(fn:collection("http://marklogic.com/xdmp/users"),
cts:and-query((
cts:element-value-query(fn:QName("http://marklogic.com/xdmp/security", "user-name"), "user"),
cts:element-value-query(fn:QName("http://marklogic.com/xdmp/security", "digest-password"), xdmp:md5("user:public:password"))
))))
//JavaScript
cts.exists(
cts.andQuery([
cts.collectionQuery("http://marklogic.com/xdmp/users"),
cts.elementValueQuery(fn.QName("http://marklogic.com/xdmp/security", "user-name"), "user"),
cts.elementValueQuery(fn.QName("http://marklogic.com/xdmp/security", "digest-password"), xdmp.md5('user:public:password'))
]))