Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset admin password? #207

Open
youradds opened this issue Feb 8, 2018 · 3 comments
Open

Reset admin password? #207

youradds opened this issue Feb 8, 2018 · 3 comments

Comments

@youradds
Copy link

youradds commented Feb 8, 2018

Hi,

Howe do you reset the admin password? I found a post from back in 2013, but it talks about a non existent script :/

Cheers

Andy

@xewonder
Copy link

xewonder commented Apr 5, 2020

ever gound a solution?

Thanks...

@youradds
Copy link
Author

youradds commented Apr 6, 2020

Honestly, I can't remember. It was so long ago. Sorry I can't be of more help :(

@jons
Copy link

jons commented Aug 30, 2022

connect directly to the redis instance that you've configured for oauthd in config.local.js and run command KEYS adm:* to confirm you have adm:name, adm:pass set, and optionally adm:salt or something like it. make a copy of these values. use the following node.js script or something like it to either confirm the stored hash is correct for the expected password, or, to generate a new adm:pass value to write back to redis:

const crypto = require('crypto');
const staticsalt = '<same-as-your-config.local.js-staticsalt>';
const generateHash = (data) => {
  const shasum = crypto.createHash('sha1');
  shasum.update(staticsalt + data);
  return shasum.digest('base64');
}
const admsalt = '<read-this-value-from-redis-if-it-exists>';
const h = generateHash('<your-password-here>' + admsalt);
console.log(h);

this function is copied/derived from env.data.generateHash which can be found in bin/data/db.js -- note that the per-user salt stored in adm:salt is specific to my organization's private fork, and also that oauthd might change their hash generation at any time in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants