//-----------------------------------------------------------------------
//
// Copyright (c) Outercurve Foundation. All rights reserved.
//
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.OAuth2 {
using System;
using System.Diagnostics.Contracts;
///
/// A token manager implemented by some clients to assist in tracking authorization state.
///
[ContractClass(typeof(IClientAuthorizationTrackerContract))]
public interface IClientAuthorizationTracker {
///
/// Gets the state of the authorization for a given callback URL and client state.
///
/// The callback URL.
/// State of the client stored at the beginning of an authorization request.
/// The authorization state; may be null if no authorization state matches.
IAuthorizationState GetAuthorizationState(Uri callbackUrl, string clientState);
}
///
/// Contract class for the interface.
///
[ContractClassFor(typeof(IClientAuthorizationTracker))]
internal abstract class IClientAuthorizationTrackerContract : IClientAuthorizationTracker {
///
/// Prevents a default instance of the class from being created.
///
private IClientAuthorizationTrackerContract() {
}
#region IClientTokenManager Members
///
/// Gets the state of the authorization for a given callback URL and client state.
///
/// The callback URL.
/// State of the client stored at the beginning of an authorization request.
///
/// The authorization state; may be null if no authorization state matches.
///
IAuthorizationState IClientAuthorizationTracker.GetAuthorizationState(Uri callbackUrl, string clientState) {
Requires.NotNull(callbackUrl, "callbackUrl");
throw new NotImplementedException();
}
#endregion
}
}