使用Gmail登录无效 [英] Sign in with gmail is not working

查看:95
本文介绍了使用Gmail登录无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在登录页面上有一个按钮使用Gmail登录



I have a button on my site on Login Page "Login with Gmail"

<asp:Button ID="btnLoginToGoogle" runat="server" OnCommand="OpenLogin_Click" ToolTip="Google_Login"
                                                        CssClass="ch_google_button" CommandArgument="https://www.google.com/accounts/o8/id"
                                                        Width="141px" />







C#代码是:






C# code is :

protected void OpenLogin_Click(object src, CommandEventArgs e)
    {
        try
        {
            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();
        }
        catch (Exception ex) { }
    }







代码正在使用框架3.5

但是当我将它转换为框架4.0

它不起作用。 .....

请解决问题....

Thanx



Stack跟踪






Code is working with framework 3.5
But when i convert it to framework 4.0
it's not working......
Please solve the issue....
Thanx

Stack Trace

((System.Threading.ThreadAbortException)(ex)) {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}

ex.Data Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

ex.HelpLink Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

ex.HResult Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

ex.InnerException Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

ex.Message Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

ex.Source Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

ex.StackTrace Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

ex.TargetSite Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.





For All message is same



For All message is same

推荐答案

这篇关于使用Gmail登录无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