JWT Bearer - Token Validation Parameter for each p

2019-08-17 05:06发布

问题:

I am working on a MultiTennat SaaS applicaiton in .Net Core + Kestral + Reverse Proxy with Apache on Linux.

My application will start on multiple ports:

http://localhost:50001
http://localhost:50002
...
http://localhost:5000(n)

Each port, as shown above, will be linked to a fully qualified domain name which will be accessed by different customer.

http://localhost:50001  <--> www.customer1.com
http://localhost:50002  <--> www.customer2.com
...
http://localhost:5000(n)  <--> www.customer(n).com

Now when moving this approach I am having problem with JWT Bearer token authentication, it configure the Token Validation Parameters only for the first domain http://localhost:50001, and for rest of the domains it gives 401 as the Issuer, Audience and Secret key is different for rest of the ports on kestral.

I want to have different Issuer, Audience and Secret key for each of the port. i.e.

Following is my tenant JWT configuration file:

{
"Issuer": "http://localhost:50001",
"Audience": "http://localhost:50001",
"SecretKey": "SecretKeyFor5001"
},
{
"Issuer": "http://localhost:50002",
"Audience": "http://localhost:50002",
"SecretKey": "SecretKeyFor5002"
}