//-----------------------------------------------------------------------
//
// Copyright (c) Andrew Arnott. All rights reserved.
//
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.OAuth2 {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using Validation;
///
/// Describes the parameters to be fed into creating a response to an access token request.
///
public class AccessTokenResult : IAccessTokenResult {
///
/// Initializes a new instance of the class.
///
/// The access token to include in this result.
public AccessTokenResult(AuthorizationServerAccessToken accessToken) {
Requires.NotNull(accessToken, "accessToken");
this.AllowRefreshToken = true;
this.AccessToken = accessToken;
}
///
/// Gets or sets a value indicating whether to provide the client with a refresh token, when applicable.
///
/// The default value is true.
/// >
/// The refresh token will never be provided when this value is false.
/// The refresh token may be provided when this value is true.
///
public bool AllowRefreshToken { get; set; }
///
/// Gets the access token.
///
public AuthorizationServerAccessToken AccessToken { get; private set; }
///
/// Gets the access token.
///
AccessToken IAccessTokenResult.AccessToken {
get { return this.AccessToken; }
}
}
}