I am using DotNetOpenID dll to register my sample application through gmail authentication via C # .net
which i used was
protected void Page_Load(object sender, EventArgs e) { OpenIdRelyingParty rp = new OpenIdRelyingParty(); var r = rp.GetResponse(); if (r != null) { switch (r.Status) { case AuthenticationStatus.Authenticated: NotLoggedIn.Visible = false; Session["GoogleIdentifier"] = r.ClaimedIdentifier.ToString(); Response.Redirect("About.aspx"); //redirect to main page of your website break; case AuthenticationStatus.Canceled: lblAlertMsg.Text = "Cancelled."; break; case AuthenticationStatus.Failed: lblAlertMsg.Text = "Login Failed."; break; } } } protected void OpenLogin_Click(object src, CommandEventArgs e) { string discoveryUri = e.CommandArgument.ToString(); OpenIdRelyingParty openid = new OpenIdRelyingParty(); var b = new UriBuilder(Request.Url) { Query = "" }; var req = openid.CreateRequest(discoveryUri, b.Uri, b.Uri); req.RedirectToProvider(); }
It works well when I press the gmail login button, it goes to the gmail page and authenticates as needed.
but my problem is: Authentication Status. Authenticated status was unsuccessful after authentication always, although I give the correct gmail account username and password
Waiting for a valuable response and comments.
source share