namespace OAuthServiceProvider {
using System.Web;
using System.Web.SessionState;
using Code;
using DotNetOpenAuth.Messaging;
public class OAuth : IHttpHandler, IRequiresSessionState {
///
/// Gets a value indicating whether another request can use the instance.
///
/// Always true
/// true if the instance is reusable; otherwise, false.
///
public bool IsReusable {
get { return true; }
}
///
/// Enables processing of HTTP Web requests by a custom HttpHandler that implements the interface.
///
/// An object that provides references to the intrinsic server objects (for example, Request, Response, Session, and Server) used to service HTTP requests.
public void ProcessRequest(HttpContext context) {
IDirectResponseProtocolMessage response;
if (Global.AuthorizationServer.TryPrepareAccessTokenResponse(out response)) {
Global.AuthorizationServer.Channel.Send(response);
}
}
}
}