1

I am new to WSO2 and I am tring to make a setup for a POC.

I have a single API that is used by multiple tenants. But for every tenant it must connect to a different endpoint like this https://server:port/api/{tenant}/x/. I am wondering what the best approach is.

I can create a different API for each tenant and configure the endpoints in this version of the API, but I think this will eventually create a lot of overhead if I try to maintain this.

The other approach I tried is by creating a dynamic endpoint and use message mediation. But I can not find how I can base the endpoint on the users domain.

I hope to hear what the best option is to get a manageable situation.

Thanks in advance!

1 Answers1

0

Inside a custom sequence, you can read username (with tenant domain) like this.

<property name="User" expression="$trp:UserName"/>

Ref: http://movingaheadblog.blogspot.com/2016/08/wso2-api-manager-how-to-retrieve.html

Bee
  • 12,251
  • 11
  • 46
  • 73
  • Thank you for the response. It helped me getting the correct solution. But when I use the expression you suggest ($trp:UserName) I get the username without the domain. To get the user with the domain name I used get-property('api.ut.userName'). – Peter de Goederen Jan 03 '18 at 15:10
  • Are you sure the user is a tenant user? – Bee Jan 03 '18 at 15:13