Simple example for OpenId implementation in vb.net..
This code is used to validate gmail username and password..You can use gmail id as openid for your site to authenticate users
in .aspx page <form id="form1" runat="server">
<div id="openid" runat="server">
<asp:Button ID="btnLoginToGoogle" Runat="server" Text="Google Login" OnCommand="OpenLogin_Click"
CommandArgument="https://www.google.com/accounts/o8/id"
Font-Bold="True" Font-Italic="True" Width="162px" />
<br />
<br />
<asp:Label ID="lblMessage" runat="server" Text="Label"></asp:Label>
</div>
</form>
in .vb Imports DotNetOpenAuth.OpenId
Imports DotNetOpenAuth.OpenId.RelyingParty
Imports DotNetOpenAuth.OpenId.Extensions.AttributeExchange
Imports System
Partial Class demobooking_open
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
Dim OIDRP As New OpenIdRelyingParty()
Dim str = OIDRP.GetResponse()
If str IsNot Nothing Then
Select Case str.Status
Case AuthenticationStatus.Authenticated
Dim fetch As FetchResponse = str.GetExtension(Of FetchResponse)()
Session("GoogleIdentifier") = str.ClaimedIdentifier.ToString()
lblMessage.Text = fetch.GetAttributeValue(WellKnownAttributes.Contact.Email) -->display email id of user
Exit Select
Case AuthenticationStatus.Canceled
lblMessage.Text = "Cancelled."
Exit Select
Case AuthenticationStatus.Failed
lblMessage.Text = "Login Failed."
Exit Select
End Select
End If
End Sub
Protected Sub OpenLogin_Click(sender As Object, e As System.Web.UI.WebControls.CommandEventArgs) Handles btnLoginToGoogle.Command
Dim str As String = e.CommandArgument.ToString()
Dim openid As New OpenIdRelyingParty()
Dim b = New UriBuilder(Request.Url) With {.Query = ""}
Dim req = openid.CreateRequest(str, b.Uri, b.Uri)
Dim fetch As New FetchRequest()
fetch.Attributes.Add(New AttributeRequest(WellKnownAttributes.Contact.Email, True))
req.AddExtension(fetch)
req.RedirectToProvider()
End Sub
End Class