Login session storage not working while embed the application in an html iframe tag

In my application , I am using keycloak API for authentication purpose . A session variable is there when login to the application . But when the application is embed to an iframe and every time I refresh the page , it will show the login page . And while inspecting there is no session variable for cookie.

  1. Cookie details on inspect - Application within the appsmith instance.

  1. Cookie details on inspect - Application embed with external html page.

  1. Is your application public ?
    If application is private that you might face this issue. [Bug]: Private app when embedded in iframe does not authenticate user on login · Issue #11603 · appsmithorg/appsmith · GitHub

  2. Have you implemented keycloak API for authentication purpose inside your appsmith’s application?
    if yes then SESSION in cookie is appsmith authentication cookie and not related to your application. Ideally if you need to store your authentication key in browser to persist then appsmith store can be used Store Value - Appsmith

@Rishabh_Rathod Hi , my case related to the second scenario you mentioned above. I know that SESSION in cookie is from appsmith . My question is when my application is embed to an external page , that cookie is not setting. Is there a way to persist that SESSION cookie in an emebeded application also.

@Ginjo This ideally shouldn’t happen for public applications. Can you confirm if your application is public and if yes, can you please invite support@appsmith.com to your application also mention the Org name and app name to help us find your application.

Hi @Rishabh_Rathod my application is public . Is there a way to redirect to the listing page even if we took the login page while there is an access token stored in local storage already ? can we check the token value stored on page load and navigate based on this ? Or can we use tab navigation for this ?