How to use the openid.assoc_handle function in openid

To help you get started, we’ve selected a few openid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CodeArtemis / TriggerRally / server / node_modules / passport-google / node_modules / passport-openid / node_modules / openid / openid.js View on Github external
{
      params['openid.identity'] = provider.claimedIdentifier;
    }
  }
  else if(provider.version.indexOf('2.0') !== -1)
  {
    params['openid.claimed_id'] = params['openid.identity'] =
      'http://specs.openid.net/auth/2.0/identifier_select';
  }
  else {
    return callback({ message: 'OpenID 1.0/1.1 provider cannot be used without a claimed identifier' });
  }

  if(assoc_handle)
  {
    params['openid.assoc_handle'] = assoc_handle;
  }

  if(returnUrl)
  {
    // Value should be missing if RP does not want
    // user to be sent back
    params['openid.return_to'] = returnUrl;
  }

  if(realm)
  {
    if(provider.version.indexOf('2.0') !== -1) {
      params['openid.realm'] = realm;
    }
    else {
      params['openid.trust_root'] = realm;
github havard / node-openid / openid.js View on Github external
var _checkSignatureUsingAssociation = function(params, callback)
{
  if (!_isDef(params['openid.assoc_handle']))
  {
    return callback({ message: 'No association handle in provider response. Find out whether the provider supports associations and/or use stateless mode.' });
  }
  openid.loadAssociation(params['openid.assoc_handle'], function(error, association)
  {
    if(error)
    {
      return callback({ message: 'Error loading association' }, { authenticated: false });
    }
    if(!association)
    {
      return callback({ message:'Invalid association handle' }, { authenticated: false });
    }
    if(association.provider.version.indexOf('2.0') !== -1 && association.provider.endpoint !== params['openid.op_endpoint'])
    {
      return callback({ message:'Association handle does not match provided endpoint' }, {authenticated: false});
    }
    
    var message = '';
    var signedParams = params['openid.signed'].split(',');
github openlink / virtuoso-opensource / appsrc / ODS-Framework / login.js View on Github external
function lfOpenIdLoginURL(uriParams) {
  var openIdServer       = uriParams['oid-srv'];
  var openIdSig          = uriParams['openid.sig'];
  var openIdIdentity     = uriParams['openid.identity'];
  var openIdAssoc_handle = uriParams['openid.assoc_handle'];
  var openIdSigned       = uriParams['openid.signed'];

  var url = openIdServer + ((openIdServer.lastIndexOf('?') != -1)? '&': '?') +
    'openid.mode=check_authentication' +
    '&openid.assoc_handle=' + encodeURIComponent (openIdAssoc_handle) +
    '&openid.sig='          + encodeURIComponent (openIdSig) +
    '&openid.signed='       + encodeURIComponent (openIdSigned);

  var sig = openIdSigned.split(',');
  for (var i = 0; i < sig.length; i++)
  {
    var _key = sig[i].trim ();
    if (_key != 'mode' &&
        _key != 'signed' &&
        _key != 'assoc_handle')
    {
github openlink / virtuoso-opensource / appsrc / ODS-Framework / nav_framework.js View on Github external
var uriParams=OAT.Dom.uriParams();
    
  if(typeof(uriParams.sid)!='undefined' && uriParams.sid!='')
  {
    self.session.sid=uriParams.sid;
    self.session.validateSid();
  }

  
  if(!self.session.sid && typeof(uriParams['openid.signed'])!='undefined' && uriParams['openid.signed']!='')
  {
    self.session.openId.server=uriParams['oid-srv']
    self.session.openId.sig=uriParams['openid.sig'];
    self.session.openId.identity=uriParams['openid.identity']
    self.session.openId.assoc_handle=uriParams['openid.assoc_handle']
    self.session.openId.signed=uriParams['openid.signed']

    self.session.openIdVerify()
  }

  var cookieSid=this.readCookie('sid');
  if(!self.session.sid && cookieSid)
  {
    self.session.sid=cookieSid;
    self.session.validateSid();
  }
    
     
  
  OAT.Event.attach($('vspxApp'),"load",function(){self.wait('hide');});
github CodeArtemis / TriggerRally / server / node_modules / passport-google / node_modules / passport-openid / node_modules / openid / openid.js View on Github external
var _checkSignatureUsingAssociation = function(params, callback)
{
  openid.loadAssociation(params['openid.assoc_handle'], function(error, association)
  {
    if(error)
    {
      return callback({ message: 'Error loading association' }, { authenticated: false });
    }
    if(!association)
    {
      return callback({ message:'Invalid association handle' }, { authenticated: false });
    }
    if(association.provider.version.indexOf('2.0') !== -1 && association.provider.endpoint !== params['openid.op_endpoint'])
    {
      return callback({ message:'Association handle does not match provided endpoint' }, {authenticated: false});
    }
    
    var message = '';
    var signedParams = params['openid.signed'].split(',');
github charliecalvert / JsObjects / JavaScript / Authenticate / OpenId02 / server01.js View on Github external
relyingParty.verifyAssertion(request, function(error, result) {
        var isGood = !error &amp;&amp; result.authenticated ? '<h1>Success!</h1>' : '<h1>Failed</h1>';
        res.writeHead(200, {
            'Content-Type': 'text/html'
        });
        res.write(isGood);
        res.write('<p>' + query['openid.assoc_handle'] + '</p>');
        res.write('<p>' + query['openid.claimed_id'] + '</p>');
        res.write('<p>' + query['openid.identity'] + '</p>');
        res.write('<p>' + query['openid.mode'] + '</p>');
        res.write('<p>' + query['openid.ns'] + '</p>');
        res.write('<p>' + query['openid.op_endpoint'] + '</p>');
        res.write('<p>' + query['openid.response_nonce'] + '</p>');
        res.write('<p>' + query['openid.return_to'] + '</p>');
        res.write('<p>' + query['openid.sig'] + '</p>');
        res.write('<p>' + query['openid.signed'] + '</p>');
        res.end('bye');
    });
});
github sandiz / rs-manager / src / preload.js View on Github external
const sls = await window.remote.session.defaultSession.cookies.get({
                            name: 'steamLoginSecure',
                            domain: 'store.steampowered.com'
                        })
                        const sid = await window.remote.session.defaultSession.cookies.get({
                            name: 'sessionid',
                        })
                        const cookie = sls[0].value
                        const cookieSess = sid[0].value
                        authWindow.removeAllListeners('closed');
                        setImmediate(function () {
                            authWindow.close();
                        });
                        resolve({
                            response_nonce: query['openid.response_nonce'],
                            assoc_handle: query['openid.assoc_handle'],
                            identity: query['openid.identity'],
                            steam_id: query['openid.identity'].match(/\/id\/(.*$)/)[1],
                            sig: query['openid.sig'],
                            cookie,
                            cookieSess,
                        });
                    }
                }
github havard / node-openid / openid.js View on Github external
var _checkSignatureUsingAssociation = function(params, callback)
{
  if (!_isDef(params['openid.assoc_handle']))
  {
    return callback({ message: 'No association handle in provider response. Find out whether the provider supports associations and/or use stateless mode.' });
  }
  openid.loadAssociation(params['openid.assoc_handle'], function(error, association)
  {
    if(error)
    {
      return callback({ message: 'Error loading association' }, { authenticated: false });
    }
    if(!association)
    {
      return callback({ message:'Invalid association handle' }, { authenticated: false });
    }
    if(association.provider.version.indexOf('2.0') !== -1 && association.provider.endpoint !== params['openid.op_endpoint'])
    {
      return callback({ message:'Association handle does not match provided endpoint' }, {authenticated: false});