1
//-----------------------------------------------------------------------
2 // <copyright file="IRequest.cs" company="Andrew Arnott">
3 // Copyright (c) Andrew Arnott. All rights reserved.
5 //-----------------------------------------------------------------------
7 namespace DotNetOpenAuth
.OpenId
.Provider
{
9 using System
.Collections
.Generic
;
10 using System
.Diagnostics
.CodeAnalysis
;
12 using DotNetOpenAuth
.Messaging
;
13 using DotNetOpenAuth
.OpenId
.Messages
;
16 /// Represents an incoming OpenId authentication request.
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.
23 public interface IRequest
{
25 /// Gets a value indicating whether the response is ready to be sent to the user agent.
28 /// This property returns false if there are properties that must be set on this
29 /// request instance before the response can be sent.
31 bool IsResponseReady { get; }
34 /// Adds an extension to the response to send to the relying party.
36 void AddResponseExtension(IOpenIdMessageExtension extension
);
39 /// Gets an extension sent from the relying party.
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();
47 /// Gets an extension sent from the relying party.
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
);
54 /// Gets the response to send to the user agent.
56 UserAgentResponse
GetResponse();