views:

224

answers:

2

So I create a new dnoa mvc2 site from the template, run setup.aspx without issue, login and authorize my openid - all ok, but on the redirect to

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

all i get is an alert [object Error].

The 'getting started' says that all I have to do is get the database set up and I would be good to go.

This does not seem good to go. If there are other criteria to getting the sample working they should be declared.

In any case, what is required to get this running on localhost:xxx (cassini/cassinidev)?

+1  A: 

Hey @code poet

I'm using that method you gave me before for my authentication, and here is my Controller Authentication Code

    <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

I have a custom table in my database called Users and I also have an OpenIDs table with a UserID field. The OpenIds table allows me to have an unlimited number of OpenIds per user.

All of this works both locally for me as well as on the production server and staging server.

rockinthesixstring
PS: I didn't use any "startup" code that came with the download... I just implemented everything manually... quite painless actually.
rockinthesixstring
thanks dude. one hand washes the other.
Sky Sanders
+1  A: 

What you're seeing is due to a bug in IE8 having to do with crossing trust zones (from Local Computer/Intranet to Internet Zone). If you use a non-IE browser it will work. When you publish your web site on the Internet, IE8 will work fine because it doesn't cross into the Intranet zone during login.

Andrew Arnott
thanks for that. problem is that in non-ie browsers, visual studio javascript debugging is not available. What about IE7 compatibility mode? ( i know i can just check but would like an answer here for the edification of the x,xxx number of people who may run into this)
Sky Sanders
I don't seem to be experiencing the same issue with IE8 in my implementation at all. Everything works exactly as expected.
rockinthesixstring
@rock - because you coded the problem to death. ;-)
Sky Sanders
that code was actually taken straight out of one of the examples.
rockinthesixstring
@rock - cool. Andrew, spot on. And, no, IE7 compat mode is no better. Although you may wish to view your popup in IE7, the provider divs are stacked resulting in a scrolling popup.
Sky Sanders
Ya, I haven't nailed down the HTML such that it *always* works across all browsers. And @rock, the code in your sample code works fine. It's the javascript on the client that makes the popup window work that malfunctions. If you're not using iframes or popups, this issue doesn't ever come up.
Andrew Arnott