Note that there are some explanatory texts on larger screens.

plurals
  1. POOAuth2.0 issue in google response
    primarykey
    data
    text
    <p>I am having an issue regarding openid , I am not getting full information from google, after authentication check. I need full response from google. I am getting Blank Value. Please try to solve asap.</p> <p>my code is -</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Xml; using System.Xml.XPath; using DotNetOpenAuth.OpenId; using DotNetOpenAuth.OpenId.RelyingParty; using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration; using DotNetOpenAuth.OpenId.Extensions.AttributeExchange; public partial class geocode : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { HandleOpenIDProviderResponse(); } protected void Button1_Click(object sender, EventArgs e) { string geoValue = GetLongitudeAndLatitude(TextBox1.Text, "false"); Label1.Text = geoValue; } public string GetLongitudeAndLatitude(string address, string sensor) { string urlAddress = "http://maps.googleapis.com/maps/api/geocode/xml?address=" + HttpUtility.UrlEncode(address) + "&amp;sensor=" + sensor; string returnValue = ""; try { XmlDocument objXmlDocument = new XmlDocument(); objXmlDocument.Load(urlAddress); XmlNodeList objXmlNodeList = objXmlDocument.SelectNodes("/GeocodeResponse/result/geometry/location"); foreach (XmlNode objXmlNode in objXmlNodeList) { // GET LONGITUDE returnValue = objXmlNode.ChildNodes.Item(0).InnerText; // GET LATITUDE returnValue += "," + objXmlNode.ChildNodes.Item(1).InnerText; } } catch { // Process an error action here if needed } return returnValue; } OpenIdRelyingParty openid = new OpenIdRelyingParty(); protected void HandleOpenIDProviderResponse() { var response = openid.GetResponse(); if (response != null) { switch (response.Status) { case AuthenticationStatus.Authenticated: // NotLoggedIn.Visible = false; btngmaillogout.Visible = true; var fetchResponse = response.GetExtension&lt;FetchResponse&gt;(); Session["FetchResponse"] = fetchResponse; var response2 = Session["FetchResponse"] as FetchResponse; Label2.Text = response2.GetAttributeValue(WellKnownAttributes.Contact.Email); Label3.Text = GetFullname(response2.GetAttributeValue(WellKnownAttributes.Name.First), response2.GetAttributeValue(WellKnownAttributes.Name.Last)); Label4.Text = response2.GetAttributeValue(WellKnownAttributes.BirthDate.WholeBirthDate); Label5.Text = response2.GetAttributeValue(WellKnownAttributes.Contact.Phone.Mobile); Label6.Text = response2.GetAttributeValue(WellKnownAttributes.Person.Gender); break; case AuthenticationStatus.Canceled: Label1.Text = "Cancelled."; break; case AuthenticationStatus.Failed: Label1.Text = "Login Failed."; break; } } else { return; } } protected void OpenLogin_Click(object src, CommandEventArgs e) { string discoveryUri = e.CommandArgument.ToString(); var b = new UriBuilder(Request.Url) { Query = "" }; var req = openid.CreateRequest(discoveryUri, b.Uri, b.Uri); var fetchRequest = new FetchRequest(); fetchRequest.Attributes.AddRequired(WellKnownAttributes.Contact.Email); fetchRequest.Attributes.AddRequired(WellKnownAttributes.Name.First); fetchRequest.Attributes.AddRequired(WellKnownAttributes.Name.Last); fetchRequest.Attributes.AddRequired(WellKnownAttributes.Person.Gender); fetchRequest.Attributes.AddRequired(WellKnownAttributes.Contact.Phone.Mobile); fetchRequest.Attributes.AddRequired(WellKnownAttributes.BirthDate.WholeBirthDate); req.AddExtension(fetchRequest); req.RedirectToProvider(); } private static string GetFullname(string first, string last) { var _first = first ?? ""; var _last = last ?? ""; if (string.IsNullOrEmpty(_first) || string.IsNullOrEmpty(_last)) return ""; return _first + " " + _last; } protected void btngmaillogout_click(object sender, EventArgs e) { // logout from gmail and return to website default/home page Response.Redirect("successlogout.aspx"); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload