diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-10-29 21:49:39 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-10-29 21:49:39 -0700 |
commit | a7915417b94037f1cc9a17590787f88d88be2559 (patch) | |
tree | 49ec536de4387def04a4eef8ac30c03636679fd6 /src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/Messages/AccessTokenResult.cs | |
parent | 1a9aa9dc9ec85d32e771f2f2fd863304a60e29d2 (diff) | |
parent | 6dba07eda990f75dfea0999b06aba9c2e61fa442 (diff) | |
download | DotNetOpenAuth-a7915417b94037f1cc9a17590787f88d88be2559.zip DotNetOpenAuth-a7915417b94037f1cc9a17590787f88d88be2559.tar.gz DotNetOpenAuth-a7915417b94037f1cc9a17590787f88d88be2559.tar.bz2 |
Merge remote-tracking branch 'aarnott/master'
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/Messages/AccessTokenResult.cs')
-rw-r--r-- | src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/Messages/AccessTokenResult.cs | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/Messages/AccessTokenResult.cs b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/Messages/AccessTokenResult.cs new file mode 100644 index 0000000..4297165 --- /dev/null +++ b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/Messages/AccessTokenResult.cs @@ -0,0 +1,50 @@ +//----------------------------------------------------------------------- +// <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 : IAccessTokenResult { + /// <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(AuthorizationServerAccessToken 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 AuthorizationServerAccessToken AccessToken { get; private set; } + + /// <summary> + /// Gets the access token. + /// </summary> + AccessToken IAccessTokenResult.AccessToken { + get { return this.AccessToken; } + } + } +} |