How to use the openid.return_to 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
'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;
    }
  }
  else if(!returnUrl)
  {
    return callback({ message: 'No return URL or realm specified' });
  }
github havard / node-openid / openid.js View on Github external
var _verifyReturnUrl = function (assertionUrl, originalReturnUrl) {
  var receivedReturnUrl = assertionUrl.query['openid.return_to'];
  if (!_isDef(receivedReturnUrl)) {
    return false;
  }

  receivedReturnUrl = url.parse(receivedReturnUrl, true);
  if (!receivedReturnUrl) {
    return false;
  }
  originalReturnUrl = url.parse(originalReturnUrl, true);
  if (!originalReturnUrl) {
    return false;
  }

  if (originalReturnUrl.protocol !== receivedReturnUrl.protocol || // Verify scheme against original return URL
      originalReturnUrl.host !== receivedReturnUrl.host || // Verify authority against original return URL
      originalReturnUrl.pathname !== receivedReturnUrl.pathname) { // Verify path against current request URL
github havard / node-openid / openid.js View on Github external
'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;
    }
  }
  else if(!returnUrl)
  {
    return callback({ message: 'No return URL or realm specified' });
  }
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');
    });
});