Trouble when using jwk locally file

27 views
Skip to first unread message

Vũ Thành Trung

unread,
May 17, 2024, 5:06:27 AMMay 17
to KrakenD Community
Dear KrakenD team,
I'm trying config for KrakenD CE V2.6.2 for RND, and I get a trouble with jwk locally file.
My JWT validator in this format:
               "auth/validator": {
  "alg": "HS256",
  "jwk_local_path": "/etc/krakend/jwk.txt",
  "secret_url": "value of field kid in jwk.txt",
  "cypher_key":"value of file k in jwk.txt",
  "operation_debug": true
}

When I start krakend, i get error detail in the below:
[root@am-rabbitmq-01 krakend]# sudo docker run -p 8080:8080 -v "${PWD}:/etc/krakend/" devopsfaith/krakend run -d -c /etc/krakend/krakend.json
Parsing configuration file: /etc/krakend/krakend.json
[KRAKEND] 2024/05/17 - 08:51:36.332 ▶ DEBUG [SERVICE: telemetry/logging] Improved logging started.
[KRAKEND] 2024/05/17 - 08:51:36.332 ▶ INFO Starting KrakenD v2.6.2
[KRAKEND] 2024/05/17 - 08:51:36.333 ▶ INFO Working directory is /etc/krakend
[KRAKEND] 2024/05/17 - 08:51:36.333 ▶ DEBUG [SERVICE: Gin] Debug enabled
[KRAKEND] 2024/05/17 - 08:51:36.333 ▶ INFO Starting the KrakenD instance
[KRAKEND] 2024/05/17 - 08:51:36.333 ▶ DEBUG [ENDPOINT: /test-uat/notification] Building the proxy pipe
[KRAKEND] 2024/05/17 - 08:51:36.334 ▶ DEBUG [BACKEND: /api/pushNoti/cafeSonLa] Building the backend pipe
[KRAKEND] 2024/05/17 - 08:51:36.334 ▶ DEBUG [ENDPOINT: /test-uat/notification] Building the http handler
[KRAKEND] 2024/05/17 - 08:51:36.334 ▶ DEBUG [ENDPOINT: /test-uat/notification][JWTSigner] Signer disabled
[KRAKEND] 2024/05/17 - 08:51:36.334 ▶ DEBUG [ENDPOINT: /test-uat/notification][Ratelimit] Rate limit enabled. MaxRate: 50.000000, Capacity: 100
[KRAKEND] 2024/05/17 - 08:51:36.334 ▶ WARNING [ENDPOINT: /test-uat/notification][JWTValidator] Unable to parse the configuration: illegal base64 data at input byte 2
[KRAKEND] 2024/05/17 - 08:51:36.334 ▶ DEBUG [SERVICE: Gin] Enabling the auto options endpoints
[KRAKEND] 2024/05/17 - 08:51:36.334 ▶ INFO [SERVICE: Gin] Listening on port: 8080
[KRAKEND] 2024/05/17 - 08:51:41.334 ▶ DEBUG [SERVICE: Telemetry] Registering usage stats for Cluster ID j5UkR5xxR1OMZTcxCVi0HZvKogwfRRwMhSFHY27cfsU=

Please help me to solve it.
jwk.txt
krakend.json

Patrick Karlsson

unread,
May 20, 2024, 4:48:29 AMMay 20
to KrakenD Community, Vũ Thành Trung
It seems that your key Is not base64 encoded? 
"k": "2a_19ulXv1J5kky4UvJEvidS7KSRUbuLZJt_cqXDkANhk4Vr8Wx0bH5mpASGMPNlnseTnuK0Ag2qPX16LIKSgfxmdxMCuyXVrHjfHgtAn3weU84Cyo10JJzrMuD_RfRTwctY8pOiU3Wsx_tW77tN3PIqGpIOs6ipVO8aCYVdU8qwxXakU0QL7tmeRl8FfTqAqjNzd-51vkDMfcVtcciZgZSl_Lo0h6a49lM8adgbb913EGCFPiZeTN9MgLR4E1BB--AJfJIpLI3wVTYH7e_C1LyAHSzQAczRMuQuQX2c8fP7LUIYbz8bED-IFoKqJM8o7QlNybcR7VEtDToKeiI4Eg",

Patrick Karlsson

unread,
May 20, 2024, 4:55:14 AMMay 20
to KrakenD Community, Patrick Karlsson, Vũ Thành Trung
You also need to base64 encode your alg value I think
Reply all
Reply to author
Forward
0 new messages