//----------------------------------------------------------------------- // // Copyright (c) Andrew Arnott. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOpenAuth.ApplicationBlock { using System; using System.Runtime.InteropServices; using System.Security.Principal; /// /// Represents an OAuth consumer that is impersonating a known user on the system. /// [Serializable] [ComVisible(true)] internal class OAuthIdentity : IIdentity { /// /// Initializes a new instance of the class. /// /// The username. internal OAuthIdentity(string username) { if (String.IsNullOrEmpty(username)) { throw new ArgumentNullException("username"); } this.Name = username; } #region IIdentity Members /// /// Gets the type of authentication used. /// /// The constant "OAuth" /// /// The type of authentication used to identify the user. /// public string AuthenticationType { get { return "OAuth"; } } /// /// Gets a value indicating whether the user has been authenticated. /// /// The value true /// true if the user was authenticated; otherwise, false. /// public bool IsAuthenticated { get { return true; } } /// /// Gets the name of the user who authorized the OAuth token the consumer is using for authorization. /// /// /// The name of the user on whose behalf the code is running. /// public string Name { get; private set; } #endregion } }