I have been working on the DotNetOpenAuth to use Google application for authentication and asking to return Email Address.
I have a working program when I used the previous version of DotNetOpenAuth.dll. But when I update the Dll with the current version, then my code is broken. The application is able to authenticate but does not respond back with an email address.
My code is :
<rp:OpenIdButton runat="server" ImageUrl="~/images/google.jpg" Text="Login with Google" ID="OpenIdButton1"
Identifier="https://www.google.com/accounts/o8/id" LogOnMode="None" OnLoggingIn="test" OnLoggedIn="OpenIdLogin1_LoggedIn">
<Extensions>
<sreg:ClaimsRequest Email="Require" />
</Extensions>
protected void OpenIdLogin1_LoggedIn(object sender, OpenIdEventArgs e)
{
// Hide login button.
OpenIdButton1.Visible = false;
// Get email.
//ClaimsResponse profile = e.Response.GetExtension<ClaimsResponse>();
ClaimsResponse profile = e.Response.GetUntrustedExtension<ClaimsResponse>();
string email = profile.Email;
And the code breaks at the above line.
Did something change with the new Dll?
Your code relies on the use of the AXFetchAsSregTransform behavior. Please review the link and ensure that your web.config file is updated in the
<configSections>area to fit the new xml required by the latest DotNetOpenAuth. Your web.config likely already has the AXFetchAsSregTransform declared, but it is ignored till you update your configSections.BTW, you should
notgenerally useGetUntrustedExtension.