示例#1
0
        /// <summary>
        /// Takes an existing httpwebrequest and modifies it's headers according to
        /// the authentication system used.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public override void ApplyAuthenticationToRequest(HttpWebRequest request)
        {
            base.ApplyAuthenticationToRequest(request);

            string header = AuthSubUtil.formAuthorizationHeader(this.Token,
                                                                this.PrivateKey,
                                                                request.RequestUri,
                                                                request.Method);

            request.Headers.Add(header);
        }
示例#2
0
        /////////////////////////////////////////////////////////////////////////////

        //////////////////////////////////////////////////////////////////////
        /// <summary>sets up the correct credentials for this call, pending
        /// security scheme</summary>
        //////////////////////////////////////////////////////////////////////
        protected override void EnsureCredentials()
        {
            HttpWebRequest http = this.Request as HttpWebRequest;

            string header = AuthSubUtil.formAuthorizationHeader(this.factory.Token,
                                                                this.factory.PrivateKey,
                                                                http.RequestUri,
                                                                http.Method);

            this.Request.Headers.Add(header);
        }