我一直在研究 DotNetOpenAuth 以使用 Google 应用程序进行身份验证并要求返回电子邮件地址。
当我使用以前版本的 DotNetOpenAuth.dll 时,我有一个工作程序。但是当我用当前版本更新 Dll 时,我的代码就坏了。该应用程序能够进行身份验证,但不回复电子邮件地址。
我的代码是:
<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.
新的 Dll 有什么变化吗?