//-----------------------------------------------------------------------
//
// Copyright (c) Outercurve Foundation. All rights reserved.
//
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.OAuth2.Messages {
using System;
using System.Collections.Generic;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OAuth2.ChannelElements;
///
/// An access token request that includes a scope parameter.
///
internal abstract class ScopedAccessTokenRequest : AccessTokenRequestBase {
///
/// Initializes a new instance of the class.
///
/// The Authorization Server's access token endpoint URL.
/// The version.
internal ScopedAccessTokenRequest(Uri tokenEndpoint, Version version)
: base(tokenEndpoint, version) {
this.Scope = new HashSet(OAuthUtilities.ScopeStringComparer);
}
///
/// Gets the set of scopes the Client would like the access token to provide access to.
///
/// A set of scopes. Never null.
[MessagePart(Protocol.scope, IsRequired = false, Encoder = typeof(ScopeEncoder))]
internal HashSet Scope { get; private set; }
///
/// Gets the scope of operations the client is allowed to invoke.
///
protected override HashSet RequestedScope {
get { return this.Scope; }
}
}
}