【发布时间】:2011-12-20 11:59:52
【问题描述】:
我已经使用以下代码使用开放 ID 制作了登录系统
<rp:OpenIdLogin runat="server" Identifier="https://www.google.com/accounts/o8/id" Visible="true"
ExampleUrl="" LabelText=" " RegisterText="Register" ExamplePrefix=" " ID="OpenIdLogin1"
OnLoggedIn="OpenIdTextBox1_LoggedIn" RequestEmail="Require" RequestPostalCode="Request"></rp:OpenIdLogin>
将用户带到 Google 进行身份验证我只想将电子邮件 ID 和他的全名和性别等用户信息发送到我的数据库
我已经编写了以下代码来从谷歌接收电子邮件,但没有什么是返回
Imports System
Imports DotNetOpenAuth.OpenId.Extensions.AttributeExchange
Partial Class Food
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If (Session("FetchResponse") Is Nothing) Then
Return
End If
Dim fetchResponse As FetchResponse = CType(Session("FetchResponse"), FetchResponse)
Email = fetchResponse.GetAttributeValue(WellKnownAttributes.Contact.Email)
End Sub
Public Property Email() As String
Get
End Get
Set(ByVal value As String)
End Set
End Property
End Class
更新
我使用 loginame 来显示经过身份验证的用户名,但它显示 像这样 https://www.google.com/accounts/o8/id?id=AItOawmQoYAeHRxYW0ZOcQ5VODMPWJQgPOAYkTs
如何显示实际的电子邮件或用户名
【问题讨论】:
-
请继续接受您之前提出的问题。
-
亲爱的,请仔细检查我的个人资料并回答我的问题,请因为打开 id 而遇到麻烦
标签: asp.net openid dotnetopenauth