public SupportingTokenSpecification(SecurityToken token, ReadOnlyCollection <IAuthorizationPolicy> tokenPolicies, SecurityTokenAttachmentMode attachmentMode, SecurityTokenParameters tokenParameters) : base(token, tokenPolicies) { SecurityTokenAttachmentModeHelper.Validate(attachmentMode); this.tokenAttachmentMode = attachmentMode; this.tokenParameters = tokenParameters; }
internal static void Categorize(SecurityTokenAttachmentMode value, out bool isBasic, out bool isSignedButNotBasic, out ReceiveSecurityHeaderBindingModes mode) { SecurityTokenAttachmentModeHelper.Validate(value); switch (value) { case SecurityTokenAttachmentMode.Endorsing: isBasic = false; isSignedButNotBasic = false; mode = ReceiveSecurityHeaderBindingModes.Endorsing; break; case SecurityTokenAttachmentMode.Signed: isBasic = false; isSignedButNotBasic = true; mode = ReceiveSecurityHeaderBindingModes.Signed; break; case SecurityTokenAttachmentMode.SignedEncrypted: isBasic = true; isSignedButNotBasic = false; mode = ReceiveSecurityHeaderBindingModes.Basic; break; case SecurityTokenAttachmentMode.SignedEndorsing: isBasic = false; isSignedButNotBasic = true; mode = ReceiveSecurityHeaderBindingModes.SignedEndorsing; break; default: throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value")); } }
public SupportingTokenProviderSpecification(SecurityTokenProvider tokenProvider, SecurityTokenAttachmentMode attachmentMode, SecurityTokenParameters tokenParameters) { SecurityTokenAttachmentModeHelper.Validate(attachmentMode); TokenProvider = tokenProvider ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(tokenProvider)); SecurityTokenAttachmentMode = attachmentMode; _tokenParameters = tokenParameters ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(tokenParameters)); }
internal SupportingTokenAuthenticatorSpecification(SecurityTokenAuthenticator tokenAuthenticator, SecurityTokenResolver securityTokenResolver, SecurityTokenAttachmentMode attachmentMode, SecurityTokenParameters tokenParameters, bool isTokenOptional) { SecurityTokenAttachmentModeHelper.Validate(attachmentMode); TokenAuthenticator = tokenAuthenticator ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(tokenAuthenticator)); TokenResolver = securityTokenResolver; SecurityTokenAttachmentMode = attachmentMode; TokenParameters = tokenParameters ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(tokenParameters)); _isTokenOptional = isTokenOptional; }
public SupportingTokenProviderSpecification(SecurityTokenProvider tokenProvider, SecurityTokenAttachmentMode attachmentMode, SecurityTokenParameters tokenParameters) { if (tokenProvider == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("tokenProvider"); } SecurityTokenAttachmentModeHelper.Validate(attachmentMode); if (tokenParameters == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("tokenParameters"); } _tokenProvider = tokenProvider; _tokenAttachmentMode = attachmentMode; _tokenParameters = tokenParameters; }
internal SupportingTokenAuthenticatorSpecification(SecurityTokenAuthenticator tokenAuthenticator, SecurityTokenResolver securityTokenResolver, System.ServiceModel.Security.SecurityTokenAttachmentMode attachmentMode, SecurityTokenParameters tokenParameters, bool isTokenOptional) { if (tokenAuthenticator == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("tokenAuthenticator"); } SecurityTokenAttachmentModeHelper.Validate(attachmentMode); if (tokenParameters == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("tokenParameters"); } this.tokenAuthenticator = tokenAuthenticator; this.tokenResolver = securityTokenResolver; this.tokenAttachmentMode = attachmentMode; this.tokenParameters = tokenParameters; this.isTokenOptional = isTokenOptional; }