$51 GRAYBYTE WORDPRESS FILE MANAGER $94

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/lib/auth/

HOME
Current File : /opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/lib/auth//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: '[email protected]',
      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)
    }
  })
}


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2024 10.42 PM
root / root
0755
legacy.js
1.911 KB
28 Sep 2021 11.28 AM
root / root
0644
oauth.js
0.178 KB
28 Sep 2021 11.28 AM
root / root
0644
saml.js
0.177 KB
28 Sep 2021 11.28 AM
root / root
0644
sso.js
1.833 KB
28 Sep 2021 11.28 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF