/
aprogrammer
/
reverse-proxy-ms-yarp
Обзор
Документация
Войти
/
aprogrammer
/
reverse-proxy-ms-yarp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
samples/ReverseProxy.Auth.Sample/appsettings.json
65 строк
2 KB
Miha Zupan
Backport
8087b3e
(#2462)
03 апр 2024, 22:45
Не верифицирован
03 апр 2024, 22:45
3708f4a
Код
Авторство
О чём код?
{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Information", "Microsoft.Hosting.Lifetime": "Information" } }, "AllowedHosts": "*", "Kestrel": { "Endpoints": { "https": { "Url": "https://localhost:5001" }, "http": { "Url": "http://localhost:5000" } } }, "ReverseProxy": { "Clusters": { "cluster1": { "Destinations": { "cluster1/destination1": { "Address": "https://example.com/" } } } }, "Routes": { "DefaultAuthRoute": { "ClusterId": "cluster1", // This route uses the built-in default authorization policy which is to require authenticated users "AuthorizationPolicy": "Default", "Match": { "Path": "/default" } }, "ClaimsAuthRoute": { "ClusterId": "cluster1", // This route requires the "myPolicy" authorization policy which is defined in Startup.cs "AuthorizationPolicy": "myPolicy", "Match": { "Path": "/custom/{*any}" } }, "AnonymousRoute": { "ClusterId": "cluster1", // This route uses the explicit name Anonymous to not require authentication "AuthorizationPolicy": "Anonymous", "Match": { "Path": "/open/{*any}" } }, "Other": { // As the following route does not define an authorization policy, it uses the fallback policy // which is set in Startup.cs to be null, and so not require authentication or claims. "ClusterId": "cluster1", "Match": { "Path": "{**catchall}" } } } } }