Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 083F6183B9 for ; Fri, 9 Oct 2015 01:31:52 +0000 (UTC) Received: (qmail 61845 invoked by uid 500); 9 Oct 2015 01:31:50 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 61768 invoked by uid 500); 9 Oct 2015 01:31:50 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 61756 invoked by uid 99); 9 Oct 2015 01:31:50 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Oct 2015 01:31:50 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id AC891C0F5F for ; Fri, 9 Oct 2015 01:31:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.901 X-Spam-Level: **** X-Spam-Status: No, score=4.901 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, KAM_BADIPHTTP=2, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, WEIRD_PORT=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id oJumTpLKxVEW for ; Fri, 9 Oct 2015 01:31:37 +0000 (UTC) Received: from mail-yk0-f170.google.com (mail-yk0-f170.google.com [209.85.160.170]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 16601204D9 for ; Fri, 9 Oct 2015 01:31:37 +0000 (UTC) Received: by ykec126 with SMTP id c126so28782737yke.2 for ; Thu, 08 Oct 2015 18:31:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=7b8frpdlZnsi14syhUEDNtyt6d+aBinvwopUhDK3ZgA=; b=bvyn/g6Bn/mZ7mehGqQHsfw49AYLlHlWLtkq0b49qjl61abdMDaoj5cdEAlZocXqs5 RXm95BvsFU7Jiy9cyFF0+6H0TBusyJn7gu6S/Hm90MDU5jzbQfTEI1+2t+n6Wt6qDu6X k7z8de/8l93sfN6Vo15p84FssAaHlU7xN36qLJfTikBEEsiKi0dtxtlehEqPk7plfBTd DebKlK/kb2UW1h8jmyedkJ4R3Fr2orB9WgfiwZ8jHwmnu5ceLa3rkPmkRy/50uGQIEgE 77mYSoIlh7/wd8qDXkylqN2H8oAPiW4wibAW1ETqbZiC3xv1u75f7RKv+S3vUK+korh9 esRw== MIME-Version: 1.0 X-Received: by 10.129.70.195 with SMTP id t186mr8140362ywa.4.1444354290341; Thu, 08 Oct 2015 18:31:30 -0700 (PDT) Received: by 10.37.215.150 with HTTP; Thu, 8 Oct 2015 18:31:30 -0700 (PDT) In-Reply-To: <56153F26.2090506@posteo.de> References: <56153F26.2090506@posteo.de> Date: Fri, 9 Oct 2015 14:31:30 +1300 Message-ID: Subject: Re: Getting session cookie From: Jamie Diprose To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=001a114c7f1467df550521a1f06f --001a114c7f1467df550521a1f06f Content-Type: text/plain; charset=UTF-8 Cool, thanks guys! Klaus you were right, it works now :) On Thu, Oct 8, 2015 at 4:49 AM, Klaus Trainer wrote: > Hi Jamie! > > Checking CORS settings is always a good idea in such context ;) > > Have you checked that the `credentials` configuration in the `cors` > section (see > > http://docs.couchdb.org/en/latest/config/http.html?highlight=cors#cors/credentials > ) > is set to `true`? > > Also note that you need to set the `withCredentials` property on the > XMLHttpRequest object to `true` as well. > > Cheers, > Klaus > > > On 10/06/2015 04:19 AM, Jamie Diprose wrote: > > Hi > > > > I'm trying to get the session data using the CouchDB jQuery API from a > web > > application, but the userCtx.name variable is always null. The web > > application runs on a different port to CouchDB. > > > > Authentication with couchdb via Javascript is working fine; I'm using > > the CouchDB-XO_Auth > > plugin . Once the user is > > logged in via the CouchDB-XO_auth plugin, they show up as logged in when > > requesting the session: http://127.0.0.1:5984/_session/ > > > > > {"ok":true,"userCtx":{"name":"awesomeuser","roles":[]},"info":{"authentication_db":"_users","authentication_handlers":["oauth","cookie","default"],"authenticated":"cookie"}} > > > > > > But if I request the session from my web application I get the following > > data: > > > > > {"ok":true,"userCtx":{"name":"null","roles":["_admin"]},"info":{"authentication_db":"_users","authentication_handlers":["oauth","cookie","default"],"authenticated":"default"}} > > > > > > Does anyone have any ideas what could be going wrong? E.g. some cors > > related settings that stops you from being able to grab the session > cookie > > from another domain? > > > > Thanks for your help > > > > Jamie > > > --001a114c7f1467df550521a1f06f--