public WindowsStreamSecurityUpgradeProvider(WindowsStreamSecurityBindingElement bindingElement,
            BindingContext context, bool isClient)
            : base(context.Binding)
        {
            this.extractGroupsForWindowsAccounts = TransportDefaults.ExtractGroupsForWindowsAccounts;
            this.protectionLevel = bindingElement.ProtectionLevel;
            this.scheme = context.Binding.Scheme;
            this.isClient = isClient;
            this.listenUri = TransportSecurityHelpers.GetListenUri(context.ListenUriBaseAddress, context.ListenUriRelativeAddress);

            SecurityCredentialsManager credentialProvider = context.BindingParameters.Find<SecurityCredentialsManager>();
            if (credentialProvider == null)
            {
                if (isClient)
                {
                    credentialProvider = ClientCredentials.CreateDefaultCredentials();
                }
                else
                {
                    credentialProvider = ServiceCredentials.CreateDefaultCredentials();
                }
            }


            this.securityTokenManager = credentialProvider.CreateSecurityTokenManager();
        }
        public WindowsStreamSecurityUpgradeProvider(WindowsStreamSecurityBindingElement bindingElement,
            BindingContext context, bool isClient)
            : base(context.Binding)
        {
            _extractGroupsForWindowsAccounts = TransportDefaults.ExtractGroupsForWindowsAccounts;
            _protectionLevel = bindingElement.ProtectionLevel;
            _scheme = context.Binding.Scheme;
            _isClient = isClient;
            _listenUri = TransportSecurityHelpers.GetListenUri(context.ListenUriBaseAddress, context.ListenUriRelativeAddress);

            SecurityCredentialsManager credentialProvider = context.BindingParameters.Find<SecurityCredentialsManager>();

            if (credentialProvider == null)
            {
                if (isClient)
                {
                    credentialProvider = ClientCredentials.CreateDefaultCredentials();
                }
                else
                {
                    throw ExceptionHelper.PlatformNotSupported("WindowsStreamSecurityUpgradeProvider for server is not supported.");
                }
            }

            _securityTokenManager = credentialProvider.CreateSecurityTokenManager();
        }
 internal SecurityProtocolFactory(SecurityProtocolFactory factory) : this()
 {
     if (factory == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("factory");
     }
     this.actAsInitiator         = factory.actAsInitiator;
     this.addTimestamp           = factory.addTimestamp;
     this.detectReplays          = factory.detectReplays;
     this.incomingAlgorithmSuite = factory.incomingAlgorithmSuite;
     this.maxCachedNonces        = factory.maxCachedNonces;
     this.maxClockSkew           = factory.maxClockSkew;
     this.outgoingAlgorithmSuite = factory.outgoingAlgorithmSuite;
     this.replayWindow           = factory.replayWindow;
     this.channelSupportingTokenAuthenticatorSpecification = new Collection <SupportingTokenAuthenticatorSpecification>(new List <SupportingTokenAuthenticatorSpecification>(factory.channelSupportingTokenAuthenticatorSpecification));
     this.scopedSupportingTokenAuthenticatorSpecification  = new Dictionary <string, ICollection <SupportingTokenAuthenticatorSpecification> >(factory.scopedSupportingTokenAuthenticatorSpecification);
     this.standardsManager                = factory.standardsManager;
     this.timestampValidityDuration       = factory.timestampValidityDuration;
     this.auditLogLocation                = factory.auditLogLocation;
     this.suppressAuditFailure            = factory.suppressAuditFailure;
     this.serviceAuthorizationAuditLevel  = factory.serviceAuthorizationAuditLevel;
     this.messageAuthenticationAuditLevel = factory.messageAuthenticationAuditLevel;
     if (factory.securityBindingElement != null)
     {
         this.securityBindingElement = (System.ServiceModel.Channels.SecurityBindingElement)factory.securityBindingElement.Clone();
     }
     this.securityTokenManager     = factory.securityTokenManager;
     this.privacyNoticeUri         = factory.privacyNoticeUri;
     this.privacyNoticeVersion     = factory.privacyNoticeVersion;
     this.endpointFilterTable      = factory.endpointFilterTable;
     this.extendedProtectionPolicy = factory.extendedProtectionPolicy;
 }
 public PeerSecurityCredentialsManager(SecurityTokenManager manager, PeerAuthenticationMode mode, bool messageAuth)
 {
     this.mode = PeerAuthenticationMode.Password;
     this.manager = manager;
     this.mode = mode;
     this.messageAuth = messageAuth;
 }
		public void Initialize (SecurityTokenManager manager,
			ChannelProtectionRequirements requirements)
		{
			this.manager = manager;
			if (requirements == null)
				requirements = new ChannelProtectionRequirements ();
			this.requirements = requirements;
		}
		protected MessageSecurityBindingSupport (
			SecurityCapabilities elementSupport,
			SecurityTokenManager manager,
			ChannelProtectionRequirements requirements)
		{
			element_support = elementSupport;
			Initialize (manager, requirements);
		}
