/// <summary>
        /// Login by using bearer token
        /// </summary>
        /// <param name="xmlBearerToken">bearer saml token</param>
        private SecurityPolicyAssertion GetSecurityPolicyAssertionForBearerToken(XmlElement xmlBearerToken)
        {
            Console.WriteLine();
            Console.WriteLine("Trying to login to server '{0}' by using Bearer token ...", _service.Url);

            //When this property is set to true, client requests that use the POST method
            //expect to receive a 100-Continue response from the server to indicate that
            //the client should send the data to be posted. This mechanism allows clients
            //to avoid sending large amounts of data over the network when the server,
            //based on the request headers, intends to reject the request
            ServicePointManager.Expect100Continue = true;
            ServicePointManager.SecurityProtocol  = SecurityProtocolType.Tls;

            var customSecurityAssertion = new CustomSecurityAssertionBearer();

            customSecurityAssertion.BinaryToken = xmlBearerToken;

            return(customSecurityAssertion);
        }
Пример #2
0
 /// <summary>
 /// Creates CustomSecurityClientOutputFilterBearer object
 /// </summary>
 /// <param name="parentAssertion">Parent assertion</param>
 public CustomSecurityClientOutputFilterBearer(CustomSecurityAssertionBearer parentAssertion)
     : base(parentAssertion.ServiceActor, true)
 {
     issuedToken = new IssuedToken(parentAssertion.BinaryToken);
 }
 /// <summary>
 /// Creates CustomSecurityClientOutputFilterBearer object
 /// </summary>
 /// <param name="parentAssertion">Parent assertion</param>
 public CustomSecurityClientOutputFilterBearer(CustomSecurityAssertionBearer parentAssertion)
     : base(parentAssertion.ServiceActor, true)
 {
     issuedToken = new IssuedToken(parentAssertion.BinaryToken);
 }
        /// <summary>
        /// Login by using bearer token
        /// </summary>
        /// <param name="xmlBearerToken">bearer saml token</param>
        private SecurityPolicyAssertion GetSecurityPolicyAssertionForBearerToken(XmlElement xmlBearerToken)
        {
            Console.WriteLine();
            Console.WriteLine("Trying to login to server '{0}' by using Bearer token ...", _service.Url);

            //When this property is set to true, client requests that use the POST method 
            //expect to receive a 100-Continue response from the server to indicate that 
            //the client should send the data to be posted. This mechanism allows clients 
            //to avoid sending large amounts of data over the network when the server, 
            //based on the request headers, intends to reject the request
            ServicePointManager.Expect100Continue = true;
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;

            var customSecurityAssertion = new CustomSecurityAssertionBearer();
            customSecurityAssertion.BinaryToken = xmlBearerToken;

            return customSecurityAssertion;
        }