Embedding metabase in java

I have metabase pro licence and I have followed the instructions for embedding an interactive Metabase dashboard from this link, and I wrote a Java/Spring microservice following the instructions. The problem is that when I call the /analytics endpoint, it returns an iframe and then constantly calls the /sso/metabase endpoint in an infinite loop. I don't know what is causing this. For the JWT provider URI in the Metabase configuration, I set it to http://localhost:8080/sso/metabase , enabled embedding, and generated a token using the secret key using jsonwebtoken library. Any help is welcome Embedding metabase in java