Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Oauth not working #30

Open
collinwong53 opened this issue Aug 12, 2020 · 4 comments
Open

Oauth not working #30

collinwong53 opened this issue Aug 12, 2020 · 4 comments

Comments

@collinwong53
Copy link

Hi, I am trying to use OAuth but it seems like my credentials get deleted by checkParams function. I tried adding it back in as soon as it's deleted in the nsconfig function in the nsconfig.js but it still does not work. Am I missing something or is this a known issue?

@mattgaspar
Copy link
Collaborator

Hi @collinwong53,
Make sure nscabinet and nsconfig are both installed from GitHub and not NPM. They should be at version 0.7.0 and 0.6.0 respectively.
When nscabinet is install from GitHub it should automatically pull in the correct nscabinet version.

npm install suiteplus/nscabinet
npm install suiteplus/nsconfig

I don't have access to publish the updated versions to NPM and the author is non-responsive. I only have access to the GitHub repositories.

@collinwong53
Copy link
Author

collinwong53 commented Aug 13, 2020

@mattgaspar Thanks for the quick response. I gave it another shot, it fixed the tokens getting removed from params but I am still getting invalid login. I do notice that the nscabinet folder gets installed into node modules, and then that folder has its own node modules. Is that correct, or should it be in the root directory?

@mattgaspar
Copy link
Collaborator

@collinwong53 Are you sure that the role that the token was generated for has the necessary permissions?

On the role, under the Setup tab make sure you have Full access for:
REST Web Services
SuiteScript
User Access Tokens

And under Lists you might need "Documents and Files"

Also, I'm not sure if you just used the wrong term but this authentication is using Token Based Authentication NOT OAuth.
Are you using the Consumer Key and Secret generated from the Integration record and the Token from the User Access Token?

The node modules folder is probably not an issue but if the above doesn't help, you could delete the root node_modules folder and do an npm install to see if that makes a difference. Make sure your package.json only lists one version of nscabinet, it should say "nscabinet": "github:suiteplus/nscabinet" and you don't need nsconfig in the package.json because it is a dependency of nscabinet.

@collinwong53
Copy link
Author

Hey @mattgaspar,

Thanks so much for your response. It turns out all I had to do was capitalize sb_1 on the account param =(. Sorry for raising a dumb issue. I really appreciate your response though.

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

No branches or pull requests

2 participants