예제 #7
0
        private void InitializeSecurityTokenManager(BindingContext context)
        {
            SecurityCredentialsManager manager = context.BindingParameters.Find <SecurityCredentialsManager>();

            if (manager != null)
            {
                this.securityTokenManager = manager.CreateSecurityTokenManager();
            }
        }
        public WindowsStreamSecurityUpgradeProvider(WindowsStreamSecurityBindingElement bindingElement,
            BindingContext context, bool isClient)
            : base(context.Binding)
        {
            Contract.Assert(isClient, ".NET Core and .NET Native does not support server side");

            _extractGroupsForWindowsAccounts = TransportDefaults.ExtractGroupsForWindowsAccounts;
            _protectionLevel = bindingElement.ProtectionLevel;
            _scheme = context.Binding.Scheme;
            _isClient = isClient;
            _listenUri = TransportSecurityHelpers.GetListenUri(context.ListenUriBaseAddress, context.ListenUriRelativeAddress);

            SecurityCredentialsManager credentialProvider = context.BindingParameters.Find<SecurityCredentialsManager>();
            if (credentialProvider == null)
            {
                credentialProvider = ClientCredentials.CreateDefaultCredentials();
            }

            _securityTokenManager = credentialProvider.CreateSecurityTokenManager();
        }
예제 #9
0
    public Result ProcessTransaction(String cardNumber, String cardHolderName, Double amount, String expireDate,
                                     String CAVV, String billingAddress)
    {
        Result            resultObj = Result.None;
        ServiceSoapClient client    = new ServiceSoapClient();
        Transaction       txn       = new Transaction();

        System.IdentityModel.Selectors.SecurityTokenManager token =
            client.ClientCredentials.CreateSecurityTokenManager();
        //client.ClientCredentials.HttpDigest.ClientCredential = new System.Net.NetworkCredential("oriental501", "Welcome123-");
        // set correct credential values
        txn.ExactID  = ConfigurationManager.AppSettings["ExactID"];       // "AE2449-01";
        txn.Password = ConfigurationManager.AppSettings["ExactPassword"]; //"Welcome123-";
        // keyid = 113045

        txn.Transaction_Type = "00";
        txn.Card_Number      = cardNumber;        //"4111111111111111";
        txn.CardHoldersName  = cardHolderName;    // "CSharp NET Sample";
        txn.DollarAmount     = amount.ToString(); // "101.00";
        txn.Expiry_Date      = expireDate;        // "1115";
        txn.CAVV             = CAVV;

        TransactionResult result = client.SendAndCommit(txn);

        ReturnMessage = result.Bank_Message;
        switch (result.Bank_Resp_Code)
        {
        case "100":
            resultObj = Result.Success;
            break;

        default:
            resultObj = Result.Failed;
            break;
        }
        return(resultObj);
    }
예제 #10
0
		public RecipientMessageSecurityBindingSupport (
			SecurityCapabilities elementSupport,
			SecurityTokenManager manager,
			ChannelProtectionRequirements requirements)
			: base (elementSupport, manager, requirements)
		{
		}
 public PeerClientSecurityTokenManager(PeerSecurityManager parent, SecurityTokenManager manager, PeerAuthenticationMode mode, bool messageAuth)
 {
     this.delegateManager = manager;
     this.mode = mode;
     this.messageAuth = messageAuth;
     this.parent = parent;
 }