JWT Bearer - Token Validation Parameter for each port .Net Core Kestral

落爺英雄遲暮 提交于 2019-12-11 14:17:32

问题


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"
}

来源:https://stackoverflow.com/questions/55606855/jwt-bearer-token-validation-parameter-for-each-port-net-core-kestral

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!