Xamarin Public Jenkins (auto-signing) e79aa3c0ed Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
2016-08-03 10:59:49 +00:00

65 lines
1.8 KiB
C#

//----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace System.ServiceModel.Security
{
public sealed class WindowsServiceCredential
{
bool allowAnonymousLogons = SspiSecurityTokenProvider.DefaultAllowUnauthenticatedCallers;
bool includeWindowsGroups = SspiSecurityTokenProvider.DefaultExtractWindowsGroupClaims;
bool isReadOnly;
internal WindowsServiceCredential()
{
// empty
}
internal WindowsServiceCredential(WindowsServiceCredential other)
{
this.allowAnonymousLogons = other.allowAnonymousLogons;
this.includeWindowsGroups = other.includeWindowsGroups;
this.isReadOnly = other.isReadOnly;
}
public bool AllowAnonymousLogons
{
get
{
return this.allowAnonymousLogons;
}
set
{
ThrowIfImmutable();
this.allowAnonymousLogons = value;
}
}
public bool IncludeWindowsGroups
{
get
{
return this.includeWindowsGroups;
}
set
{
ThrowIfImmutable();
this.includeWindowsGroups = value;
}
}
internal void MakeReadOnly()
{
this.isReadOnly = true;
}
void ThrowIfImmutable()
{
if (this.isReadOnly)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.ObjectIsReadOnly)));
}
}
}
}