UserNameSecurityTokenParameters.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //-----------------------------------------------------------------------------
  4. namespace System.ServiceModel.Security.Tokens
  5. {
  6. using System.IdentityModel.Selectors;
  7. using System.ServiceModel;
  8. using System.IdentityModel.Tokens;
  9. using System.ServiceModel.Security;
  10. public class UserNameSecurityTokenParameters : SecurityTokenParameters
  11. {
  12. protected UserNameSecurityTokenParameters(UserNameSecurityTokenParameters other)
  13. : base(other)
  14. {
  15. base.RequireDerivedKeys = false;
  16. }
  17. public UserNameSecurityTokenParameters()
  18. : base()
  19. {
  20. base.RequireDerivedKeys = false;
  21. }
  22. internal protected override bool HasAsymmetricKey { get { return false; } }
  23. internal protected override bool SupportsClientAuthentication { get { return true; } }
  24. internal protected override bool SupportsServerAuthentication { get { return false; } }
  25. internal protected override bool SupportsClientWindowsIdentity { get { return true; } }
  26. protected override SecurityTokenParameters CloneCore()
  27. {
  28. return new UserNameSecurityTokenParameters(this);
  29. }
  30. internal protected override SecurityKeyIdentifierClause CreateKeyIdentifierClause(SecurityToken token, SecurityTokenReferenceStyle referenceStyle)
  31. {
  32. return this.CreateKeyIdentifierClause<SecurityKeyIdentifierClause, LocalIdKeyIdentifierClause>(token, referenceStyle);
  33. }
  34. protected internal override void InitializeSecurityTokenRequirement(SecurityTokenRequirement requirement)
  35. {
  36. requirement.TokenType = SecurityTokenTypes.UserName;
  37. requirement.RequireCryptographicToken = false;
  38. }
  39. }
  40. }