Repository navigation
|
I've already asked this on StackOverflow, but maybe here it'll be more noticable. I'm implementing an endpoint to receive events from Keycloak using a webhook, but I don't know how to validate this request. I see that the request contains a header "X-Keycloak-Signature". Also, I set a WEBHOOK_SECRET. It seems I somehow need to generate this signature from the request and the secret and then compare them. So it looks like this: However, I don't know the algorithm. Here, I tried this one:
But it doesn't work. Does anybody has any ideas? |
Replies: 1 comment
|
I realized that this signature is generated not by Keycloak itself, but by Phasetwo which provides a webhook plugin for me. So that I just looked into its code and found out the algorithm. That is how to generate signature to validate it: |
I realized that this signature is generated not by Keycloak itself, but by Phasetwo which provides a webhook plugin for me.
So that I just looked into its code and found out the algorithm.
That is how to generate signature to validate it: