ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Login with Facebook and Google Error: Invalid verification code format<p>Hi <a class="username" rel="sagar@saga">sagar@saga</a>,</p> <p>Please share the error details.</p>https://www.aspforums.net:443/Threads/735183/Login-with-Facebook-and-Google-Error-Invalid-verification-code-format/https://www.aspforums.net:443/Threads/735183/Login-with-Facebook-and-Google-Error-Invalid-verification-code-format/Thu, 14 Dec 2017 05:15:53 GMTLogin with Facebook and Google Error: Invalid verification code format<p>I am also looking for similar thing for my site,<strong>&nbsp;<a href="https://hamarigossip.com">https://hamarigossip.com</a></strong></p> <p>Please let me know what code shall i use.</p> <p>I am newbie on this, so i will appreciate your help.</p> <p>Thanks</p>https://www.aspforums.net:443/Threads/735183/Login-with-Facebook-and-Google-Error-Invalid-verification-code-format/https://www.aspforums.net:443/Threads/735183/Login-with-Facebook-and-Google-Error-Invalid-verification-code-format/Thu, 14 Dec 2017 14:59:25 GMTLogin with Facebook and Google Error: Invalid verification code format<p>&nbsp;</p> <pre class="brush: csharp">///////////THIS IS MY C# CODE /////////////////////////// using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using ASPSnippets.FaceBookAPI; using System.Web.Script.Serialization; using ASPSnippets.GoogleAPI; using System.Data; using System.Data.SqlClient; using System.Configuration; using System.Web.Services; using System.Web.Script.Services; public partial class new_registration2 : System.Web.UI.Page { SqlConnection conn, CONN; SqlDataReader dr; SqlCommand cmd, CMD; protected void Page_Load(object sender, EventArgs e) { GoogleConnect.ClientId = &#34;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&#34;; GoogleConnect.ClientSecret = &#34;XXXXXXXXXXXXXXXXXXXXXXXXXXXX&#34;; GoogleConnect.RedirectUri = Request.Url.AbsoluteUri.Split(&#39;?&#39;)[0]; if (!string.IsNullOrEmpty(Request.QueryString[&#34;code&#34;])) { string code = Request.QueryString[&#34;code&#34;]; string json = GoogleConnect.Fetch(&#34;me&#34;, code); GoogleProfile profile = new JavaScriptSerializer().Deserialize&lt;GoogleProfile&gt;(json); lblId.Text = profile.Id; lblName.Text = profile.DisplayName; lblEmail.Text = profile.Emails.Find(email =&gt; email.Type == &#34;account&#34;).Value; lblGender.Text = profile.Gender; lblType.Text = profile.ObjectType; ProfileImage.ImageUrl = profile.Image.Url; pnlProfile.Visible = true; btnLogin.Enabled = false; try { string cs = &#34;Data Source=XXXXX;Initial Catalog=XXXXXX;User Id=sa;Password=XXXXXXX;&#34;; CONN = new SqlConnection(cs); CMD = new SqlCommand(&#34;INSERT INTO Users(Username,Password) VALUES(&#39;&#34; + lblId.Text + &#34;&#39;,&#39;&#34; + lblName.Text + &#34;&#39;)&#34;, CONN); CMD.Connection = CONN; CONN.Open(); CMD.ExecuteNonQuery(); CONN.Close(); div3.Attributes[&#34;class&#34;] = &#34;show&#34;; Label15.Text = &#34;Congratulation You Are Succesfully Registered&#34;; } catch (SqlException ee) { div3.Attributes[&#34;class&#34;] = &#34;show&#34;; Label15.Text = ee.Message + &#34;&#34;; CONN.Close(); } catch (NullReferenceException w) { div3.Attributes[&#34;class&#34;] = &#34;show&#34;; Label15.Text = w.Message + &#34;&#34;; CONN.Close(); } catch (ArgumentException eee) { div3.Attributes[&#34;class&#34;] = &#34;show&#34;; Label15.Text = eee.Message + &#34;&#34;; } } if (Request.QueryString[&#34;error&#34;] == &#34;access_denied&#34;) { ClientScript.RegisterClientScriptBlock(this.GetType(), &#34;alert&#34;, &#34;alert(&#39;Access denied.&#39;)&#34;, true); } FaceBookConnect.API_Key = &#34;XXXXXXXXXXXXXXXXXXXXXXXXXX&#34;; FaceBookConnect.API_Secret = &#34;XXXXXXXXXXXXXXXXXXXXXXXXXXXX&#34;; if (!IsPostBack) { if (Request.QueryString[&#34;error&#34;] == &#34;access_denied&#34;) { ClientScript.RegisterStartupScript(this.GetType(), &#34;alert&#34;, &#34;alert(&#39;User has denied access.&#39;)&#34;, true); return; } string code = Request.QueryString[&#34;code&#34;]; if (!string.IsNullOrEmpty(code)) { string data = FaceBookConnect.Fetch(code, &#34;me?fields=id,name,email&#34;); FaceBookUser faceBookUser = new JavaScriptSerializer().Deserialize&lt;FaceBookUser&gt;(data); faceBookUser.PictureUrl = string.Format(&#34;https://graph.facebook.com/{0}/picture&#34;, faceBookUser.Id); pnlFaceBookUser.Visible = true; Label1.Text = faceBookUser.Id; lblUserName.Text = faceBookUser.UserName; Label2.Text = faceBookUser.Name; Label3.Text = faceBookUser.Email; Image1.ImageUrl = faceBookUser.PictureUrl; btnLogin.Enabled = false; } } } protected void Login(object sender, EventArgs e) { GoogleConnect.Authorize(&#34;profile&#34;, &#34;email&#34;); Label17.Text = &#34;1&#34;; } protected void Clear(object sender, EventArgs e) { GoogleConnect.Clear(Request.QueryString[&#34;code&#34;]); } public class GoogleProfile { public string Id { get; set; } public string DisplayName { get; set; } public Image Image { get; set; } public List&lt;Email&gt; Emails { get; set; } public string Gender { get; set; } public string ObjectType { get; set; } } public class Email { public string Value { get; set; } public string Type { get; set; } } public class Image { public string Url { get; set; } } public class FaceBookUser { public string Id { get; set; } public string Name { get; set; } public string UserName { get; set; } public string PictureUrl { get; set; } public string Email { get; set; } } protected void Login2(object sender, EventArgs e) { FaceBookConnect.Authorize(&#34;user_photos,email&#34;, Request.Url.AbsoluteUri.Split(&#39;?&#39;)[0]); } }</pre> <p>when i envoke "login2" that is "login with facebook" it gives error on line</p> <pre><font color="red">Line 32: string json = GoogleConnect.Fetch("me", code); </font></pre> <p><font color="red">saying:</font></p> <h2><em>Cannot convert object of type 'System.String' to type '?2?.?3?.?5?'</em></h2> <p><em>and when i envoke "login" that is "login with google" it give error on line</em></p> <pre><font color="red">Line 99: string data = FaceBookConnect.Fetch(code, "me?fields=id,name,email"); </font></pre> <p><font color="red">saying:&nbsp;</font></p> <h2><em>Code: 100 Message: Invalid verification code format.</em></h2> <p><em>But when i use both code that is "login with google"&nbsp; and&nbsp; "login with facebook" on different page it works fine and on same page it provides error&nbsp;</em></p> <p><em>will i have to give html code?</em></p> <p><em>Please help me</em></p> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/735183/Login-with-Facebook-and-Google-Error-Invalid-verification-code-format/https://www.aspforums.net:443/Threads/735183/Login-with-Facebook-and-Google-Error-Invalid-verification-code-format/Thu, 14 Dec 2017 22:33:47 GMTLogin with Facebook and Google Error: Invalid verification code format<p>Hi <a class="username" rel="sagar@saga"> sagar@saga</a>,</p> <p>You cannot use both the code in same page. Comment one and try and let us know.</p>https://www.aspforums.net:443/Threads/735183/Login-with-Facebook-and-Google-Error-Invalid-verification-code-format/https://www.aspforums.net:443/Threads/735183/Login-with-Facebook-and-Google-Error-Invalid-verification-code-format/Fri, 15 Dec 2017 04:33:34 GMTLogin with Facebook and Google Error: Invalid verification code format<p>By commenting one it works fine, but in many sites there is option for both "sign up with google" and "sign up with facebook" i wonder how?</p> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/735183/Login-with-Facebook-and-Google-Error-Invalid-verification-code-format/https://www.aspforums.net:443/Threads/735183/Login-with-Facebook-and-Google-Error-Invalid-verification-code-format/Fri, 15 Dec 2017 05:27:26 GMTLogin with Facebook and Google Error: Invalid verification code format<p>Currently this is not possible to use both in the same page.</p>https://www.aspforums.net:443/Threads/735183/Login-with-Facebook-and-Google-Error-Invalid-verification-code-format/https://www.aspforums.net:443/Threads/735183/Login-with-Facebook-and-Google-Error-Invalid-verification-code-format/Fri, 15 Dec 2017 06:19:55 GMT