Return-Path: X-Original-To: apmail-db-derby-user-archive@www.apache.org Delivered-To: apmail-db-derby-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 6EEAA9032 for ; Fri, 20 Apr 2012 23:42:10 +0000 (UTC) Received: (qmail 48460 invoked by uid 500); 20 Apr 2012 23:42:10 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 48433 invoked by uid 500); 20 Apr 2012 23:42:10 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 48426 invoked by uid 99); 20 Apr 2012 23:42:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Apr 2012 23:42:10 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of trejkaz@trypticon.org designates 74.125.82.172 as permitted sender) Received: from [74.125.82.172] (HELO mail-we0-f172.google.com) (74.125.82.172) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Apr 2012 23:42:04 +0000 Received: by werb10 with SMTP id b10so7839023wer.31 for ; Fri, 20 Apr 2012 16:41:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=vQ6hTMi/iWpWGLXzVqPBAU3revLgBZWsm6S+mjYgR6k=; b=di78Ergl7cQxitu8RFkJfcNC+AdD94IzOJjGIgl+wZpvfEyysSjmk1UNrzIREKi7lh cFCwDW79w7kw2BgsOAHBhR9TnSakbICC3hkG/862dsIEnp5UcwFXjgwrghuhy/iBtYDN pq6+C/bGHfYj1BWJqQGj5q+Ki8kw8Ab4QLbG0ntd6NiVCCBNlcJH11uTGHBD+bvQDXK1 xczEVLHPn+UE3g2+V/yex5KEE0L1+lG68Ge7wc/vGqFxWD0L9igU7HhAEMnNaR/dnMib IwF7ezll1gt10Y6uFkF7WlcorTiF0M/DZRx8q9DvYlJo5Z8AME1bNcVtBA57u/tpXBWW Q95w== Received: by 10.180.100.2 with SMTP id eu2mr1840375wib.1.1334965302892; Fri, 20 Apr 2012 16:41:42 -0700 (PDT) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id fn2sm1808938wib.0.2012.04.20.16.41.41 (version=SSLv3 cipher=OTHER); Fri, 20 Apr 2012 16:41:41 -0700 (PDT) Received: by wgbds12 with SMTP id ds12so9789737wgb.31 for ; Fri, 20 Apr 2012 16:41:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.180.77.4 with SMTP id o4mr1748747wiw.17.1334965300428; Fri, 20 Apr 2012 16:41:40 -0700 (PDT) Received: by 10.180.100.170 with HTTP; Fri, 20 Apr 2012 16:41:40 -0700 (PDT) In-Reply-To: <4F9185C6.6020203@oracle.com> References: <4F9185C6.6020203@oracle.com> Date: Sat, 21 Apr 2012 09:41:40 +1000 Message-ID: Subject: Re: User authorisation From: Trejkaz To: Derby Discussion Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlKDDPlN16Qz8YDW2dcGsdanBeDRr0JEwUMbZg8IassD9rWa+cEZ0jTEMrS+ewaYVsX/ojp X-Virus-Checked: Checked by ClamAV on apache.org On Sat, Apr 21, 2012 at 1:50 AM, Rick Hillegas wrote: > 3) ...or something else? Possibly something else. Specifically, the only thing that doesn't really "work" with the way we're doing it now is that if you provide valid credentials but can't access the database, the error Derby passes back to the user is along the lines of "invalid user ID or password. UserAuthenticator only has a boolean return value so it isn't possible to pass the reason for being rejected using solely a UserAuthenticator. Which is why I wondered if there was a second step where a UserAuthoriser would be asked whether a user has authorisation to a database. Then when that returns false, a different error code would presumably come back which indicated a lack of access rather than the login being wrong. It seems this sort of thing does exist at the database level but as far as I can tell this requires setting properties on the database. But in our case it's tricky to do that because we don't want to be subject to authentication when using the database directly, only when going via the network server. In many ways it's tragic that this sort of thing in Derby is done using system properties and not via service setters on NetworkServerControl (even though NetworkServerControl does have an API, it's not an API which looks like it was designed to be embedded.) TX