Default.aspx :  » Bloggers » dasBlog » ProviderPortal » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Bloggers » dasBlog 
dasBlog » ProviderPortal » Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" %>

<%@ Import Namespace="DotNetOpenId.Provider" %>
<%@ Register Assembly="DotNetOpenId" Namespace="DotNetOpenId" TagPrefix="openid" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
  protected void sendAssertionButton_Click(object sender, EventArgs e) {
    TextBox relyingPartySite = (TextBox)loginView.FindControl("relyingPartySite");
    Uri providerEndpoint = new Uri(Request.Url, Page.ResolveUrl("~/server.aspx"));
    OpenIdProvider op = new OpenIdProvider(OpenIdProvider.HttpApplicationStore,
      providerEndpoint, Request.Url, Request.QueryString);
    try {
      op.PrepareUnsolicitedAssertion(relyingPartySite.Text, Util.BuildIdentityUrl(), Util.BuildIdentityUrl()).Send();
    } catch (OpenIdException ex) {
      Label errorLabel = (Label)loginView.FindControl("errorLabel");
      errorLabel.Visible = true;
      errorLabel.Text = ex.Message;
    }
  }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <openid:XrdsPublisher runat="server" XrdsUrl="~/op_xrds.aspx" />
  <title>OpenID Provider, by DotNetOpenId</title>
</head>
<body>
  <form id="form1" runat="server">
  <h1>
    OpenID Provider
  </h1>
  <h2>
    Provided by <a href="http://dotnetopenid.googlecode.com">DotNetOpenId</a>
  </h2>
  <p>
    Welcome. This site doesn't do anything more than simple authentication of users.
    Start the authentication process on the Relying Party sample site, or log in here
    and send an unsolicited assertion.
  </p>
  <asp:LoginView runat="server" ID="loginView">
    <LoggedInTemplate>
      <asp:Panel runat="server" DefaultButton="sendAssertionButton">
        Since you're logged in, try sending an unsolicited assertion to an OpenID 2.0 relying
        party site. Just type in the URL to the site's home page. This could be the sample
        relying party web site.
        <br />
        <asp:TextBox runat="server" ID="relyingPartySite" Columns="40" />
        <asp:Button runat="server" ID="sendAssertionButton" Text="Send assertion" OnClick="sendAssertionButton_Click" />
        <asp:RequiredFieldValidator runat="server" ControlToValidate="relyingPartySite" Text="Specify relying party site first" />
        <br />
        An unsolicited assertion is a way to log in to a relying party site directly from
        your OpenID Provider.
        <p>
          <asp:Label runat="server" EnableViewState="false" Visible="false" ID="errorLabel"
            ForeColor="Red" />
        </p>
      </asp:Panel>
    </LoggedInTemplate>
  </asp:LoginView>
  <asp:LoginStatus runat="server" />
  </form>
</body>
</html>
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.