summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OpenId/OpenId/Behaviors/GsaIcamProfileBase.cs
blob: 25a4e59f947397c80b7e1b0a735432073c9913b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//-----------------------------------------------------------------------
// <copyright file="GsaIcamProfileBase.cs" company="Andrew Arnott">
//     Copyright (c) Andrew Arnott. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace DotNetOpenAuth.OpenId.Behaviors {
	using System;
	using System.Diagnostics.CodeAnalysis;
	using System.Diagnostics.Contracts;
	using System.Linq;
	using DotNetOpenAuth.Configuration;
	using DotNetOpenAuth.Messaging;
	using DotNetOpenAuth.OpenId.Extensions.AttributeExchange;
	using DotNetOpenAuth.OpenId.Extensions.ProviderAuthenticationPolicy;
	using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration;

	/// <summary>
	/// Implements the Identity, Credential, &amp; Access Management (ICAM) OpenID 2.0 Profile
	/// for the General Services Administration (GSA).
	/// </summary>
	/// <remarks>
	/// <para>Relying parties that include this profile are always held to the terms required by the profile,
	/// but Providers are only affected by the special behaviors of the profile when the RP specifically
	/// indicates that they want to use this profile. </para>
	/// </remarks>
	[Serializable]
	[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Icam", Justification = "Acronym")]
	public abstract class GsaIcamProfileBase {
		/// <summary>
		/// Backing field for the <see cref="DisableSslRequirement"/> static property.
		/// </summary>
		private static bool disableSslRequirement = DotNetOpenAuthSection.Messaging.RelaxSslRequirements;

		/// <summary>
		/// Initializes a new instance of the <see cref="GsaIcamProfileBase"/> class.
		/// </summary>
		public GsaIcamProfileBase() {
			if (DisableSslRequirement) {
				Logger.OpenId.Warn("GSA level 1 behavior has its RequireSsl requirement disabled.");
			}
		}

		/// <summary>
		/// Gets or sets a value indicating whether PII is allowed to be requested or received via OpenID.
		/// </summary>
		/// <value>The default value is <c>false</c>.</value>
		public static bool AllowPersonallyIdentifiableInformation { get; set; }

		/// <summary>
		/// Gets or sets a value indicating whether to ignore the SSL requirement (for testing purposes only).
		/// </summary>
		public static bool DisableSslRequirement { // not an auto-property because it has a default value, and FxCop doesn't want us using static constructors.
			get { return disableSslRequirement; }
			set { disableSslRequirement = value; }
		}
	}
}