summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/DotNetOpenAuth/DotNetOpenAuth.csproj1
-rw-r--r--src/DotNetOpenAuth/OpenId/Extensions/UI/UIConstants.cs28
-rw-r--r--src/DotNetOpenAuth/OpenId/Extensions/UI/UIRequest.cs13
3 files changed, 37 insertions, 5 deletions
diff --git a/src/DotNetOpenAuth/DotNetOpenAuth.csproj b/src/DotNetOpenAuth/DotNetOpenAuth.csproj
index 023b02c..8f7715e 100644
--- a/src/DotNetOpenAuth/DotNetOpenAuth.csproj
+++ b/src/DotNetOpenAuth/DotNetOpenAuth.csproj
@@ -387,6 +387,7 @@
<Compile Include="OpenId\Extensions\SimpleRegistration\Constants.cs" />
<Compile Include="OpenId\Extensions\SimpleRegistration\DemandLevel.cs" />
<Compile Include="OpenId\Extensions\SimpleRegistration\Gender.cs" />
+ <Compile Include="OpenId\Extensions\UI\UIConstants.cs" />
<Compile Include="OpenId\Extensions\UI\UIUtilities.cs" />
<Compile Include="OpenId\Extensions\UI\UIModes.cs" />
<Compile Include="OpenId\Extensions\UI\UIRequest.cs" />
diff --git a/src/DotNetOpenAuth/OpenId/Extensions/UI/UIConstants.cs b/src/DotNetOpenAuth/OpenId/Extensions/UI/UIConstants.cs
new file mode 100644
index 0000000..963b301
--- /dev/null
+++ b/src/DotNetOpenAuth/OpenId/Extensions/UI/UIConstants.cs
@@ -0,0 +1,28 @@
+//-----------------------------------------------------------------------
+// <copyright file="UIConstants.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOpenAuth.OpenId.Extensions.UI {
+ /// <summary>
+ /// Constants used to support the UI extension.
+ /// </summary>
+ internal static class UIConstants {
+ /// <summary>
+ /// The type URI associated with this extension.
+ /// </summary>
+ internal const string UITypeUri = "http://specs.openid.net/extensions/ui/1.0";
+
+ /// <summary>
+ /// The Type URI that appears in an XRDS document when the OP supports popups through the UI extension.
+ /// </summary>
+ internal const string PopupSupported = "http://specs.openid.net/extensions/ui/1.0/mode/popup";
+
+ /// <summary>
+ /// The Type URI that appears in an XRDS document when the OP supports the RP
+ /// specifying the user's preferred language through the UI extension.
+ /// </summary>
+ internal const string LangPrefSupported = "http://specs.openid.net/extensions/ui/1.0/lang-pref";
+ }
+}
diff --git a/src/DotNetOpenAuth/OpenId/Extensions/UI/UIRequest.cs b/src/DotNetOpenAuth/OpenId/Extensions/UI/UIRequest.cs
index 476b4ad..5d4ecf4 100644
--- a/src/DotNetOpenAuth/OpenId/Extensions/UI/UIRequest.cs
+++ b/src/DotNetOpenAuth/OpenId/Extensions/UI/UIRequest.cs
@@ -33,7 +33,7 @@ namespace DotNetOpenAuth.OpenId.Extensions.UI {
/// The factory method that may be used in deserialization of this message.
/// </summary>
internal static readonly StandardOpenIdExtensionFactory.CreateDelegate Factory = (typeUri, data, baseMessage, isProviderRole) => {
- if (typeUri == UITypeUri && isProviderRole) {
+ if (typeUri == UIConstants.UITypeUri && isProviderRole) {
return new UIRequest();
}
@@ -41,9 +41,12 @@ namespace DotNetOpenAuth.OpenId.Extensions.UI {
};
/// <summary>
- /// The type URI associated with this extension.
+ /// Additional type URIs that this extension is sometimes known by remote parties.
/// </summary>
- private const string UITypeUri = "http://specs.openid.net/extensions/ui/1.0";
+ private static readonly string[] additionalTypeUris = new string[] {
+ UIConstants.LangPrefSupported,
+ UIConstants.PopupSupported,
+ };
/// <summary>
/// Backing store for <see cref="ExtraData"/>.
@@ -81,7 +84,7 @@ namespace DotNetOpenAuth.OpenId.Extensions.UI {
/// Gets the TypeURI the extension uses in the OpenID protocol and in XRDS advertisements.
/// </summary>
/// <value></value>
- public string TypeUri { get { return UITypeUri; } }
+ public string TypeUri { get { return UIConstants.UITypeUri; } }
/// <summary>
/// Gets the additional TypeURIs that are supported by this extension, in preferred order.
@@ -98,7 +101,7 @@ namespace DotNetOpenAuth.OpenId.Extensions.UI {
/// given the version of the extension in the request message.
/// The <see cref="Extensions.SimpleRegistration.ClaimsRequest.CreateResponse"/> for an example.
/// </remarks>
- public IEnumerable<string> AdditionalSupportedTypeUris { get { return Enumerable.Empty<string>(); } }
+ public IEnumerable<string> AdditionalSupportedTypeUris { get { return additionalTypeUris; } }
/// <summary>
/// Gets or sets a value indicating whether this extension was