Uname : Linux serv1.rebootns.com 5.14.0-570.62.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 10:10:59 EST 2025 x86_64
Soft : LiteSpeed
Ip : 139.99.125.122
Port : 443
~
/
opt
/
alt
/
alt-nodejs9
/
root
/
usr
/
lib
/
node_modules
/
npm
/
lib
/
auth
[ HOME ]
Exec
Submit
sso.js
var log = require('npmlog') var npm = require('../npm.js') var output = require('../utils/output') var opener = require('opener') module.exports.login = function login (creds, registry, scope, cb) { var ssoType = npm.config.get('sso-type') if (!ssoType) { return cb(new Error('Missing option: sso-type')) } var params = { // We're reusing the legacy login endpoint, so we need some dummy // stuff here to pass validation. They're never used. auth: { username: 'npm_' + ssoType + '_auth_dummy_user', password: 'placeholder', email: 'support@npmjs.com', authType: ssoType } } npm.registry.adduser(registry, params, function (er, doc) { if (er) return cb(er) if (!doc || !doc.token) return cb(new Error('no SSO token returned')) if (!doc.sso) return cb(new Error('no SSO URL returned by services')) output('If your browser doesn\'t open, visit ' + doc.sso + ' to complete authentication') opener(doc.sso, { command: npm.config.get('browser') }, function () { pollForSession(registry, doc.token, function (err, username) { if (err) return cb(err) log.info('adduser', 'Authorized user %s', username) var scopeMessage = scope ? ' to scope ' + scope : '' output('Logged in as %s%s on %s.', username, scopeMessage, registry) cb(null, { token: doc.token }) }) }) }) } function pollForSession (registry, token, cb) { log.info('adduser', 'Polling for validated SSO session') npm.registry.whoami(registry, { auth: { token: token } }, function (er, username) { if (er && er.statusCode !== 401) { cb(er) } else if (!username) { setTimeout(function () { pollForSession(registry, token, cb) }, npm.config.get('sso-poll-frequency')) } else { cb(null, username) } }) }
Submit
Back
Folder Name
Submit
File Name
File Content
Submit
Name
Type
Size
Permission
Last Modified
Actions
.
dir
-
0755
2025-11-16 11:16:17
..
dir
-
0755
2025-11-16 11:16:17
legacy.js
file
1.91 KB
0644
2022-12-14 08:54:11
oauth.js
file
182 B
0644
2022-12-14 08:54:11
saml.js
file
181 B
0644
2022-12-14 08:54:11
sso.js
file
1.83 KB
0644
2022-12-14 08:54:11