Skip to content

TF909091: Guest users are not permitted to access this organization as per organization policy #50

@johnnyreilly

Description

@johnnyreilly

Updated 27/12/2025

This was originally opened for an issue with specifying the registry. I've a workaround for that issue, but the subsequent issue discovered here is still an issue #50 (comment) - please skip what is directly below to read that instead

Original issue - there's a workaround

Describe the bug

When trying to use this project with private feeds I receive this error:

Unable to authenticate, your authentication token seems to be invalid.

To Reproduce
Steps to reproduce the behavior:

  1. Run npx --yes ado-npm-auth in a folder with an .npmrc that looks something like this:
registry=https://pkgs.dev.azure.com/johnnyreilly/_packaging/npmrc-script-organization/npm/registry/ 
                        
always-auth=true
  1. See something like this:
npm error code E401
npm error Unable to authenticate, your authentication token seems to be invalid.
npm error To correct this please try logging in again with:
npm error   npm login

Logs look something like this:

0 verbose cli /usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js
1 info using [email protected]
2 info using [email protected]
3 silly config load:file:/usr/local/lib/node_modules/npm/npmrc
4 silly config load:file:/Users/john.reilly/code/dev.azure.com/URLHERE/.npmrc
5 silly config load:file:/Users/john.reilly/.npmrc
6 silly config load:file:/usr/local/etc/npmrc
7 verbose title npm exec ado-npm-auth
8 verbose argv "exec" "--yes" "--" "ado-npm-auth"
9 verbose logfile logs-max:10 dir:/Users/john.reilly/.npm/_logs/2024-10-29T20_30_18_626Z-
10 verbose logfile /Users/john.reilly/.npm/_logs/2024-10-29T20_30_18_626Z-debug-0.log
11 silly logfile start cleaning logs, removing 1 files
12 silly logfile done cleaning log files
13 silly packumentCache heap:4345298944 maxSize:1086324736 maxEntrySize:543162368
14 http fetch GET 401 https://pkgs.dev.azure.com/ORG/_packaging/FEED/npm/registry/ado-npm-auth 284ms (cache skip)
15 verbose stack HttpErrorAuthUnknown: Unable to authenticate, need: Bearer authorization_uri=https://login.windows.net/***, Basic realm="https://pkgsprodsu3weu.app.pkgs.visualstudio.com/", TFS-Federated
15 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:80:17
15 verbose stack     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
15 verbose stack     at async RegistryFetcher.packument (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/registry.js:90:19)
15 verbose stack     at async RegistryFetcher.manifest (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/registry.js:128:23)
15 verbose stack     at async getManifest (/usr/local/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:27:22)
15 verbose stack     at async missingFromTree (/usr/local/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:60:22)
15 verbose stack     at async /usr/local/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:182:32
15 verbose stack     at async Promise.all (index 0)
15 verbose stack     at async exec (/usr/local/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:180:3)
15 verbose stack     at async Npm.exec (/usr/local/lib/node_modules/npm/lib/npm.js:207:9)
16 verbose statusCode 401
17 verbose pkgid ado-npm-auth@*
18 error code E401
19 error Unable to authenticate, your authentication token seems to be invalid.
20 error To correct this please try logging in again with:
20 error   npm login

Expected behavior
I was expecting no error.

Screenshots
N/A

Desktop (please complete the following information):

Other info

I'm authenticated with Azure DevOps already. Doing npm login doesn't seem to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions