As far as I’m aware sandboxes don’t have an MxAdmin.
To unblock a user you just need to change the blocked boolean to be false, as far as passwords go, they’re encrypted by the Mendix encryption, and I’m not aware of any decryption call part of the Java SDK, I would suggest changing the password instead.
Hope this helps
Is there a specific reason you need to do this in Java? MxAdmin is just a System.User object, so you can set the password of the User object like you would set any other (probably something like user.setPassword(getContext(), “Welkom01!”); ). The same is true for unblocking (user.setBlocked(getContext(), false); ).
MxAdmin accounts are not automatically created in sandbox environments, but you can create a user with that name.
You can’t get passwords of System.Users (neither in Java nor in microflows), as they are hashed.
MxAdmin existence/password validation:
var arr=com.mendix.core.Core.retrieveXPathQuery(
root.getContext(),
"//System.User[Name='"+com.mendix.core.Core.getConfiguration().getAdminUserName()+"']"
);
if(arr.length>0){
if(
arr[0].getMember(root.getContext(),"Password")
.verifyValue(root.getContext(), '123')
){
console.log("Right password")
}else{
console.log("Wrong password")
}
}else{
console.log("No MxAdmimn")
}