[英]How to configure IdentiyServer settings on appSettings.json of .NET Core?
I use IdentityServer in my Angular app based on .NET Core and I am trying to set some of the parameters like client_id
, redirect_uri
, authority
in appSettings.json
file.我在基于 .NET Core 的 Angular 应用程序中使用 IdentityServer,我正在尝试在
appSettings.json
文件中设置一些参数,例如client_id
、 redirect_uri
、 authority
。
"IdentityServer": {
"Key": {
"Type": "Development"
},
"Authentication": {
"Authority": "localhost:8081",
"ClientId": "localhost:8081",
"AppIdUri": "localhost:8081"
}
}
So, how can I do this?那么,我该怎么做呢?
I need to set these parameters via appSettings.json
and retrieve them when using the following url: https://localhost:8081/_configuration/DemoProject.Web
I need to set these parameters via
appSettings.json
and retrieve them when using the following url: https://localhost:8081/_configuration/DemoProject.Web
You can call your settings in your code like this:您可以像这样在代码中调用您的设置:
string ClientId = Configuration["IdentityServer:Authentication:ClientId"];
I hope this helps.我希望这有帮助。 If it is not what you ment let me know.
如果不是你说的,请告诉我。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.