//-----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------
namespace System.IdentityModel.Protocols.WSTrust
{
///
/// This defines the Renewing element inside the RequestSecurityToken message.
///
///
/// The presence of Renewing element indicates the token issuer that the requested token
/// can be renewed if allow attribute is true, and the token can be renewed after
/// it expires if ok is true.
///
public class Renewing
{
bool _allowRenewal = true;
bool _okForRenewalAfterExpiration; // false by default
///
/// Initializes a renewing object with AllowRenewal attribute equals to true, and
/// OkForRenewalAfterExpiration attribute equals false.
///
public Renewing()
{
}
///
/// Initializes a renewing object with specified allow and OK attributes.
///
public Renewing( bool allowRenewal, bool okForRenewalAfterExpiration )
{
_allowRenewal = allowRenewal;
_okForRenewalAfterExpiration = okForRenewalAfterExpiration;
}
///
/// Returns true if it is allowed to renew this token.
///
///
/// This optional boolean attribute is used to request a renewable token. Default value is true.
///
///
/// Please refer to section 7 in the WS-Trust spec for more details.
///
public bool AllowRenewal
{
get
{
return _allowRenewal;
}
set
{
_allowRenewal = value;
}
}
///
/// Returns true if the requested token can be renewed after it expires.
///
///
/// This optional boolean attriubte is used to indicate that a renewable token is acceptable if
/// the requested duration exceeds the limit of the issuance service. That is, if true, then the
/// token can be renewed after their expiration. Default value is false for security reason.
///
///
/// Please refer to section 7 in the WS-Trust spec for more details.
///
public bool OkForRenewalAfterExpiration
{
get
{
return _okForRenewalAfterExpiration;
}
set
{
_okForRenewalAfterExpiration = value;
}
}
}
}