You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/08/24 15:19:23 UTC

[Bug 53776] New: Multitenancy support for JDBCRealm

https://issues.apache.org/bugzilla/show_bug.cgi?id=53776

          Priority: P2
            Bug ID: 53776
          Assignee: dev@tomcat.apache.org
           Summary: Multitenancy support for JDBCRealm
          Severity: enhancement
    Classification: Unclassified
          Reporter: blama@gmx.net
          Hardware: PC
            Status: NEW
           Version: trunk
         Component: Catalina
           Product: Tomcat 7

Hi,

in order to support multi-tenancy applications, JDBCRealm should get more
options:
See this logintable definition

CREATE TABLE t_login 
    ( 
     id INTEGER NOT NULL,
     tenant_id INTEGER NOT NULL,
     loginname VARCHAR2 (50 CHAR) NOT NULL, 
     sha1hash VARCHAR2 (40 CHAR) NOT NULL, 
     lastlogin DATE, 
     CONSTRAINT PK_login PRIMARY KEY (id),
     CONSTRAINT UC_login_tenant_loginname UNIQUE (tenant_id, loginname)
    );

In order to make every loginname (e.g. "admin") available for every tenant, I
need to include the tenant_id within the UC.
For JDBCRealm login, which does a select with "WHERE loginname = j_username",
this means that it can get many rows as result. Obviously, this can't work out.

So in order have multitenancy support, the <Realm ... /> tag needs two new
parameters, one "tenantColumnName" (no default, only used when included in tag)
and one "tenantId", also with no default.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53776] Multitenancy support for JDBCRealm

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53776

--- Comment #2 from Konstantin Kolinko <kn...@gmail.com> ---
I would not recommend to use JDBCRealm in productive configurations. The
recommended replacement is DataSourceRealm.

> - Create projection-view per tenant
> - ...

Just creating the VIEW is enough, as the table names are configurable. There is
no need to create a separate schema per tenant.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53776] Multitenancy support for JDBCRealm

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53776

--- Comment #1 from S <bl...@gmx.net> ---
I forgot:
Possible workaround for now:
- Leave table DDL as it is
- Create projection-view per tenant
- Create empty schema per tenant
- Grant select on correct view from main schema to each tenant
- Use tenant-schema to handle login (also good practice from security
perspective, as no data is known to Tomcat, Tomcat doesn't need to know)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53776] Multitenancy support for JDBCRealm

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53776

S <bl...@gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|PC                          |All
                 OS|                            |All

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53776] Multitenancy support for JDBCRealm

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53776

S <bl...@gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |blama@gmx.net

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53776] Multitenancy support for JDBCRealm

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53776

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #3 from Mark Thomas <ma...@apache.org> ---
As per previous comment.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org