//----------------------------------------------------------------------- // // Copyright (c) Outercurve Foundation. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOpenAuth.OAuth.ChannelElements { using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Text; /// /// A description of an access token and its metadata as required by a Service Provider. /// public interface IServiceProviderAccessToken { /// /// Gets the token itself. /// string Token { get; } /// /// Gets the expiration date (local time) for the access token. /// /// The expiration date, or null if there is no expiration date. DateTime? ExpirationDate { get; } /// /// Gets the username of the principal that will be impersonated by this access token. /// /// /// The name of the user who authorized the OAuth request token originally. /// [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Username", Justification = "Breaking change.")] string Username { get; } /// /// Gets the roles that the OAuth principal should belong to. /// /// /// The roles that the user belongs to, or a subset of these according to the rights /// granted when the user authorized the request token. /// [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "By design.")] string[] Roles { get; } } }