blob: b2b231a77c31959ccdf4bf889bda74b81b158f3b (
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
//-----------------------------------------------------------------------
// <copyright file="IProviderEndpoint.cs" company="Outercurve Foundation">
// Copyright (c) Outercurve Foundation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.OpenId.RelyingParty {
using System;
using System.Collections.ObjectModel;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.Contracts;
using System.Globalization;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.Messages;
/// <summary>
/// Information published about an OpenId Provider by the
/// OpenId discovery documents found at a user's Claimed Identifier.
/// </summary>
/// <remarks>
/// Because information provided by this interface is suppplied by a
/// user's individually published documents, it may be incomplete or inaccurate.
/// </remarks>
[ContractClass(typeof(IProviderEndpointContract))]
public interface IProviderEndpoint {
/// <summary>
/// Gets the detected version of OpenID implemented by the Provider.
/// </summary>
Version Version { get; }
/// <summary>
/// Gets the URL that the OpenID Provider receives authentication requests at.
/// </summary>
/// <value>
/// This value MUST be an absolute HTTP or HTTPS URL.
/// </value>
Uri Uri { get; }
/// <summary>
/// Checks whether the OpenId Identifier claims support for a given extension.
/// </summary>
/// <typeparam name="T">The extension whose support is being queried.</typeparam>
/// <returns>True if support for the extension is advertised. False otherwise.</returns>
/// <remarks>
/// Note that a true or false return value is no guarantee of a Provider's
/// support for or lack of support for an extension. The return value is
/// determined by how the authenticating user filled out his/her XRDS document only.
/// The only way to be sure of support for a given extension is to include
/// the extension in the request and see if a response comes back for that extension.
/// </remarks>
[SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "No parameter at all.")]
[Obsolete("Use IAuthenticationRequest.DiscoveryResult.IsExtensionSupported instead.")]
bool IsExtensionSupported<T>() where T : IOpenIdMessageExtension, new();
/// <summary>
/// Checks whether the OpenId Identifier claims support for a given extension.
/// </summary>
/// <param name="extensionType">The extension whose support is being queried.</param>
/// <returns>True if support for the extension is advertised. False otherwise.</returns>
/// <remarks>
/// Note that a true or false return value is no guarantee of a Provider's
/// support for or lack of support for an extension. The return value is
/// determined by how the authenticating user filled out his/her XRDS document only.
/// The only way to be sure of support for a given extension is to include
/// the extension in the request and see if a response comes back for that extension.
/// </remarks>
[Obsolete("Use IAuthenticationRequest.DiscoveryResult.IsExtensionSupported instead.")]
bool IsExtensionSupported(Type extensionType);
}
/// <summary>
/// Code contract for the <see cref="IProviderEndpoint"/> type.
/// </summary>
[ContractClassFor(typeof(IProviderEndpoint))]
internal abstract class IProviderEndpointContract : IProviderEndpoint {
/// <summary>
/// Prevents a default instance of the <see cref="IProviderEndpointContract"/> class from being created.
/// </summary>
private IProviderEndpointContract() {
}
#region IProviderEndpoint Members
/// <summary>
/// Gets the detected version of OpenID implemented by the Provider.
/// </summary>
Version IProviderEndpoint.Version {
get {
Contract.Ensures(Contract.Result<Version>() != null);
throw new System.NotImplementedException();
}
}
/// <summary>
/// Gets the URL that the OpenID Provider receives authentication requests at.
/// </summary>
Uri IProviderEndpoint.Uri {
get {
Contract.Ensures(Contract.Result<Uri>() != null);
throw new System.NotImplementedException();
}
}
/// <summary>
/// Checks whether the OpenId Identifier claims support for a given extension.
/// </summary>
/// <typeparam name="T">The extension whose support is being queried.</typeparam>
/// <returns>
/// True if support for the extension is advertised. False otherwise.
/// </returns>
/// <remarks>
/// Note that a true or false return value is no guarantee of a Provider's
/// support for or lack of support for an extension. The return value is
/// determined by how the authenticating user filled out his/her XRDS document only.
/// The only way to be sure of support for a given extension is to include
/// the extension in the request and see if a response comes back for that extension.
/// </remarks>
bool IProviderEndpoint.IsExtensionSupported<T>() {
throw new NotImplementedException();
}
/// <summary>
/// Checks whether the OpenId Identifier claims support for a given extension.
/// </summary>
/// <param name="extensionType">The extension whose support is being queried.</param>
/// <returns>
/// True if support for the extension is advertised. False otherwise.
/// </returns>
/// <remarks>
/// Note that a true or false return value is no guarantee of a Provider's
/// support for or lack of support for an extension. The return value is
/// determined by how the authenticating user filled out his/her XRDS document only.
/// The only way to be sure of support for a given extension is to include
/// the extension in the request and see if a response comes back for that extension.
/// </remarks>
bool IProviderEndpoint.IsExtensionSupported(Type extensionType) {
Requires.NotNullSubtype<IOpenIdMessageExtension>(extensionType, "extensionType");
throw new NotImplementedException();
}
#endregion
}
}
|