Multi-Tenant Spring Security Integration

  • Authors: Lim Chee Kin, Steve Ronderos
0 vote
Dependency:
compile ":multi-tenant-spring-security:0.2.1"

 Documentation

Summary

Installation

grails install-plugin multi-tenant-spring-security

Description

Integrates the multi-tenant-core plugin with the spring-security-core plugin, so that the current tenant can be determined from the authenticated principal.

Provides a custom CurrentTenant implementation that uses the security context to identify the current tenant. This allows all users to login from one url instead of having to remember a special url to log in to.

In Config.groovy, your tenant resolver property should look like this:

tenant {
    resolver.type = "springSecurity"
}

You will also need to add the following field to your Spring-Security User Domain Class

Integer userTenantId

This plugin's code is based on the code of multi-tenant-acegi plugin and hosted in github.