//-----------------------------------------------------------------------
//
// Copyright (c) Outercurve Foundation. All rights reserved.
//
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.OAuth2.ChannelElements {
using System;
using System.Collections.Generic;
using DotNetOpenAuth.Messaging;
///
/// A data bag that stores authorization data.
///
public abstract class AuthorizationDataBag : DataBag, IAuthorizationDescription {
///
/// Initializes a new instance of the class.
///
protected AuthorizationDataBag() {
this.Scope = new HashSet(OAuthUtilities.ScopeStringComparer);
}
///
/// Gets or sets the identifier of the client authorized to access protected data.
///
[MessagePart]
public string ClientIdentifier { get; set; }
///
/// Gets the date this authorization was established or the token was issued.
///
/// A date/time expressed in UTC.
public DateTime UtcIssued {
get { return this.UtcCreationDate; }
}
///
/// Gets or sets the name on the account whose data on the resource server is accessible using this authorization.
///
[MessagePart]
public string User { get; set; }
///
/// Gets the scope of operations the client is allowed to invoke.
///
[MessagePart(Encoder = typeof(ScopeEncoder))]
public HashSet Scope { get; private set; }
}
}