Changing admin password?

Hi,

I'm trying to change the admin password (default "changeit"), but
can't find any references in the docs on how to do it
(http://docs.geteventstore.com/server/3.6.0/command-line-arguments/).
In what file do I make this change?

regards, Rickard

Hi Rickard

You can change it in the webUI or via the API

go to you http://:port/

then logon and go to users,

click on admin and then Password Reset

If you so it via API, remember to do it on the master node. We found it not working on the secondary nodes.

Hope that helps?

Chris

Hey Chris,

Thanks! Both of those are no-gos, as all our setup is automated
through Ansible. No manual steps allowed.

In the end what I think we'll do is leave the default admin password,
but proxy it through NGINX whose config can be automated. Good enough.

/Rickard

HI Rickard

We have it also fully automated. We use the API for that.

Here is a snippet of how we do it via PowerShell as we run on Windows

Test if user has changed

$uri = ‘http://’+$ServerIP+’:1116’ + ‘/streams/$user-’+$user+’?embed=body&format=json’

$json = Invoke-RestMethod -Uri $uri -Credential $cred

$entries = $json.entries

$eventNum = $entries.positionEventNumber | measure -Maximum

if ($eventNum.Maximum -gt 0)

{“It is Done”}

Else {

#Reset password

$body = ‘“newPassword”:"’+$Password+’"’

$url2 = ‘http://’+$ServerIP+’:1116/users/’+$User+’/command/reset-password’

Invoke-RestMethod -Method POST -Uri $url2 -ContentType ‘application/json’ -Body “{$body}” -Credential $cred -OutFile “c:\cfn\log$User.txt”

}

}

Hope this help you on the right way

Chris

Why would you not be able to use the API with an ansible script? It is
a http post.

Hey,

I have worked through this doc
http://docs.geteventstore.com/http-api/3.6.0/

The main thing you need to remember is that the users/system is also a stream.

so $users and then $user-admin to query the users and if you want to reset it you talk to “/users/”

Hope that helps

Chris

Hey Chris!

Thanks, that was helpful! So, it's a bit of indirect documentation
then, and you have to put a few things together to figure out that
this is the way to do it.

Btw, is there an ES REST API client in Java somewhere or does everyone
roll their own?

/Rickard

Hi Rickard

Cause it’s just an HTTP request, I am not sure what you mean with REST API Client.

I have used Postman - REST Client on Chrome to test my syntax, from there it’s all around how you do HTTP request in your code.

Quick google shows you can use java.net.HttpURLConnection Don’t know what is needed around it… but hey google is your friend

Chris

Hey Chris!