Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F019A7A17 for ; Fri, 25 Nov 2011 20:26:04 +0000 (UTC) Received: (qmail 13694 invoked by uid 500); 25 Nov 2011 20:26:04 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 13653 invoked by uid 500); 25 Nov 2011 20:26:04 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 13645 invoked by uid 99); 25 Nov 2011 20:26:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Nov 2011 20:26:04 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Nov 2011 20:26:01 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id CA8B49F0D8 for ; Fri, 25 Nov 2011 20:25:40 +0000 (UTC) Date: Fri, 25 Nov 2011 20:25:40 +0000 (UTC) From: "Filipe Manana (Updated) (JIRA)" To: dev@couchdb.apache.org Message-ID: <419211119.12611.1322252740845.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1900913832.31589.1319810432639.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (COUCHDB-1320) OAuth authentication doesn't work with VHost entry MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COUCHDB-1320?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Filipe Manana updated COUCHDB-1320: ----------------------------------- Attachment: fdmanana-0001-Fix-OAuth-authentication-with-VHosts-URL-rewr= iting.patch Martin, I've spent some time testing this well. The patch you provided didn't seem to fix it. I added some tests to confirm the fix, which uses VHosts + URL rewriting. A big part of the problem here is that the OAuth handler is executed 2 time= s: 1) after the VHost dispatch happens and before the rewriter is called; 2) after the rewriter is called. This time the OAuth handler gets a rewritt= en patch which will cause the OAuth signature check to fail, since the clie= nt's provided signature is based on the first path (pre VHost dispatch, and= pre rewriting phase) The patch I'm attaching here explains this in the commit message. Also, leaving it for Beno=C3=AEt to confirm if this is an ok fix. =20 > OAuth authentication doesn't work with VHost entry > -------------------------------------------------- > > Key: COUCHDB-1320 > URL: https://issues.apache.org/jira/browse/COUCHDB-1320 > Project: CouchDB > Issue Type: Bug > Components: HTTP Interface > Affects Versions: 1.1 > Environment: Ubuntu > Reporter: Martin Higham > Assignee: Filipe Manana > Attachments: Fix-OAuth-that-broke-with-vhost.patch, fdmanana-0001= -Fix-OAuth-authentication-with-VHosts-URL-rewriting.patch > > > If you have a vhost entry that modifies the path (such as my host.com =3D= /mainDB/_design/main/_rewrite ) trying to authenticate a request to this h= ost using OAuth fails. > couch_httpd_oauth uses the modified path rather than the original x-couch= db-vhost-path when calculating the signature. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira