Keycloak stuck redirect loop after first login

Hello!
I have been trying to secure a java EE application using Keycloak and Azure AD as identity provider.
Following several guides and the official documentation i have se it up using the Java Servlet Filter Adapter.

Everything seems to work fine except every time i login with Azure i get stuck on a redirect loop.
If then i reload the page (by pressing insert on the url) the redirection goes on smoothly.

Any idea on what could cause this?

Which browser are you using? I noticed this behavior in an Angular app with Firefox and the problem went away with Chrome.