TEMP
[dotnetoauth.git] / src / DotNetOpenAuth / OpenId / Provider / IRequest.cs
blob24d1ae87af15e3b1614ce1f219c3b740e7202cbb
1 //-----------------------------------------------------------------------
2 // <copyright file="IRequest.cs" company="Andrew Arnott">
3 // Copyright (c) Andrew Arnott. All rights reserved.
4 // </copyright>
5 //-----------------------------------------------------------------------
7 namespace DotNetOpenAuth.OpenId.Provider {
8 using System;
9 using System.Collections.Generic;
10 using System.Diagnostics.CodeAnalysis;
11 using System.Text;
12 using DotNetOpenAuth.Messaging;
13 using DotNetOpenAuth.OpenId.Messages;
15 /// <summary>
16 /// Represents an incoming OpenId authentication request.
17 /// </summary>
18 /// <remarks>
19 /// Requests may be infrastructural to OpenID and allow auto-responses, or they may
20 /// be authentication requests where the Provider site has to make decisions based
21 /// on its own user database and policies.
22 /// </remarks>
23 public interface IRequest {
24 /// <summary>
25 /// Gets a value indicating whether the response is ready to be sent to the user agent.
26 /// </summary>
27 /// <remarks>
28 /// This property returns false if there are properties that must be set on this
29 /// request instance before the response can be sent.
30 /// </remarks>
31 bool IsResponseReady { get; }
33 /// <summary>
34 /// Adds an extension to the response to send to the relying party.
35 /// </summary>
36 void AddResponseExtension(IOpenIdMessageExtension extension);
38 /// <summary>
39 /// Gets an extension sent from the relying party.
40 /// </summary>
41 /// <typeparam name="T">The type of the extension.</typeparam>
42 /// <returns>An instance of the extension initialized with values passed in with the request.</returns>
43 [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
44 T GetExtension<T>() where T : IOpenIdMessageExtension, new();
46 /// <summary>
47 /// Gets an extension sent from the relying party.
48 /// </summary>
49 /// <param name="extensionType">The type of the extension.</param>
50 /// <returns>An instance of the extension initialized with values passed in with the request.</returns>
51 IOpenIdMessageExtension GetExtension(Type extensionType);
53 /// <summary>
54 /// Gets the response to send to the user agent.
55 /// </summary>
56 UserAgentResponse GetResponse();