koltyakov / sp-rest-proxy

🌐 SharePoint API Proxy for local development
MIT License
172 stars 43 forks source link

private.json clientSecret gets overwritten #45

Closed MiliusCZ closed 6 years ago

MiliusCZ commented 6 years ago

I'm using sp-rest-proxy with SharePoint Online, OnlineAddinCredentials authentication strategy. I have clientId and clientSecret in private.json With version 2.5.3, it worked nicely After upgrade to 2.5.5. each time I run the proxy (using node myPath/server.js), the clientSecret in private.json get's overwritten by random string (which is 2,5 times longer that the secret). After downgrading back to 2.5.3 the issue stays until I remove node_modules and yarn.lock file and run yarn again

koltyakov commented 6 years ago

Hi @MiliusCZ,

It's not a random string, but a hashed version of client secret, which can be decoded only on the machine where it was encrypted.

This behavior is configurable, you can force passwords and secrets to be in a raw form by providing encryptPassword equals false option:

(new RestProxy({
  configPath: './config/private.json',
  authConfigSettings: {
    encryptPassword: false
  }
})).serve();
MiliusCZ commented 6 years ago

Great.. thanks for answering my question!