MxAdmin Java

0
Hi How can I get the MxAdmin password in Java. Additionally are there certain kinds of deployments that dont have an MxAdmin account or a completely unusable MxAdmin account. (if thats possible at all), e.g. sandbox. I also need to be able to unblock MxAdmin in java.
asked
3 answers
1

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 

answered
1

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.

answered
0

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")
}

 

answered