我在现有Sitefinity站点内实现新的Messenger Connect功能时遇到问题,无法使用Live ID启用客户端登录.
也就是说,当我使用以下代码实现客户端功能时:
<head runat="server">
<script type="text/javascript" src="http://js.live.net/4.1/loader.js"></script>
</head>
<body>
<form runat="server" id="form1">
<asp:ScriptManager ID="ScriptManager1" runat="server"/>
<wl:app
client-id="<%= ConfigurationManager.AppSettings["wl_wrap_client_id"] %>"
scope="WL_Profiles.View"
callback-url="<%= ConfigurationManager.AppSettings["wl_wrap_client_callback"] %>?wl_session_id=<%=SessionId %>"
channel-url="/channel.htm">
</wl:app>
Run Code Online (Sandbox Code Playgroud)
...我在Firebug中遇到三个错误,我无法正确识别:
Sys.ArgumentTypeException:"Sys._Application"类型的对象无法转换为"Sys.IDisposable"类型.参数名称:对象
(在ScriptResource.axd?d = ....第4993行)
Sys.Application._doInitialize不是一个函数
(在MicrosoftAjaxBase.js第1行)
Sys.InvalidOperationException:脚本"MicrosoftAjaxGlobalization.js"已被多次引用.如果显式引用Microsoft AJAX脚本,请将ScriptManager的MicrosoftAjaxMode属性设置为Explicit.
(在ScriptResource.axd?d = ....第984行)
仅当我loader.js从js.live.net 包含脚本时才会触发错误.
编辑:似乎错误不一定按该顺序触发.刷新页面似乎打乱这些错误和/或引入其他的,如Sys.ParameterCountException在ScriptResource.axd?...上线1842,例如.
Windows 8使用Live ID作为用户名.如何在C#中获取此LiveID?
我正在使用LiveID和Google提供商将OpenID集成到我现有的应用程序中.在我的登录页面上,除了原始登录字段之外,我还添加了"使用Google登录"和"使用Microsoft登录"按钮.
我可以成功读取上述两个提供商的AuthenticationResult数据,但是我是按照以下方式完成的...
对于新的登录按钮,我制作了一个返回URL,以便在用户返回时区分它们:
Protected Sub btn_google_Click(sender As Object, e As EventArgs) Handles btn_google.Click
Dim client As New GoogleOpenIdClient
Dim u As New System.Uri("http://www.mytest.com/login.aspx?action=signin&provider=google")
client.RequestAuthentication(New HttpContextWrapper(HttpContext.Current), u)
End Sub
Protected Sub btn_live_Click(sender As Object, e As EventArgs) Handles btn_live.Click
Dim client As New MicrosoftClient("xyz", "12345")
Dim u As New System.Uri("http://www.mytest.com/login.aspx?action=signin&provider=microsoft")
client.RequestAuthentication(New HttpContextWrapper(HttpContext.Current), u)
End Sub
Run Code Online (Sandbox Code Playgroud)
因此,当用户重定向回login.aspx时,我会进行以下检查以处理登录功能:
If Not Page.IsPostBack Then
If Request.QueryString("action") IsNot Nothing AndAlso Request.QueryString("action").Trim = "signin" Then
If Request.QueryString("provider") IsNot Nothing AndAlso Request.QueryString("provider").Trim <> String.Empty Then
Select Case Request.QueryString("provider").Trim …Run Code Online (Sandbox Code Playgroud) liveid ×3
asp.net ×2
.net ×1
asp.net-4.5 ×1
asp.net-ajax ×1
c# ×1
javascript ×1
openid ×1
sitefinity ×1
windows-8 ×1