SAML with SSO extension triggering twice

I am developing an SSO Extension so that I can have SSO with Keycloak across applications.

OIDC/OAuth2 works very well.

But I am struggling with SAML. It works, but it seems that the form submission is always triggered twice.

I use decisionHandler(.cancel) to stop the form submission and redirect it to the browser. I still get the form submitted both by the extension and by the browser.

At some point I tried to allow the form submission in the Extension so that I get the redirect with the response to the browser. It still triggered another submission.

Does anyone experience this issue?

SAML with SSO extension triggering twice
 
 
Q