Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Unauthorized when try Download Symbols in VS Code using Credentials UserName

Posted on by Microsoft Employee

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

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unauthorized when try Download Symbols in VS Code using Credentials UserName

    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.

  • Viki NTS Profile Picture
    Viki NTS 250 on at
    RE: Unauthorized when try Download Symbols in VS Code using Credentials UserName

    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.

  • Viki NTS Profile Picture
    Viki NTS 250 on at
    RE: Unauthorized when try Download Symbols in VS Code using Credentials UserName

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

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,114 Super User 2024 Season 2 on at
    RE: Unauthorized when try Download Symbols in VS Code using Credentials UserName

    I am using UserPassword without any issue.

  • Viki NTS Profile Picture
    Viki NTS 250 on at
    RE: Unauthorized when try Download Symbols in VS Code using Credentials UserName

    "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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unauthorized when try Download Symbols in VS Code using Credentials UserName

    This is my launch.json:

    "configurations": [
    
           {
    
               "type": "al",
    
               "request": "launch",
    
               "name": "Your own server",
    
               "server": "http://nav18test",
    
               "serverInstance": "DynamicsNav110",
    
               "authentication": "UserPassword",
    
               "startupObjectId": 22
    
           }


  • Suggested answer
    Viki NTS Profile Picture
    Viki NTS 250 on at
    RE: Unauthorized when try Download Symbols in VS Code using Credentials UserName

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unauthorized when try Download Symbols in VS Code using Credentials UserName

    Yes. Each try i clear credentials cache first.

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,114 Super User 2024 Season 2 on at
    RE: Unauthorized when try Download Symbols in VS Code using Credentials UserName

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,134 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,928 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans