From f4d8047e3b619e2d6a5ddd9e6d639a72c8d4e207 Mon Sep 17 00:00:00 2001 From: Matt Connew Date: Fri, 2 Oct 2020 14:19:27 -0700 Subject: [PATCH] Fix casing for WCF owned classes WsXxxx->WSXxxx --- .../WSFederationHttpBindingTests.cs | 4 +- .../ref/System.ServiceModel.Federation.cs | 34 ++++++++-------- .../WSTrustChannelSecurityTokenProvider.cs | 40 +++++++++---------- .../Federation/WsFederationBindingElement.cs | 16 ++++---- .../Federation/WsFederationHttpBinding.cs | 24 +++++------ .../WsTrustChannelClientCredentials.cs | 12 +++--- .../WsTrustChannelSecurityTokenManager.cs | 16 ++++---- .../Federation/WsTrustTokenParameters.cs | 8 ++-- 8 files changed, 77 insertions(+), 77 deletions(-) diff --git a/src/System.Private.ServiceModel/tests/Scenarios/Binding/WS/FederationHttp/WSFederationHttpBindingTests.cs b/src/System.Private.ServiceModel/tests/Scenarios/Binding/WS/FederationHttp/WSFederationHttpBindingTests.cs index a908a14635e..c2e02cbcacc 100644 --- a/src/System.Private.ServiceModel/tests/Scenarios/Binding/WS/FederationHttp/WSFederationHttpBindingTests.cs +++ b/src/System.Private.ServiceModel/tests/Scenarios/Binding/WS/FederationHttp/WSFederationHttpBindingTests.cs @@ -37,8 +37,8 @@ public static void WSFederationHttpBindingTests_Succeeds() var issuerBinding = new WSHttpBinding(SecurityMode.Transport); issuerBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic; - WsFederationHttpBinding federationBinding = new WsFederationHttpBinding( - new WsTrustTokenParameters + WSFederationHttpBinding federationBinding = new WSFederationHttpBinding( + new WSTrustTokenParameters { IssuerAddress = issuerAddress, IssuerBinding = issuerBinding, diff --git a/src/System.ServiceModel.Federation/ref/System.ServiceModel.Federation.cs b/src/System.ServiceModel.Federation/ref/System.ServiceModel.Federation.cs index 7083133a459..86d99168b99 100644 --- a/src/System.ServiceModel.Federation/ref/System.ServiceModel.Federation.cs +++ b/src/System.ServiceModel.Federation/ref/System.ServiceModel.Federation.cs @@ -25,53 +25,53 @@ public SamlAssertionKeyIdentifierClause(string assertionId) : base(assertionId, namespace System.ServiceModel.Federation { - internal class WsFederationBindingElement : System.ServiceModel.Channels.BindingElement + internal class WSFederationBindingElement : System.ServiceModel.Channels.BindingElement { - public WsFederationBindingElement(WsTrustTokenParameters wsTrustTokenParameters, System.ServiceModel.Channels.SecurityBindingElement securityBindingElement) { } - public WsTrustTokenParameters WsTrustTokenParameters { get => default; } + public WSFederationBindingElement(WSTrustTokenParameters wsTrustTokenParameters, System.ServiceModel.Channels.SecurityBindingElement securityBindingElement) { } + public WSTrustTokenParameters WSTrustTokenParameters { get => default; } public System.ServiceModel.Channels.SecurityBindingElement SecurityBindingElement { get => default; } public override System.ServiceModel.Channels.BindingElement Clone() => default; public override T GetProperty(System.ServiceModel.Channels.BindingContext context) => default; public override System.ServiceModel.Channels.IChannelFactory BuildChannelFactory(System.ServiceModel.Channels.BindingContext context) => default; } - public class WsFederationHttpBinding : System.ServiceModel.WSHttpBinding + public class WSFederationHttpBinding : System.ServiceModel.WSHttpBinding { - public WsFederationHttpBinding(WsTrustTokenParameters wsTrustTokenParameters) : base(System.ServiceModel.SecurityMode.TransportWithMessageCredential) { } - public WsTrustTokenParameters WsTrustTokenParameters { get => default; } + public WSFederationHttpBinding(WSTrustTokenParameters wsTrustTokenParameters) : base(System.ServiceModel.SecurityMode.TransportWithMessageCredential) { } + public WSTrustTokenParameters WSTrustTokenParameters { get => default; } protected override System.ServiceModel.Channels.SecurityBindingElement CreateMessageSecurity() => default; public override System.ServiceModel.Channels.BindingElementCollection CreateBindingElements() => default; protected override System.ServiceModel.Channels.TransportBindingElement GetTransport() => default; } - public class WsTrustChannelClientCredentials : System.ServiceModel.Description.ClientCredentials + public class WSTrustChannelClientCredentials : System.ServiceModel.Description.ClientCredentials { - public WsTrustChannelClientCredentials() : base() { } - public WsTrustChannelClientCredentials(System.ServiceModel.Description.ClientCredentials clientCredentials) : base(clientCredentials) { } - protected WsTrustChannelClientCredentials(WsTrustChannelClientCredentials other) : base(other) { } + public WSTrustChannelClientCredentials() : base() { } + public WSTrustChannelClientCredentials(System.ServiceModel.Description.ClientCredentials clientCredentials) : base(clientCredentials) { } + protected WSTrustChannelClientCredentials(WSTrustChannelClientCredentials other) : base(other) { } public System.ServiceModel.Description.ClientCredentials ClientCredentials { get => default; private set { } } protected override System.ServiceModel.Description.ClientCredentials CloneCore() => default; public override System.IdentityModel.Selectors.SecurityTokenManager CreateSecurityTokenManager() => default; } - public class WsTrustChannelSecurityTokenManager : System.ServiceModel.ClientCredentialsSecurityTokenManager + public class WSTrustChannelSecurityTokenManager : System.ServiceModel.ClientCredentialsSecurityTokenManager { - public WsTrustChannelSecurityTokenManager(WsTrustChannelClientCredentials wsTrustChannelClientCredentials) : base(wsTrustChannelClientCredentials) { } + public WSTrustChannelSecurityTokenManager(WSTrustChannelClientCredentials wsTrustChannelClientCredentials) : base(wsTrustChannelClientCredentials) { } public override System.IdentityModel.Selectors.SecurityTokenProvider CreateSecurityTokenProvider(System.IdentityModel.Selectors.SecurityTokenRequirement tokenRequirement) => default; } - public class WsTrustChannelSecurityTokenProvider : System.IdentityModel.Selectors.SecurityTokenProvider + public class WSTrustChannelSecurityTokenProvider : System.IdentityModel.Selectors.SecurityTokenProvider { - public WsTrustChannelSecurityTokenProvider(System.IdentityModel.Selectors.SecurityTokenRequirement tokenRequirement) { } + public WSTrustChannelSecurityTokenProvider(System.IdentityModel.Selectors.SecurityTokenRequirement tokenRequirement) { } protected virtual Microsoft.IdentityModel.Protocols.WsTrust.WsTrustRequest CreateWsTrustRequest() => default; protected override System.IdentityModel.Tokens.SecurityToken GetTokenCore(TimeSpan timeout) => default; public override bool SupportsTokenCancellation => default; public override bool SupportsTokenRenewal => default; } - public class WsTrustTokenParameters : System.ServiceModel.Security.Tokens.IssuedSecurityTokenParameters + public class WSTrustTokenParameters : System.ServiceModel.Security.Tokens.IssuedSecurityTokenParameters { public static readonly bool DefaultCacheIssuedTokens = default; public static readonly int DefaultIssuedTokenRenewalThresholdPercentage = default; public static readonly TimeSpan DefaultMaxIssuedTokenCachingTime = default; public static readonly System.IdentityModel.Tokens.SecurityKeyType DefaultSecurityKeyType = default; - public WsTrustTokenParameters() { } - protected WsTrustTokenParameters(WsTrustTokenParameters other) : base(other) { } + public WSTrustTokenParameters() { } + protected WSTrustTokenParameters(WSTrustTokenParameters other) : base(other) { } protected override System.ServiceModel.Security.Tokens.SecurityTokenParameters CloneCore() => default; public System.Collections.Generic.ICollection AdditionalRequestParameters => default; public bool CacheIssuedTokens { get => default; set { } } diff --git a/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WSTrustChannelSecurityTokenProvider.cs b/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WSTrustChannelSecurityTokenProvider.cs index 09b7d1d2897..2283efc28ec 100644 --- a/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WSTrustChannelSecurityTokenProvider.cs +++ b/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WSTrustChannelSecurityTokenProvider.cs @@ -29,7 +29,7 @@ namespace System.ServiceModel.Federation /// /// Custom WSTrustChannelSecurityTokenProvider that returns a SAML assertion /// - public class WsTrustChannelSecurityTokenProvider : SecurityTokenProvider + public class WSTrustChannelSecurityTokenProvider : SecurityTokenProvider { private const int DefaultPublicKeySize = 1024; private const string Namespace = "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement"; @@ -38,20 +38,20 @@ public class WsTrustChannelSecurityTokenProvider : SecurityTokenProvider private const string SecurityBindingElementProperty = Namespace + "/SecurityBindingElement"; private const string TargetAddressProperty = Namespace + "/TargetAddress"; - //private readonly WsTrustTokenParameters _issuedTokenParameters; + //private readonly WSTrustTokenParameters _issuedTokenParameters; private SecurityKeyEntropyMode _keyEntropyMode; private ChannelFactory _channelFactory; private readonly SecurityAlgorithmSuite _securityAlgorithmSuite; private WsSerializationContext _requestSerializationContext; - public WsTrustChannelSecurityTokenProvider(SecurityTokenRequirement tokenRequirement) + public WSTrustChannelSecurityTokenProvider(SecurityTokenRequirement tokenRequirement) { SecurityTokenRequirement = tokenRequirement ?? throw new ArgumentNullException(nameof(tokenRequirement)); SecurityTokenRequirement.TryGetProperty(SecurityAlgorithmSuiteProperty, out _securityAlgorithmSuite); - WsTrustTokenParameters = SecurityTokenRequirement.GetProperty(IssuedSecurityTokenParametersProperty) as WsTrustTokenParameters; + WSTrustTokenParameters = SecurityTokenRequirement.GetProperty(IssuedSecurityTokenParametersProperty) as WSTrustTokenParameters; InitializeKeyEntropyMode(); SetInboundSerializationContext(); - RequestContext = string.IsNullOrEmpty(WsTrustTokenParameters.RequestContext) ? Guid.NewGuid().ToString() : WsTrustTokenParameters.RequestContext; + RequestContext = string.IsNullOrEmpty(WSTrustTokenParameters.RequestContext) ? Guid.NewGuid().ToString() : WSTrustTokenParameters.RequestContext; } private DateTime AddTicks(DateTime time, long ticks) @@ -81,7 +81,7 @@ private WsTrustResponse CachedResponse private void CacheSecurityTokenResponse(WsTrustRequest request, WsTrustResponse response) { - if (WsTrustTokenParameters.CacheIssuedTokens) + if (WSTrustTokenParameters.CacheIssuedTokens) { // If cached respones are stored in a shared cache in the future, that cache should be written // to here, possibly including serializing the WsTrustResponse if the cache stores byte[] (as @@ -100,7 +100,7 @@ internal virtual ChannelFactory ChannelFactory { if (_channelFactory == null) { - _channelFactory = new ChannelFactory(IssuerBinding, WsTrustTokenParameters.IssuerAddress); + _channelFactory = new ChannelFactory(IssuerBinding, WSTrustTokenParameters.IssuerAddress); if (ClientCredentials != null) { _channelFactory.Endpoint.EndpointBehaviors.Remove(typeof(ClientCredentials)); @@ -121,7 +121,7 @@ protected virtual WsTrustRequest CreateWsTrustRequest() int keySize; string keyType; - switch (WsTrustTokenParameters.KeyType) + switch (WSTrustTokenParameters.KeyType) { case SecurityKeyType.AsymmetricKey: keySize = DefaultPublicKeySize; @@ -140,7 +140,7 @@ protected virtual WsTrustRequest CreateWsTrustRequest() } Entropy entropy = null; - if (WsTrustTokenParameters.KeyType != SecurityKeyType.BearerKey && + if (WSTrustTokenParameters.KeyType != SecurityKeyType.BearerKey && (KeyEntropyMode == SecurityKeyEntropyMode.ClientEntropy || KeyEntropyMode == SecurityKeyEntropyMode.CombinedEntropy)) { byte[] entropyBytes = new byte[keySize / 8]; @@ -173,7 +173,7 @@ protected virtual WsTrustRequest CreateWsTrustRequest() private WsTrustResponse GetCachedResponse(WsTrustRequest request) { - if (WsTrustTokenParameters.CacheIssuedTokens && CachedResponse != null) + if (WSTrustTokenParameters.CacheIssuedTokens && CachedResponse != null) { // If cached responses are read from shared caches in the future, then that cache should be read here // and, if necessary, translated (perhaps via deserialization) into a WsTrustResponse. @@ -397,7 +397,7 @@ private void InitializeKeyEntropyMode() // That scenario does not seem to be needed in .NET Core WsTrust scenarios, so key entropy mode is simply being read from the issuer's // security binding element. If, in the future, it's necessary to change the default (if some scenarios don't have a security binding // element, for example), that could be done by adding a DefaultKeyEntropyMode property to WsTrustChannelCredentials and moving - // the code that calculates KeyEntropyMode out to WsTrustChannelSecurityTokenManager since it can set this property + // the code that calculates KeyEntropyMode out to WSTrustChannelSecurityTokenManager since it can set this property // when it creates the provider and fall back to the credentials' default value if no security binding element is present. KeyEntropyMode = SecurityKeyEntropyMode.CombinedEntropy; SecurityBindingElement securityBindingElement = IssuerBinding?.CreateBindingElements().Find(); @@ -413,7 +413,7 @@ private void InitializeKeyEntropyMode() /// internal Binding IssuerBinding { - get => WsTrustTokenParameters?.IssuerBinding; + get => WSTrustTokenParameters?.IssuerBinding; } private bool IsWsTrustResponseExpired(WsTrustResponse response) @@ -434,8 +434,8 @@ private bool IsWsTrustResponseExpired(WsTrustResponse response) DateTime toTime = responseLifetime.Expires.Value.ToUniversalTime(); long interval = toTime.Ticks - fromTime.Ticks; - long effectiveInterval = (long)((WsTrustTokenParameters.IssuedTokenRenewalThresholdPercentage / (double)100) * interval); - DateTime effectiveExpiration = AddTicks(fromTime, Math.Min(effectiveInterval, WsTrustTokenParameters.MaxIssuedTokenCachingTime.Ticks)); + long effectiveInterval = (long)((WSTrustTokenParameters.IssuedTokenRenewalThresholdPercentage / (double)100) * interval); + DateTime effectiveExpiration = AddTicks(fromTime, Math.Min(effectiveInterval, WSTrustTokenParameters.MaxIssuedTokenCachingTime.Ticks)); return effectiveExpiration < DateTime.UtcNow; } @@ -486,12 +486,12 @@ internal SecurityTokenRequirement SecurityTokenRequirement /// private void SetInboundSerializationContext() { - // WsTrustTokenParameters.MessageSecurityVersion can be checked directly instead of - // extracting MessageSecurityVersion from the issuer binding, because the WsFederationHttpBinding - // creates its security binding element using the MessageSecurityVersion from its WsTrustTokenParameters. - MessageSecurityVersion messageSecurityVersion = WsTrustTokenParameters.MessageSecurityVersion; + // WSTrustTokenParameters.MessageSecurityVersion can be checked directly instead of + // extracting MessageSecurityVersion from the issuer binding, because the WSFederationHttpBinding + // creates its security binding element using the MessageSecurityVersion from its WSTrustTokenParameters. + MessageSecurityVersion messageSecurityVersion = WSTrustTokenParameters.MessageSecurityVersion; if (messageSecurityVersion == null) - messageSecurityVersion = WsTrustTokenParameters.DefaultMessageSecurityVersion; + messageSecurityVersion = WSTrustTokenParameters.DefaultMessageSecurityVersion; if (messageSecurityVersion == null) { @@ -511,6 +511,6 @@ private void SetInboundSerializationContext() public override bool SupportsTokenRenewal => false; - internal WsTrustTokenParameters WsTrustTokenParameters { get; } + internal WSTrustTokenParameters WSTrustTokenParameters { get; } } } diff --git a/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsFederationBindingElement.cs b/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsFederationBindingElement.cs index 9eb1cc88afe..18c8e857805 100644 --- a/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsFederationBindingElement.cs +++ b/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsFederationBindingElement.cs @@ -7,21 +7,21 @@ namespace System.ServiceModel.Federation { - internal class WsFederationBindingElement : BindingElement + internal class WSFederationBindingElement : BindingElement { - public WsFederationBindingElement(WsTrustTokenParameters wsTrustTokenParameters, SecurityBindingElement securityBindingElement) + public WSFederationBindingElement(WSTrustTokenParameters wsTrustTokenParameters, SecurityBindingElement securityBindingElement) { - WsTrustTokenParameters = wsTrustTokenParameters; + WSTrustTokenParameters = wsTrustTokenParameters; SecurityBindingElement = securityBindingElement; } - public WsTrustTokenParameters WsTrustTokenParameters { get; } + public WSTrustTokenParameters WSTrustTokenParameters { get; } public SecurityBindingElement SecurityBindingElement { get; } public override BindingElement Clone() { - return new WsFederationBindingElement(WsTrustTokenParameters, SecurityBindingElement); + return new WSFederationBindingElement(WSTrustTokenParameters, SecurityBindingElement); } public override T GetProperty(BindingContext context) @@ -31,19 +31,19 @@ public override T GetProperty(BindingContext context) public override IChannelFactory BuildChannelFactory(BindingContext context) { - WsTrustChannelClientCredentials trustCredentials = Find(context.BindingParameters); + WSTrustChannelClientCredentials trustCredentials = Find(context.BindingParameters); if (trustCredentials == null) { var clientCredentials = Find(context.BindingParameters); if (clientCredentials != null) { - trustCredentials = new WsTrustChannelClientCredentials(clientCredentials); + trustCredentials = new WSTrustChannelClientCredentials(clientCredentials); context.BindingParameters.Remove(typeof(ClientCredentials)); context.BindingParameters.Add(trustCredentials); } else { - trustCredentials = new WsTrustChannelClientCredentials(); + trustCredentials = new WSTrustChannelClientCredentials(); context.BindingParameters.Add(trustCredentials); } } diff --git a/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsFederationHttpBinding.cs b/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsFederationHttpBinding.cs index 5c8f0af7605..156e45020ef 100644 --- a/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsFederationHttpBinding.cs +++ b/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsFederationHttpBinding.cs @@ -10,16 +10,16 @@ namespace System.ServiceModel.Federation { - public class WsFederationHttpBinding : WSHttpBinding + public class WSFederationHttpBinding : WSHttpBinding { // binding is always TransportWithMessageCredentialy - public WsFederationHttpBinding(WsTrustTokenParameters wsTrustTokenParameters) : base(SecurityMode.TransportWithMessageCredential) + public WSFederationHttpBinding(WSTrustTokenParameters wsTrustTokenParameters) : base(SecurityMode.TransportWithMessageCredential) { - WsTrustTokenParameters = wsTrustTokenParameters ?? throw new ArgumentNullException(nameof(wsTrustTokenParameters)); + WSTrustTokenParameters = wsTrustTokenParameters ?? throw new ArgumentNullException(nameof(wsTrustTokenParameters)); Security.Message.ClientCredentialType = MessageCredentialType.IssuedToken; } - public WsTrustTokenParameters WsTrustTokenParameters + public WSTrustTokenParameters WSTrustTokenParameters { get; } @@ -28,28 +28,28 @@ public WsTrustTokenParameters WsTrustTokenParameters protected override SecurityBindingElement CreateMessageSecurity() { - WsTrustTokenParameters.RequireDerivedKeys = false; + WSTrustTokenParameters.RequireDerivedKeys = false; var result = new TransportSecurityBindingElement { IncludeTimestamp = true, - MessageSecurityVersion = WsTrustTokenParameters.MessageSecurityVersion + MessageSecurityVersion = WSTrustTokenParameters.MessageSecurityVersion }; - if (WsTrustTokenParameters.KeyType == SecurityKeyType.BearerKey) + if (WSTrustTokenParameters.KeyType == SecurityKeyType.BearerKey) { - result.EndpointSupportingTokenParameters.Signed.Add(WsTrustTokenParameters); + result.EndpointSupportingTokenParameters.Signed.Add(WSTrustTokenParameters); } else { - result.EndpointSupportingTokenParameters.Endorsing.Add(WsTrustTokenParameters); + result.EndpointSupportingTokenParameters.Endorsing.Add(WSTrustTokenParameters); } - if (WsTrustTokenParameters.EstablishSecurityContext) + if (WSTrustTokenParameters.EstablishSecurityContext) { var securityContextWrappingElement = new TransportSecurityBindingElement { IncludeTimestamp = true, - MessageSecurityVersion = WsTrustTokenParameters.MessageSecurityVersion + MessageSecurityVersion = WSTrustTokenParameters.MessageSecurityVersion }; securityContextWrappingElement.LocalClientSettings.DetectReplays = false; @@ -70,7 +70,7 @@ protected override SecurityBindingElement CreateMessageSecurity() public override BindingElementCollection CreateBindingElements() { var bindingElementCollection = base.CreateBindingElements(); - bindingElementCollection.Insert(0, new WsFederationBindingElement(WsTrustTokenParameters, SecurityBindingElement)); + bindingElementCollection.Insert(0, new WSFederationBindingElement(WSTrustTokenParameters, SecurityBindingElement)); return bindingElementCollection; } diff --git a/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsTrustChannelClientCredentials.cs b/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsTrustChannelClientCredentials.cs index 486602e0f09..764af2ccd1a 100644 --- a/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsTrustChannelClientCredentials.cs +++ b/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsTrustChannelClientCredentials.cs @@ -12,13 +12,13 @@ namespace System.ServiceModel.Federation /// /// These client credentials class that will serve up a SecurityTokenManager that will use a TrustChannel to get a token from an STS /// - public class WsTrustChannelClientCredentials : ClientCredentials + public class WSTrustChannelClientCredentials : ClientCredentials { /// /// Default constructor /// TODO - do we need this ctor /// - public WsTrustChannelClientCredentials() + public WSTrustChannelClientCredentials() : base() { } @@ -27,7 +27,7 @@ public WsTrustChannelClientCredentials() /// Copy constructor /// /// The WSTrustChannelClientCredentials to create a copy of - protected WsTrustChannelClientCredentials(WsTrustChannelClientCredentials other) + protected WSTrustChannelClientCredentials(WSTrustChannelClientCredentials other) : base(other) { ClientCredentials = other.ClientCredentials; @@ -38,7 +38,7 @@ protected WsTrustChannelClientCredentials(WsTrustChannelClientCredentials other) /// /// /// - public WsTrustChannelClientCredentials(ClientCredentials clientCredentials) + public WSTrustChannelClientCredentials(ClientCredentials clientCredentials) : base(clientCredentials) { // TODO - throw on null @@ -53,7 +53,7 @@ public WsTrustChannelClientCredentials(ClientCredentials clientCredentials) protected override ClientCredentials CloneCore() { - return new WsTrustChannelClientCredentials(this); + return new WSTrustChannelClientCredentials(this); } /// @@ -65,7 +65,7 @@ public override SecurityTokenManager CreateSecurityTokenManager() if (ClientCredentials != null) SecurityTokenManager = ClientCredentials.CreateSecurityTokenManager(); - return new WsTrustChannelSecurityTokenManager((WsTrustChannelClientCredentials)Clone()); + return new WSTrustChannelSecurityTokenManager((WSTrustChannelClientCredentials)Clone()); } internal SecurityTokenManager SecurityTokenManager { get; private set; } diff --git a/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsTrustChannelSecurityTokenManager.cs b/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsTrustChannelSecurityTokenManager.cs index 5a15f751428..1a116944e1d 100644 --- a/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsTrustChannelSecurityTokenManager.cs +++ b/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsTrustChannelSecurityTokenManager.cs @@ -11,20 +11,20 @@ namespace System.ServiceModel.Federation { /// - /// WsTrustChannelSecurityTokenProvider uses WsTrust to obtain a token from an IdentityProvider + /// WSTrustChannelSecurityTokenProvider uses WsTrust to obtain a token from an IdentityProvider /// - public class WsTrustChannelSecurityTokenManager : ClientCredentialsSecurityTokenManager + public class WSTrustChannelSecurityTokenManager : ClientCredentialsSecurityTokenManager { private const string Namespace = "http://schemas.microsoft.com/ws/2006/05/servicemodel/securitytokenrequirement"; private const string IssuedSecurityTokenParametersProperty = Namespace + "/IssuedSecurityTokenParameters"; - private WsTrustChannelClientCredentials _wsTrustChannelClientCredentials; + private WSTrustChannelClientCredentials _wsTrustChannelClientCredentials; /// /// /// /// - public WsTrustChannelSecurityTokenManager(WsTrustChannelClientCredentials wsTrustChannelClientCredentials) + public WSTrustChannelSecurityTokenManager(WSTrustChannelClientCredentials wsTrustChannelClientCredentials) : base(wsTrustChannelClientCredentials) { _wsTrustChannelClientCredentials = wsTrustChannelClientCredentials ?? throw LogHelper.LogArgumentNullException(nameof(wsTrustChannelClientCredentials)); @@ -41,12 +41,12 @@ public override SecurityTokenProvider CreateSecurityTokenProvider(SecurityTokenR throw LogHelper.LogArgumentNullException(nameof(tokenRequirement)); // If the token requirement includes an issued security token parameter of type - // WsTrustTokenParameters, then tokens should be provided by a WsTrustChannelSecurityTokenProvider. + // WSTrustTokenParameters, then tokens should be provided by a WSTrustChannelSecurityTokenProvider. if (tokenRequirement.TryGetProperty(IssuedSecurityTokenParametersProperty, out SecurityTokenParameters issuedSecurityTokenParameters) && - issuedSecurityTokenParameters is WsTrustTokenParameters) + issuedSecurityTokenParameters is WSTrustTokenParameters) { // pass issuedtokenRequirements - return new WsTrustChannelSecurityTokenProvider(tokenRequirement) + return new WSTrustChannelSecurityTokenProvider(tokenRequirement) { ClientCredentials = _wsTrustChannelClientCredentials.ClientCredentials }; @@ -56,7 +56,7 @@ public override SecurityTokenProvider CreateSecurityTokenProvider(SecurityTokenR { return _wsTrustChannelClientCredentials.SecurityTokenManager.CreateSecurityTokenProvider(tokenRequirement); } - // This means ClientCredentials was replaced with WsTrustChannelClientCredentials in the ChannelFactory so defer + // This means ClientCredentials was replaced with WSTrustChannelClientCredentials in the ChannelFactory so defer // to base class to create other token providers. else { diff --git a/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsTrustTokenParameters.cs b/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsTrustTokenParameters.cs index c0281828abd..e122c1f0e41 100644 --- a/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsTrustTokenParameters.cs +++ b/src/System.ServiceModel.Federation/src/System/ServiceModel/Federation/WsTrustTokenParameters.cs @@ -13,7 +13,7 @@ namespace System.ServiceModel.Federation { - public class WsTrustTokenParameters : IssuedSecurityTokenParameters + public class WSTrustTokenParameters : IssuedSecurityTokenParameters { internal const bool DefaultEstablishSecurityContext = true; public static readonly bool DefaultCacheIssuedTokens = true; @@ -29,7 +29,7 @@ public class WsTrustTokenParameters : IssuedSecurityTokenParameters /// /// Values that are used to obtain a token from an IdentityProvider /// - public WsTrustTokenParameters() + public WSTrustTokenParameters() { KeyType = DefaultSecurityKeyType; EstablishSecurityContext = DefaultEstablishSecurityContext; @@ -37,7 +37,7 @@ public WsTrustTokenParameters() MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10; } - protected WsTrustTokenParameters(WsTrustTokenParameters other) : base(other) + protected WSTrustTokenParameters(WSTrustTokenParameters other) : base(other) { foreach (var parameter in other.AdditionalRequestParameters) AdditionalRequestParameters.Add(parameter); @@ -57,7 +57,7 @@ protected WsTrustTokenParameters(WsTrustTokenParameters other) : base(other) protected override SecurityTokenParameters CloneCore() { - return new WsTrustTokenParameters(this); + return new WSTrustTokenParameters(this); } public ICollection AdditionalRequestParameters { get; } = new Collection();