Exemplo n.º 1
0
        public AuthenticationHeaderValue GenerateAuthorizationHeader(IRequest request)
        {
            if (request.RequiresAuthentication())
            {
                var oAuthClient = new OAuthClient(new TwitterProvider(request.ConsumerKey, request.ConsumerSecret, null));

                AuthenticationHeaderValue header = oAuthClient.SignRequest(
                    request.HttpMethod,
                    GenerateUri(request),
                    request.AccessToken,
                    request.GetContent(),
                    request.AccessTokenSecret);

                return header;
            }
            else
            {
                return null;
            }
        }