vymalo / keycloak-webhook

Event-based Webhook plugin for Keycloak
https://blog.ssegning.com
MIT License
29 stars 6 forks source link

Support TLS (https) in http webhook #10

Closed netaskd closed 1 year ago

netaskd commented 1 year ago

Looks like http webhook can not handle https url. Could you please add possibility to use https scheme in http webhook?

keycloak    | 2023-08-24 08:46:47,936 DEBUG [com.vymalo.keycloak.webhook.WebhookEventListenerProviderFactory] (main) Will send http requests to https://example.com/api/v1/auth/keycloak-webhook
...
ERROR [com.vymalo.keycloak.webhook.WebhookEventListenerProvider] (executor-thread-16) Could not send webhook: com.vymalo.keycloak.openapi.client.infrastructure.ClientException: Client error : 404 

if I do request directly, the endpoint returns ok

curl -XPOST -d '{"aaa":"bbb"}' https://example.com/api/v1/auth/keycloak-webhook
200
stephane-segning commented 1 year ago

This is strange. Where I'm doing the tests, this fails with 404 too. The plugin is still working fine :)

➜  ~ curl -XPOST -d '{"aaa":"bbb"}' https://example.com/api/v1/auth/keycloak-webhook
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>404 - Not Found</title>
    </head>
    <body>
        <h1>404 - Not Found</h1>
        <script type="text/javascript" src="//obj.ac.bcon.ecdns.net/ec_tpm_bcon.js"></script>
    </body>
</html>