Skip to content

Instantly share code, notes, and snippets.

@xdumaine
Created January 29, 2014 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xdumaine/8691213 to your computer and use it in GitHub Desktop.
Save xdumaine/8691213 to your computer and use it in GitHub Desktop.
Adapted from the DotNetOpenAuth > Samples > OpenIdProviderMVC example
<%@ Page Language="C#" AutoEventWireup="true" ContentType="application/xrds+xml" %>
<%@ OutputCache Duration="86400" VaryByParam="none" Location="Any" %><?xml version="1.0" encoding="UTF-8"?>
<%--
This XRDS view is used for both the OP identifier and the user identity pages.
Only a couple of conditional checks are required to share the view, but sharing the view
makes it very easy to ensure that all the Type URIs that this server supports are included
for all XRDS discovery.
--%>
<xrds:XRDS
xmlns:xrds="xri://$xrds"
xmlns:openid="http://openid.net/xmlns/1.0"
xmlns="xri://$xrd*($v*2.0)">
<XRD>
<Service priority="10">
<% if (ViewData["OPIdentifier"] != null) { %>
<Type>http://specs.openid.net/auth/2.0/server</Type>
<% } else { %>
<Type>http://specs.openid.net/auth/2.0/signon</Type>
<% } %>
<Type>http://openid.net/extensions/sreg/1.1</Type>
<Type>http://axschema.org/contact/email</Type>
<%--
Add these types when and if the Provider supports the respective aspects of the UI extension.
<Type>http://specs.openid.net/extensions/ui/1.0/mode/popup</Type>
<Type>http://specs.openid.net/extensions/ui/1.0/lang-pref</Type>
<Type>http://specs.openid.net/extensions/ui/1.0/icon</Type>--%>
<URI><%=new Uri(Request.Url, Response.ApplyAppPathModifier("~/Ud"))%></URI>
</Service>
<% if (ViewData["OPIdentifier"] == null) { %>
<Service priority="20">
<Type>http://openid.net/signon/1.0</Type>
<Type>http://openid.net/extensions/sreg/1.1</Type>
<Type>http://axschema.org/contact/email</Type>
<URI><%=new Uri(Request.Url, Response.ApplyAppPathModifier("~/Ud"))%></URI>
</Service>
<% } %>
</XRD>
</xrds:XRDS>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment