DotNetOpenAuth receives email and redirects the problem

I am trying to configure DotNetOpenAuth using OpenIdAjaxTextBox, but I have two problems.

  • I want to get the email address of users, and I think it was done in the loggedin event (right?), But this event never gets called, I tried to set a breakpoint there, but I never get to it.

  • when I type openid provider in OpenIdAjaxTextBox (say Gmail), I get a text box login button, so I click on it, new windows open and displays the Gmail login form, but after that I enter my username and password and click " Login "so that the pop-up is updated and my own site loads in this pop-up, I expect the pop-up to close after I log in, not redirecting me to my site.

here is the code i use

<%@ Register Assembly="DotNetOpenAuth" Namespace="DotNetOpenAuth.OpenId.RelyingParty" TagPrefix="openid" %> <openid:OpenIdAjaxTextBox ID="OpenIdAjaxTextBox1" runat="server" OnLoggingIn="openIdtxtbx_LoggingIn" OnLoggedIn="openIdtxtbx_LoggedIn" OnClientAssertionReceived="onauthenticated(sender)" OnUnconfirmedPositiveAssertion="openIdtxtbx_UnconfirmedPositiveAssertion" /> Protected Sub openIdtxtbx_LoggedIn(ByVal sender As Object, ByVal e As OpenIdEventArgs) ' Do something here Dim claimedId As String = e.Response.Status End Sub Protected Sub openIdtxtbx_LoggingIn(ByVal sender As Object, ByVal e As OpenIdEventArgs) ' Retrieve the email address of the user Dim c As New ClaimsRequest c.Email = DemandLevel.Require e.Request.AddExtension(c) End Sub Protected Sub openIdtxtbx_UnconfirmedPositiveAssertion(ByVal sender As Object, ByVal e As OpenIdEventArgs) ' This is where we register extensions that we want to have available in javascript ' on the browser. OpenIdAjaxTextBox1.RegisterClientScriptExtension(Of ClaimsResponse)("sreg") End Sub 
+1
source share
1 answer

The OpenIdAjaxTextBox.LoggedIn event OpenIdAjaxTextBox.LoggedIn not OpenIdAjaxTextBox.LoggedIn until a OpenIdAjaxTextBox.LoggedIn from a web page has been completed. The Login button in the text field itself is not a postback, so you need to add another send page to the page.

e.Response.Status not a declared identifier. You must modify the LoggedIn event handler as follows:

 Dim claimedId As String = e.ClaimedIdentifier 

You will not receive an email address from Google using ClaimsRequest unless you use the AXFetchAsSregTransform behavior.

updated : Finally, that the popup does not disappear at the end of the login ... it should work as you think. But there is a โ€œmistakeโ€ that OpenIdAjaxTextBox does not support POST responses, which happens when you request attributes due to the size of the response payload. v3.3 fixes this, but it has not yet been released. Excuse me.

0
source

All Articles