Apis & Multitenancy

Not applicable

Hi,

My team is working on a multi tenant platform which is already built and in production used by many clients. This platform is currently offered to the end users of our clients (B2B2C model) through web portal which is powered by a set of backend APIs.

Recently our business team decided to offer the platform as a bunch of APIs to potential clients who will then build their own front end instead of using our web portal.

With this objective, we are developing a set of Apigee API proxies that in turn are powered by the same backend apis that our own web portal is powered by.

The consumers of these backend apis (exposed to the end consumers through Apigee proxies) are essentially tenants in our platform and as such our backend apis will require ability to identify which consuming app (of a client aka tenant) is making a particular api request.

One option I have is to make every api signature also take in tenant name as a mandatory query string (or request body) parameter but as almost every api will require it, making it part of query string or request body feels redundant.

The other option I have is that as each of such clients (wishing to build their own frontend but using our backend api) will be registered as a developer app, I somehow try to identify the tenant based on the authorisation token that is included in the incoming api request.

Which according to you is the best strategy and whether is there a better approach to solving this?

Thanks.

0 1 1,464
1 REPLY 1

API Keys seem like a good solution here.

When a client registers to use your API (either through the Developer Portal or by getting in touch with you), a Developer App is created. This contains the name and details of the client.

When the Developer App is associate with an API Product, they receive a key which can be used on every request to the APIs.

Now, you have Analytics in Apigee at a Client level, and you can use a Verify API Key and Assign Message policy to validate the key in Apigee and then replace it with the name of the Tenant based on what they registered.

This approach will also keep out unregistered users.

What are your initial thoughts on this approach?

(link: http://docs.apigee.com/api-services/content/api-keys)