0

I am using LightOpenId which basically combines OpenID and OAuth1.0.

The approval works fine, however, my customers need to approve every single time. I would like OpenID to realise, that the customer already approved (basically utilizing the checkbox "remember this approval") and go through without showing the approving mask again.

How can this be done?

Thanks, Christian

4

1 回答 1

0

我在我的应用程序中忽略了这个问题一段时间,几乎错过了你的解决方案,因为它在评论中。

可以在处理程序的第一部分应用“修复”,而无需实际修改 LightOpenId 代码,因此:

  $mysiteurl = 'https://my.site.url/'; // note trailing '/' included

  $openid = new LightOpenID($mysiteurl); // <- the trailing '/' onwards is stripped internally
  if (!$openid->mode) {
      $openid->required = array(
        'namePerson/first',
        'namePerson/last'
         // etc...
      );
      // redirects to google openid provider
      $openid->identity = 'https://www.google.com/accounts/o8/id';
      $openid->realm = $mysiteurl; // <- ADD THIS LINE - resets realm with the trailing '/'
      header('Location: ' . $openid->authUrl());
      return;

  } elseif ($openid->mode == 'cancel') {
    header('Location: '. $mysiteurl.'cancelled.php');
    return;

  } elseif (!$openid->validate()) {
    header('Location: '. $mysiteurl.'failed.php');
    return;
  }

  header('Location: '. $mysiteurl.'success.php');
  return;
于 2013-04-27T16:49:11.750 回答