How to reset Xray’s admin password?

Maayan Amrani
2019-10-02 07:13

Subject

How to reset the 'admin' user in JFrog Xray?
 

Instructions

In order to reset the password for the admin user in Xray (when Artifactory is configured as the Authentication Provider), you need to connect to the MongoDB and manually change it.

Docker installation:

1 – Connect to mongoDB container: docker exec -it <container ID> bash

2 – Connect to mongo DataBase: mongo -u xray –authenticationDatabase xray –authenticationMechanism SCRAM-SHA-1 -p password (when using the default DB (not externalized DB) the schema name is 'xray')

3 – Switch to Xray DB : use xray

4 – Change admin password : db.getCollection('users').update({name: "admin"},{$set: {password:"SaltedPassword"}});

The default Xray Admin password is this Salted Password: ""qCjYNYARDMbIOcYf6fAJYEI04vAeeJjSy/WIfNv1LV0=""

5 – Open Xray UI and verify you can login with user: ’admin' , password: <Default_xray_Admin_pass>

Non-docker installation:

1 – Connect to mongo DB

2 – Switch to Xray DB : use xray

3 – Change admin password : db.getCollection('users').update({name: "admin"},{$set: {password:"SaltedPassword"}});

4 – Open Xray UI and verify you can login with user: ’admin' , password: ’updatedPassword’