{"action":"closed","issue":{"url":"https://api.github.com/repos/npm/npm/issues/9587","labels_url":"https://api.github.com/repos/npm/npm/issues/9587/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/9587/comments","events_url":"https://api.github.com/repos/npm/npm/issues/9587/events","html_url":"https://github.com/npm/npm/issues/9587","id":106454469,"number":9587,"title":"Separate credentials for each different scopes backed by same registry","user":{"login":"mhofman","id":86499,"avatar_url":"https://avatars.githubusercontent.com/u/86499?v=3","gravatar_id":"","url":"https://api.github.com/users/mhofman","html_url":"https://github.com/mhofman","followers_url":"https://api.github.com/users/mhofman/followers","following_url":"https://api.github.com/users/mhofman/following{/other_user}","gists_url":"https://api.github.com/users/mhofman/gists{/gist_id}","starred_url":"https://api.github.com/users/mhofman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhofman/subscriptions","organizations_url":"https://api.github.com/users/mhofman/orgs","repos_url":"https://api.github.com/users/mhofman/repos","events_url":"https://api.github.com/users/mhofman/events{/privacy}","received_events_url":"https://api.github.com/users/mhofman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/npm/npm/labels/feature-request","name":"feature-request","color":"ACE1AF"},{"url":"https://api.github.com/repos/npm/npm/labels/registry","name":"registry","color":"dd4422"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-15T00:39:32Z","updated_at":"2015-09-21T22:21:12Z","closed_at":"2015-09-21T22:21:12Z","body":"Let's suppose I have packages on 2 different scopes (or some scoped and some un-scoped packages) that are backed by the same registry.\r\n\r\nI would like to use different credentials to access each scope.\r\n\r\nFrom what I understand this is not possible today, even though the documentation doesn't make that clear:\r\n- The [code responsible](https://github.com/npm/npm/blob/b50be6aff34a739ca43de65f546e743d1a9975b9/lib/utils/map-to-registry.js#L48) for auth credentials lookup only considers the registry URL, not the scope if any.\r\n- The [documentation](https://docs.npmjs.com/cli/adduser) seem to imply username and password are associated with the scope, not the registry: `If specified, the user and login credentials given will be associated with the specified scope`\r\n\r\nThe way I see it you should be able to define a set of credentials for a specific registry, and override them in a specific scope.\r\n"}}