VS Code Extension authentication problem

Sami Koskivaara
Giga Contributor

My user account has admin rights to our ServiceNow instance. I can login to instance with my username and password no problem from the UI and I can access to my application scope and make changes in ServiceNow. No 2 FA activated. It's a domain separated instance but my account is not in global, but couple levels down. I use node 14.2.0 locally. I'm NOT using Oauth, I'm using Basic authentication.

1. Open VS Code

2. Activate ServiceNow extension (latest version)

3. Create now project

4. Add URL and credentials with Basic auth

5. Select your custom application scope

6. It start to download the app but has error about Oauth token expired and asks authenticate again

7. Downloading stops and none of the scripts are downloaded

 

This errors pop up multiple times:

find_real_file.png

 

1 ACCEPTED SOLUTION

Hi, 
When you select the same current folder during setup workspace, vscode ignores the command and hence nothing happens. I suggest you open a fresh instance of vscode (no folder opened inside) and do the setup workspace command, or select a completely different folder during setup workspace (folder which is not currently open in vscode)

View solution in original post

6 REPLIES 6

sachin_namjoshi
Kilo Patron
Kilo Patron

It seems your oauth token has expired which is needed to connect to your instance.

Have you tried basic authentication? It should work for you.

 

Regards,

Sachin

 

I'm not using Oauth, I'm using Basic authentication. I don't understand where that OAuth comes from. I have tried to reset the local VS Code project and all. Every time I select Basic authentication and it can do the first authentication OK when it connects to SN instance and I can select my application. It's only after it tries to download it, it starts to complain about authentication.

Shiva22
ServiceNow Employee
ServiceNow Employee

Hi Sami, 

By looking at the sequence of steps which you used in order to import a project, I see that you have not done the step of setting up the workspace. You have to explicitly set up a workspace by invoking the command ''Now: Setup Now Workspace" before you import any project. 
You can read documentation about setting up workspace here.

I just tested it with workspace also, did not work, same problem continues. I even deleted all files from the folder, restarted vs code, activated extension, selected workspace (selected the current folder), create project, put url/username/password/select basic auth, select custom application, select your own app and import. Now when it starts to import the app those OAuth token errors pop up and it also pop ups url/username/password window to the top.