blob: 1c38d4ba4125c0cd0deee792fcf36365c86d6a5d (
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
|
//-----------------------------------------------------------------------
// <copyright file="IHostProcessedRequest.cs" company="Andrew Arnott">
// Copyright (c) Andrew Arnott. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.OpenId.Provider {
using System;
using System.Diagnostics.Contracts;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.Messages;
/// <summary>
/// Interface exposing incoming messages to the OpenID Provider that
/// require interaction with the host site.
/// </summary>
[ContractClass(typeof(IHostProcessedRequestContract))]
public interface IHostProcessedRequest : IRequest {
/// <summary>
/// Gets the version of OpenID being used by the relying party that sent the request.
/// </summary>
ProtocolVersion RelyingPartyVersion { get; }
/// <summary>
/// Gets the URL the consumer site claims to use as its 'base' address.
/// </summary>
Realm Realm { get; }
/// <summary>
/// Gets a value indicating whether the consumer demands an immediate response.
/// If false, the consumer is willing to wait for the identity provider
/// to authenticate the user.
/// </summary>
bool Immediate { get; }
/// <summary>
/// Gets or sets the provider endpoint claimed in the positive assertion.
/// </summary>
/// <value>
/// The default value is the URL that the request came in on from the relying party.
/// This value MUST match the value for the OP Endpoint in the discovery results for the
/// claimed identifier being asserted in a positive response.
/// </value>
Uri ProviderEndpoint { get; set; }
/// <summary>
/// Attempts to perform relying party discovery of the return URL claimed by the Relying Party.
/// </summary>
/// <param name="provider">The OpenIdProvider that is performing the RP discovery.</param>
/// <returns>
/// The details of how successful the relying party discovery was.
/// </returns>
/// <remarks>
/// <para>Return URL verification is only attempted if this method is called.</para>
/// <para>See OpenID Authentication 2.0 spec section 9.2.1.</para>
/// </remarks>
RelyingPartyDiscoveryResult IsReturnUrlDiscoverable(OpenIdProvider provider);
}
/// <summary>
/// Code contract for the <see cref="IHostProcessedRequest"/> type.
/// </summary>
[ContractClassFor(typeof(IHostProcessedRequest))]
internal abstract class IHostProcessedRequestContract : IHostProcessedRequest {
/// <summary>
/// Initializes a new instance of the <see cref="IHostProcessedRequestContract"/> class.
/// </summary>
protected IHostProcessedRequestContract() {
}
#region IHostProcessedRequest Properties
/// <summary>
/// Gets the version of OpenID being used by the relying party that sent the request.
/// </summary>
ProtocolVersion IHostProcessedRequest.RelyingPartyVersion {
get { throw new System.NotImplementedException(); }
}
/// <summary>
/// Gets the URL the consumer site claims to use as its 'base' address.
/// </summary>
Realm IHostProcessedRequest.Realm {
get { throw new System.NotImplementedException(); }
}
/// <summary>
/// Gets a value indicating whether the consumer demands an immediate response.
/// If false, the consumer is willing to wait for the identity provider
/// to authenticate the user.
/// </summary>
bool IHostProcessedRequest.Immediate {
get { throw new System.NotImplementedException(); }
}
/// <summary>
/// Gets or sets the provider endpoint.
/// </summary>
/// <value>
/// The default value is the URL that the request came in on from the relying party.
/// </value>
Uri IHostProcessedRequest.ProviderEndpoint {
get {
Contract.Ensures(Contract.Result<Uri>() != null);
throw new NotImplementedException();
}
set {
Contract.Requires(value != null);
throw new NotImplementedException();
}
}
#endregion
#region IRequest Members
/// <summary>
/// Gets or sets the security settings that apply to this request.
/// </summary>
/// <value>
/// Defaults to the <see cref="OpenIdProvider.SecuritySettings"/> on the <see cref="OpenIdProvider"/>.
/// </value>
ProviderSecuritySettings IRequest.SecuritySettings {
get { throw new NotImplementedException(); }
set { throw new NotImplementedException(); }
}
/// <summary>
/// Gets a value indicating whether the response is ready to be sent to the user agent.
/// </summary>
/// <remarks>
/// This property returns false if there are properties that must be set on this
/// request instance before the response can be sent.
/// </remarks>
bool IRequest.IsResponseReady {
get { throw new System.NotImplementedException(); }
}
/// <summary>
/// Adds an extension to the response to send to the relying party.
/// </summary>
/// <param name="extension">The extension to add to the response message.</param>
void IRequest.AddResponseExtension(DotNetOpenAuth.OpenId.Messages.IOpenIdMessageExtension extension) {
throw new System.NotImplementedException();
}
/// <summary>
/// Removes any response extensions previously added using <see cref="IRequest.AddResponseExtension"/>.
/// </summary>
/// <remarks>
/// This should be called before sending a negative response back to the relying party
/// if extensions were already added, since negative responses cannot carry extensions.
/// </remarks>
void IRequest.ClearResponseExtensions() {
}
/// <summary>
/// Gets an extension sent from the relying party.
/// </summary>
/// <typeparam name="T">The type of the extension.</typeparam>
/// <returns>
/// An instance of the extension initialized with values passed in with the request.
/// </returns>
T IRequest.GetExtension<T>() {
throw new System.NotImplementedException();
}
/// <summary>
/// Gets an extension sent from the relying party.
/// </summary>
/// <param name="extensionType">The type of the extension.</param>
/// <returns>
/// An instance of the extension initialized with values passed in with the request.
/// </returns>
DotNetOpenAuth.OpenId.Messages.IOpenIdMessageExtension IRequest.GetExtension(System.Type extensionType) {
throw new System.NotImplementedException();
}
#endregion
#region IHostProcessedRequest Methods
/// <summary>
/// Attempts to perform relying party discovery of the return URL claimed by the Relying Party.
/// </summary>
/// <param name="provider">The OpenIdProvider that is performing the RP discovery.</param>
/// <returns>
/// The details of how successful the relying party discovery was.
/// </returns>
/// <remarks>
/// <para>Return URL verification is only attempted if this method is called.</para>
/// <para>See OpenID Authentication 2.0 spec section 9.2.1.</para>
/// </remarks>
RelyingPartyDiscoveryResult IHostProcessedRequest.IsReturnUrlDiscoverable(OpenIdProvider provider) {
Contract.Requires<ArgumentNullException>(provider != null);
throw new System.NotImplementedException();
}
#endregion
}
}
|