From 78f9b9036517b77ac009456dae7532f36a209a77 Mon Sep 17 00:00:00 2001 From: mp-strachan <26296076+mp-strachan@users.noreply.github.com> Date: Wed, 7 Dec 2022 19:24:13 +1100 Subject: [PATCH] Update requestTokenByPassword with client_secret As per [this link](https://developers.egnyte.com/docs/read/Public_API_Authentication#Internal-Applications), applications after January 2015 require a client_secret. The current .requestTokenByPassword method does not handle this value and will fail to return a token. --- src/lib/api_elements/auth.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/api_elements/auth.js b/src/lib/api_elements/auth.js index d4bb89f..1355709 100644 --- a/src/lib/api_elements/auth.js +++ b/src/lib/api_elements/auth.js @@ -154,6 +154,7 @@ authPrototypeMethods.requestTokenByPassword = function (username, password) { }, body: [ "client_id=" + this.options.key, + "client_secret=" + this.options.client_secret, "grant_type=password", "username=" + encodeURIComponent(username), "password=" + encodeURIComponent(password) @@ -221,4 +222,4 @@ authPrototypeMethods.getUserInfo = function () { Auth.prototype = authPrototypeMethods; -module.exports = Auth; \ No newline at end of file +module.exports = Auth;