auth/validator need to be configured all end points
SunilDev2023 opened this issue · comments
Environment info:
- KrakenD version: Version 3
- System info: Darwin 23.0.0 x86_64
- Hardware specs: 2.9 GHz 6-Core Intel Core i9, 16GB
- Backend technology: Node
Describe what are you trying to do:
Auth Validtor for multiple end points in the global.
Your configuration file:
{
"version": 3,
"name": "Api Gateway",
"port": 8081,
"extra_config": {
"auth/validator": {
"disable": false,
"alg": "RS256",
"jwk_url": "https://keyclock/auth/realms/master/protocol/openid-connect/certs",
"disable_jwk_security": false
}
},
"cache_ttl": "3600s",
"timeout": "2000s",
"endpoints": [
{
"endpoint": "XYZ/Stag/v1/user",
"method": "POST",
"backend": [
{
"url_pattern": "/api/v1/app/user",
"host": ["http://192.168.0.105:8000"]
}
]
}
]
}
krakend run -d -c krakend.json
Globally If I give the validator it is not working. If I give it in each endpoint it works. I have thousands of APIs. I don't want to give in to each endpoint.
[00] 2023/12/15 13:59:53 KRAKEND DEBUG: [ENDPOINT: /XYZ/Stag/v1/login] Building the proxy pipe
[00] 2023/12/15 13:59:53 KRAKEND DEBUG: [BACKEND: /api/v1/app/login] Building the backend pipe
[00] 2023/12/15 13:59:53 KRAKEND DEBUG: [ENDPOINT: /XYZ/Stag/v1/login] Building the http handler
[00] 2023/12/15 13:59:53 KRAKEND DEBUG: [ENDPOINT: /XYZ/Stag/v1/login][JWTSigner] Signer disabled
[00] 2023/12/15 13:59:53 KRAKEND INFO: [ENDPOINT: /XYZ/Stag/v1/login][JWTValidator] Validator disabled for this endpoint
Hi @SunilDev2023, the purpose of the flexible configuration is for you to not worry about duplicating code: https://www.krakend.io/docs/configuration/flexible-config/
It is fine in loading a configuration with thousands of endpoints.
You cannot write the components configuration in the level that better suits you, but where they have been created for
This issue was marked as resolved a long time ago and now has been automatically locked as there has not been any recent activity after it. You can still open a new issue and reference this link.