私は自分のウェブサイトでgoogleとの認証+認証にDNOAを使用しています。私は、ローカルホスト上で実行するとDNOA OpenID + GoogleからlocalhostとパブリックサイトへのOAuthが失敗する
http://ugi-2.apphb.com/Authentication.htm
は、私は、コードのこの部分からこのエラー
return_to 'http://localhost:8976/Register/Login' not under realm 'http://anonymous/'.
を得る:
private void HandleAuthNullResponse(IAuthenticationResponse authResponse)
{
// Google requires that the realm and consumer key be equal,
// so we constrain the realm to match the realm in the web.config file.
// This does mean that the return_to URL must also fall under the key,
// which means this sample will only work on a public web site
// that is properly registered with Google.
// We will customize the realm to use http or https based on what the
// return_to URL will be (which will be this page).
var consumer = new WebConsumer(GoogleConsumerHelper.ServiceDescription, mConsumerTokenManager);
//Realm realm = "http://localhost:8976/";
Realm realm = System.Web.HttpContext.Current.Request.Url.Scheme + Uri.SchemeDelimiter + consumer.ConsumerKey + "/";
IAuthenticationRequest authReq = GoogleConsumerHelper.RelyingParty.CreateRequest(GoogleConsumerHelper.GoogleOPIdentifier, realm);
エラーがDNOA
でコメントしているものを何とか収まる
localhostで動作する他のコードを見ていると変だったはるかに構造化されていません。
私は、Googleのサイトやのこぎりになっ:
Webアプリケーションを登録する
登録の3つのレベルがあります。
未登録のは:アプリケーションは、Googleが認識されません。アクセス リクエストページでは、ユーザーにアプリケーションのアクセスを許可または拒否するかどうかを尋ねるメッセージが表示されます。 「このウェブサイトはGoogleに登録されていません。この目的地。登録
:...強化されたセキュリティに登録
- :...
登録は任意ですが、お勧めです。 ...私もappHarborに公開しようとしましたが、それは助けにはならなかった
がどのように私はこれをうまくすることができます(まだログインしていませんか)?
@Andrew Arnott、何か考えていますか? –