"Redirected you too many times" Error with new subdomain URL format and embedded=true

Hello,

According to the new changes in the Streamlit URL formatting, any public Streamlit link can still be used in iframe by adding embedded=true as a parameter to the embedded URL. This works when there is only one parameter embedded=true is being added to the URL. However, with adding additional parameters to the URL like ?someparam=value&embedded=true will eventually lead to “… redirected you too many times” error.

Here is my example HTML page with iframe:

<html>
<head></head>
<body>
<iframe src="https://streamlit-example-app-ab-testing-streamlit-app-rmlvff.streamlitapp.com/?someparam=value&embedded=true" style="height: 100%; width:100%;">
</iframe>
</body>
</html>

Steps to produce the error:

  1. Leave the page open and visible for at least 5 minutes or more. (in the Network tab you can notice calls to ... api/v1/app/status every 2 seconds)
  2. Upon /api/v1/app/status or /api/v1/app/context returning any failure response, notice the page gets refreshed by redirecting the call through: https://share.streamlit.io/-/auth/app?redirect_uri=https%3A%2F%2Fstreamlit-example-app-ab-testing-streamlit-app-rmlvff.streamlitapp.com%2F%3Fsomeparam%3Dvalue&embedded=true
  3. Next cals the https://streamlit-example-app-ab-testing-streamlit-app-rmlvff.streamlitapp.com/-/login?payload=…
  4. Finally, returns back to the Streamlit app link: https://streamlit-example-app-ab-testing-streamlit-app-rmlvff.streamlitapp.com/?someparam=value but with missing embedded=true.
  5. steps 2 to 4 keeps repeating in a loop.

Screenshot of the network tab:

It seems, only one parameter can be added to the Streamlit URL embedded in iframe.

Thank you!

3 Likes

I also have this problem

2 Likes

Me too!

2 Likes

Did you find out how to solve the problem?

Actually, adding to the new link ?embedded=true fixed the issue for a desktop version… but not for mobile(

1 Like

I think this issue is resolved already. Haven’t tested in mobile view

I am also having this issue. Works fine with ?embedded=true if I am viewing from a computer, but viewing from mobile it is a black screen.

I guess you also use IOS, right?

Yes, I was testing mobile access from an iphone

I created the separate question for this issue, seems it doesnt work only at ios Here is the discussion.

How do I add embedded=true in the iframe tag?

the answer I found is to add “?embedded=true” at the end of the src link.

e.g

1 Like

Hey all, I’ve had this issue before and resolved it by tacking on a query to the url: <iframe
className=“mt-4 w-full h-screen”
src={“https://devtechjr-pneumoscan-model-app-drswsb.streamlit.app/?embedded=true”}
>

This should give perms for your streamlit app to embed itself into your frontend app.

Please let me know if this works!

1 Like

adding “?embedded=true” at the end of the src link worked for me too. thanks

adding ?embedded=true at the end of src link worked for me as well, thank you so much for this

?embedded=true worked for me in desktop

I suggest following Streamlit’s official docs on embedding here.

As you can see, it uses syntax like this:

my-app-name.streamlit.io/?embed=true&embed_options=show_toolbar&embed_options=show_padding

Instead of my-app-name.streamlit.io/?embed_options=show_toolbar,show_padding that comes when pressing “share link” on Streamlit UI.

I think this is an issue that Streamlit team needs to fix on Streamlit’s UI, but I don’t know who or how to @ one of their team.