私は実際に私の問題の解決策を見つけました、そして驚くべきことに、それは非常に簡単でした。私はまだXRDSとYadisを理解していませんが、私はそれをとても簡単に活用しています。
あなたが望むもの、そしてあなたが探しているのは、OpenIDの「リレーパーティー」を行うためのコードです。それは、OpenIDプロバイダーの消費者としての「あなた」です。OpenIDエンドポイントを入力すると、出来上がり、OpenIDがサイトで有効になります。このコードは、実際にそれを示しています。
// using DotNetOpenAuth
var openid = new OpenIdRelyingParty();
var response = openid.GetResponse();
if (response == null)
{
// Google account end point (works fine)
var googleID = "https://www.google.com/accounts/o8/id";
// Google hosted account end point
// https://www.google.com/accounts/o8/site-xrds?hd=mydomain.com
// I was unable to test this, but I was running my RP (this code)
// from localhost and it's quite possible that a hosted account RP
// has to return to the same domain.
// It went fine, but crashed with a "Unable to resolve mydomain.com" error
// once I logged in.
openid.CreateRequest(googleID).RedirectToProvider();
}
else
{
switch (response.Status)
{
case AuthenticationStatus.Authenticated:
// Success
// to allow persistance across sessions
// you'll have to track the "claimed identifier"
// some OpenID providers allow you to get an email address through
// extensions but this is not always possible.
// the claimed identifier is typically your safest bet
// and it's a big URL which uniquely identifies the guest
// as a specific user, however, you know very little about this user
// which is a good thing becuase you don't have to give out personal or
// sensitive information to start using a service.
break;
default:
// Something went wrong, check Status property
break;
}
}
これを理解していると、すべてのスペックから印象を受けました。私は自分の「OpenIDプロバイダー」をホストすることになっていたので、アカウントやプロセスの一部を処理することになっているように聞こえました。実際、私がしなければならなかったのはこれだけでした。
そのURLをリクエストするか、それに応じてOpenIDリクエストを受け取った場合。そのリクエストに有効なログイン情報が含まれているかどうかを確認してください。