summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AccessTokenResult.cs
blob: 11e486ba4e594890cc34b83608fb07ece369936e (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
35
36
37
38
39
40
41
42
43
//-----------------------------------------------------------------------
// <copyright file="AccessTokenResult.cs" company="Andrew Arnott">
//     Copyright (c) Andrew Arnott. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace DotNetOpenAuth.OAuth2 {
	using System;
	using System.Collections.Generic;
	using System.Linq;
	using System.Security.Cryptography;
	using System.Text;

	/// <summary>
	/// Describes the parameters to be fed into creating a response to an access token request.
	/// </summary>
	public class AccessTokenResult {
		/// <summary>
		/// Initializes a new instance of the <see cref="AccessTokenResult"/> class.
		/// </summary>
		/// <param name="accessToken">The access token to include in this result.</param>
		public AccessTokenResult(AccessToken accessToken) {
			Requires.NotNull(accessToken, "accessToken");
			this.AllowRefreshToken = true;
			this.AccessToken = accessToken;
		}

		/// <summary>
		/// Gets or sets a value indicating whether to provide the client with a refresh token, when applicable.
		/// </summary>
		/// <value>The default value is <c>true</c>.</value>
		/// <remarks>>
		/// The refresh token will never be provided when this value is false.
		/// The refresh token <em>may</em> be provided when this value is true.
		/// </remarks>
		public bool AllowRefreshToken { get; set; }

		/// <summary>
		/// Gets the access token.
		/// </summary>
		public AccessToken AccessToken { get; private set; }
	}
}