summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OAuth.ServiceProvider/OAuth/ChannelElements/OAuth1Principal.cs
blob: ff44a4544a0e6167a980633f419134f78c9f9775 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//-----------------------------------------------------------------------
// <copyright file="OAuth1Principal.cs" company="Outercurve Foundation">
//     Copyright (c) Outercurve Foundation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace DotNetOpenAuth.OAuth.ChannelElements {
	using System;
	using System.Collections.Generic;
	using System.Diagnostics.CodeAnalysis;
	using System.Linq;
	using System.Runtime.InteropServices;
	using System.Text;
	using Validation;

	/// <summary>
	/// Represents an OAuth consumer that is impersonating a known user on the system.
	/// </summary>
	[SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Justification = "Not cocreatable.")]
	[Serializable]
	[ComVisible(true)]
	internal class OAuth1Principal : OAuthPrincipal {
		/// <summary>
		/// Initializes a new instance of the <see cref="OAuth1Principal"/> class.
		/// </summary>
		/// <param name="token">The access token.</param>
		internal OAuth1Principal(IServiceProviderAccessToken token)
			: base(token.Username, token.Roles) {
			Requires.NotNull(token, "token");

			this.AccessToken = token.Token;
		}
	}
}