SBX - Search With Button

SBX - Forum Post Title

Unauthorized when try Download Symbols in VS Code using Credentials UserName

Microsoft Dynamics NAV Forum

Peter Karsten asked a question on 9 Jul 2018 6:08 AM
My Badges

Question Status

Verified

Hello,

i have a "little" Problem. There are running a NAV2018 Server in a Hyper V VM. There are running two Databases/two instances.

Webclient / RTC all works fine, now i'm trying publish some extension / dowload AL Symbols. 

The Demo NAV Instance is startet with Credential Type UserName. But when in VS Code i try Download Symbols, it says me:

[2018-07-09 12:54:28.85] Sending request to nav18test/.../packages;appName=Application&versionText=11.0.22292.0
[2018-07-09 12:54:28.85] Sending request to nav18test/.../packages;appName=System&versionText=11.0.12925.0
[2018-07-09 12:54:28.85] The request for path /DynamicsNav110/dev/packages?publisher=Microsoft&appName=Application&versionText=11.0.22292.0 failed with code Unauthorized. Reason: Unauthorized
[2018-07-09 12:54:28.85] The request for path /DynamicsNav110/dev/packages?publisher=Microsoft&appName=System&versionText=11.0.12925.0 failed with code Unauthorized. Reason: Unauthorized
The authentication has been cancelled.

Then i tried Start the Instance with Credentials Windows, and Downloading Symbols are fine:

    [2018-07-09 10:58:17.13] Sending request to nav18test/.../packages;appName=Application&versionText=11.0.0.0
    [2018-07-09 10:58:17.13] Sending request to nav18test/.../packages;appName=System&versionText=11.0.0.0
    [2018-07-09 10:58:17.64] All reference symbols have been downloaded.




So. Where is the Differency? Or how i can analyse whats the problem? On Server i can't see any logs that say me that was an unauthorised log attempt.

Or forget i a Config "screw" ? What can i try?

Thanks

Regards

Reply
Mohana Yadav responded on 9 Jul 2018 6:25 AM
My Badges
Suggested Answer

Did you try by clearing your credential cache once

Ctrl+Shift+P

type

>AL: Clear credentials cache

enter

next time it will ask for credentials and provide credentials and try

Reply
Peter Karsten responded on 9 Jul 2018 7:07 AM
My Badges

Yes. Each try i clear credentials cache first.

Reply
Viki NTS responded on 10 Jul 2018 8:45 AM
My Badges
Suggested Answer

check "authentication": "Windows" configuration on launch.json , it must be UserName in your case if the instance Credential Type UserName

Reply
Peter Karsten responded on 10 Jul 2018 8:57 AM
My Badges

This is my launch.json:

"configurations": [

       {

           "type": "al",

           "request": "launch",

           "name": "Your own server",

           "server": "http://nav18test",

           "serverInstance": "DynamicsNav110",

           "authentication": "UserPassword",

           "startupObjectId": 22

       }


Reply
Viki NTS responded on 10 Jul 2018 9:15 AM
My Badges

"authentication" must be any one of the following credential type

Windows, UserName, NavUserPassword, AccessControlService. based on your Instance Configuration. Your Instance Credential Type and launch.json authentication should match

Reply
Mohana Yadav responded on 10 Jul 2018 9:38 AM
My Badges
Suggested Answer

I am using UserPassword without any issue.

Reply
Viki NTS responded on 10 Jul 2018 9:49 AM
My Badges

Yes, in json file it must be either Windows, UserPassword, AAD and in NAV Instance it must be either Windows, UserName, NavUserPassword, AccessControlService.

Reply
Viki NTS responded on 10 Jul 2018 10:04 AM
My Badges

i faced the same issue and i tried with windows and again changed to NavUserPassword, restarted the instance it worked for me.

dono the reason behind this.

Reply
Peter Karsten responded on 12 Jul 2018 9:07 AM
My Badges
Verified Answer

Think i have the Solution.

I Started a NAV Instance with Credentials NavUserPassword (After create user in NAV with role Super) , then in Visual Studio Code, Authentication UserName, and it works, Symbols can be download.

So it seems that i can't auth in Visual Studio Code, when the NAV Instance started with Credentials UserName, because in VS Code only i can put AAD, Windows and UserPassword. And UserPassword it's equivalent to NavUserPassword, and i thinked that the equivalent was Username.

Reply
Peter Karsten responded on 12 Jul 2018 9:07 AM
My Badges
Verified Answer

Think i have the Solution.

I Started a NAV Instance with Credentials NavUserPassword (After create user in NAV with role Super) , then in Visual Studio Code, Authentication UserName, and it works, Symbols can be download.

So it seems that i can't auth in Visual Studio Code, when the NAV Instance started with Credentials UserName, because in VS Code only i can put AAD, Windows and UserPassword. And UserPassword it's equivalent to NavUserPassword, and i thinked that the equivalent was Username.

Reply
Mohana Yadav responded on 9 Jul 2018 6:25 AM
My Badges
Suggested Answer

Did you try by clearing your credential cache once

Ctrl+Shift+P

type

>AL: Clear credentials cache

enter

next time it will ask for credentials and provide credentials and try

Reply
Viki NTS responded on 10 Jul 2018 8:45 AM
My Badges
Suggested Answer

check "authentication": "Windows" configuration on launch.json , it must be UserName in your case if the instance Credential Type UserName

Reply
Mohana Yadav responded on 10 Jul 2018 9:38 AM
My Badges
Suggested Answer

I am using UserPassword without any issue.

Reply

SBX - Two Col Forum

SBX - Migrated JS