を使用してOpenIDプロバイダからの電子メールアドレスを取得し、私は次のメッセージが出ます:私はStackOverflowのはグーグルを使用してサインインすると受け付けを開始OpenIDのライブラリ
Stackoverflow.comは、Googleアカウントの例@ gmailのからいくつかの情報を求めているが。メールアドレス•COM
しかし、私はOpenIDを使ってログイン自分のサイト上で私は、電子メールアドレスを求めることはできません。代わりに、私はこのメッセージが表示されます。
あなたは、私もそれが困難な私がする必要がどのようなステップで理解するために見つけていますGoogleアカウント[email protected]
でexample.comにサインインされています電子メールアドレスを要求してください。それはとても明らかであるようにこれはそうです...しかし、私はそれをグーグルで苦労してとするコードをコーミングしてい
/**
* Authenticates the given OpenId identity.
* Defined by Zend_Auth_Adapter_Interface.
*
* @throws Zend_Auth_Adapter_Exception If answering the authentication query is impossible
* @return Zend_Auth_Result
*/
public function authenticate() {
$id = $this->_id;
$consumer = new Auth_OpenID_Consumer($this->_storage);
if (!empty($id)) {
$authRequest = $consumer->begin($id);
if (is_null($authRequest)) {
return new Zend_Auth_Result(
Zend_Auth_Result::FAILURE,
$id,
array("Authentication failed", 'Unknown error')
);
}
if (Auth_OpenID::isFailure($authRequest)) {
return new Zend_Auth_Result(
Zend_Auth_Result::FAILURE,
$id,
array("Authentication failed", "Could not redirect to server: " . $authRequest->message)
);
}
$redirectUrl = $authRequest->redirectUrl($this->_root, $this->_returnTo);
if (Auth_OpenID::isFailure($redirectUrl)) {
return new Zend_Auth_Result(
Zend_Auth_Result::FAILURE,
$id,
array("Authentication failed", $redirectUrl->message)
);
}
Zend_OpenId::redirect($redirectUrl);
} else {
$response = $consumer->complete(Zend_OpenId::selfUrl());
switch($response->status) {
case Auth_OpenID_CANCEL:
case Auth_OpenID_FAILURE:
return new Zend_Auth_Result(
Zend_Auth_Result::FAILURE,
null,
array("Authentication failed. " . @$response->message)
);
break;
case Auth_OpenID_SUCCESS:
return $this->_constructSuccessfulResult($response);
break;
}
}
}
:ここで私はステップはに組み込まれるべきだと思うコードがありますそれを理解する。どんな助けでも大歓迎です!