私は自分のサイトにログインしています。私はログイン方法をstackoverflowでやっていますが、Gmailのオプションは1つだけです。 1)ユーザーは彼は、Gmailのユーザー名とパスワード 3を入力する必要があります)gmailの 2としてログインタイプを選択している必要があります)彼が戻ってサイトGmailを使用してサイトにログイン
にredirecredしなければならない私は、この..Anyヘルププラザ
に非常に新しいです私は自分のサイトにログインしています。私はログイン方法をstackoverflowでやっていますが、Gmailのオプションは1つだけです。 1)ユーザーは彼は、Gmailのユーザー名とパスワード 3を入力する必要があります)gmailの 2としてログインタイプを選択している必要があります)彼が戻ってサイトGmailを使用してサイトにログイン
にredirecredしなければならない私は、この..Anyヘルププラザ
に非常に新しいですを参照してください。そのユースケースを考慮してan exampleが利用可能です。あなたを取得し、実行するには
<?php
# Logging in with Google accounts requires setting special identity, so this example shows how to do it.
require 'openid.php';
try {
$openid = new LightOpenID;
if(!$openid->mode) {
if(isset($_GET['login'])) {
$openid->identity = 'https://www.google.com/accounts/o8/id';
header('Location: ' . $openid->authUrl());
}
?>
<form action="?login" method="post">
<button>Login with Google</button>
</form>
<?php
} elseif($openid->mode == 'cancel') {
echo 'User has canceled authentication!';
} else {
echo 'User ' . ($openid->validate() ? $openid->identity . ' has ' : 'has not ') . 'logged in.';
}
} catch(ErrorException $e) {
echo $e->getMessage();
}
は(私はシステムのような* nixのを想定)本当に簡単です:
www
フォルダを持っています。[email protected]:~/www$ wget http://gitorious.org/lightopenid/lightopenid/archive-tarball/master
--2011-02-02 13:21:30-- http://gitorious.org/lightopenid/lightopenid/archive-tarball/master
Resolving gitorious.org... 87.238.52.168
Connecting to gitorious.org|87.238.52.168|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 17104 (17K) [application/x-gzip]
Saving to: `master'
100%[======================================>] 17,104 --.-K/s in 0.04s
2011-02-02 13:21:30 (386 KB/s) - `master' saved [17104/17104]
[email protected]:~/www$ tar xfz master
[email protected]:~/www$ google-chrome http://localhost/lightopenid-lightopenid/example-google.php
Created new window in existing browser session.
ありがとうございます..あなたは完全な簡単な例を与えることができます... –
これは完全な単純な例です;)。あなたはtarballをダウンロードすると、この例を実行することができます=> http://gitorious.org/lightopenid/lightopenid/archive-tarball/master – Alfred
ya私はそれを持っています...しかしログアウトについては..... –
OpenIDによる認証です。読む本http://code.google.com/apis/accounts/docs/OpenID.html
これはLightOpenIDで達成するのは非常に簡単です
以下のリンクで見てみましょう:
http://code.google.com/apis/accounts/docs/OpenID.html
http://remysharp.com/2007/12/21/how-to-integrate-openid-as-your-login-system/
十分に文書化されたソースへの外部参照を含めることはStack Overflowで評価されますが、外部ソースからの最も重要な/関連するスニペットを回答に含めることが重要です。 – mbinette
、このリンク上での呼ばOpenIDを見http://technofriends.in/2008/11/10/what-is-openid-and-how-to-use-gmail-account-as-openid/ –