代码之家  ›  专栏  ›  技术社区  ›  Sky Sanders

dotnetopenauth asp.net mvc2项目模板-从运行时损坏localhost:xxxx

  •  1
  • Sky Sanders  · 技术社区  · 14 年前

    http://localhost:18916/Auth/PopUpReturnTo?dnoa.uipopup=1&dnoa.popupUISupported=1&index=0&dnoa.userSuppliedIdentifier=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid&dnoa.op_endpoint=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fud&dnoa.claimed_id=&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.mode=id_res&openid.op_endpoint=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fud&openid.response_nonce=2010-07-24T18%3A06%3A36ZcustWWIY5CfXTQ&openid.return_to=http%3A%2F%2Flocalhost%3A18916%2FAuth%2FPopUpReturnTo%3Fdnoa.uipopup%3D1%26dnoa.popupUISupported%3D1%26index%3D0%26dnoa.userSuppliedIdentifier%3Dhttps%253A%252F%252Fwww.google.com%252Faccounts%252Fo8%252Fid%26dnoa.op_endpoint%3Dhttps%253A%252F%252Fwww.google.com%252Faccounts%252Fo8%252Fud%26dnoa.claimed_id%3D&openid.assoc_handle=AOQobUdkpLPAPC1LRQKPaQcy2UlG8R4pjWmpDCSV_1odtA33o_HfNleiMi9ZjX8RU-kIIJnJ&openid.signed=op_endpoint%2Cclaimed_id%2Cidentity%2Creturn_to%2Cresponse_nonce%2Cassoc_handle%2Cns.ext1%2Cext1.mode%2Cext1.type.alias3%2Cext1.value.alias3%2Cext1.type.alias1%2Cext1.value.alias1&openid.sig=zkBfpugK7xT0da49hZLNQZz4Xn83UiZB%2BhEHz6B37Cw%3D&openid.identity=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3DAItOawk3FGqct35R7wya-0Bkq-0_Qnc1AB-YSw4&openid.claimed_id=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3DAItOawk3FGqct35R7wya-0Bkq-0_Qnc1AB-YSw4&openid.ns.ext1=http%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0&openid.ext1.mode=fetch_response&openid.ext1.type.alias3=http%3A%2F%2Fschema.openid.net%2Fcontact%2Femail&openid.ext1.value.alias3=sky.sanders%40gmail.com&openid.ext1.type.alias1=http%3A%2F%2Faxschema.org%2Fcontact%2Femail&openid.ext1.value.alias1=sky.sanders%40gmail.com&openid.ns.ext2=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Fui%2F1.0&openid.ext2.mode=popup
    
    

    [object Error] .

    “入门”说我所要做的就是建立数据库,然后我就可以开始了。

    这看起来不太好。如果有其他标准使样品工作,他们应该被宣布。

    cassinidev )?

    2 回复  |  直到 14 年前
        1
  •  1
  •   Andrew Arnott    14 年前

        2
  •  1
  •   Chase Florell    14 年前

    我使用的是你之前给我的身份验证方法,这是我的控制器身份验证代码

        <ValidateInput(False)> _
        Public Function Authenticate(ByVal returnUrl As String) As ActionResult
            Dim response = openid.GetResponse()
            If response Is Nothing Then
                ' Stage 2: user submitting Identifier
                Dim id As Identifier
    
                If Identifier.TryParse(Request.Form("openid_identifier"), id) Then
    
                    Try
                        Return openid.CreateRequest(Request.Form("openid_identifier")).RedirectingResponse.AsActionResult()
                    Catch ex As ProtocolException
                        ViewData("Message") = ex.Message
                        Return View("Login")
                    End Try
    
                Else
    
                    ViewData("Message") = "Invalid identifier"
                    Return View("Login")
                End If
            Else
                ' Stage 3: OpenID Provider sending assertion response
                Select Case response.Status
                    Case AuthenticationStatus.Authenticated
    
                        If Not OpenIDService.IsOpenIdAssociated(response.ClaimedIdentifier) Then
                            UserService.AddUser(response.ClaimedIdentifier, response.FriendlyIdentifierForDisplay)
                            UserService.SubmitChanges()
    
                            ActivityLogService.AddActivity(OpenIDService.GetOpenId(response.ClaimedIdentifier).UserID, _
                                                               Utilities.ActivityLog.LogType.UserAdded, _
                                                               HttpContext.Request.UserHostAddress)
    
                        Else
                            ActivityLogService.AddActivity(OpenIDService.GetOpenId(response.ClaimedIdentifier).UserID, _
                                                               Utilities.ActivityLog.LogType.UserLogin, _
                                                               HttpContext.Request.UserHostAddress)
                        End If
                        ActivityLogService.SubmitChanges()
    
    
                        ' Create the authentication cookie.  This cookie
                        ' includes the AuthUserData information in the
                        ' userData field of the FormsAuthentication Cookie.
                        Dim authUser As Authentication.AuthUserData = New Authentication.AuthUserData(OpenIDService.GetOpenId(response.ClaimedIdentifier).User)
                        HttpContext.Response.Cookies.Add(Authentication.CustomAuthentication.CreateAuthCookie(response.ClaimedIdentifier, _
                                                                                                                                      authUser, _
                                                                                                                                      True))
                        authUser = Nothing
    
                        If Not String.IsNullOrEmpty(returnUrl) Then : Return Redirect(returnUrl)
                        Else : Return RedirectToAction("Index", "Events")
                        End If
    
                    Case AuthenticationStatus.Canceled
                        ViewData("Message") = "Canceled at provider"
                        Return View("Login")
    
                    Case AuthenticationStatus.Failed
                        ViewData("Message") = response.Exception.Message
                        Return View("Login")
    
                End Select
            End If
            Return New EmptyResult()
        End Function
    

    Users 我还有一个 OpenIDs 带有 UserID 现场。OpenIds表允许每个用户拥有无限数量的openid。

    推荐文章