I have a spring boot angular web app hosted in Azure app service which uses keycloak for user management. We have integration with VSCode editor, which is a menu item in the web application. When user clicks on the menu item, the user is expected to navigate to VS code editor which is loaded in an iFrame within the web application UI.
We leveraged, https://github.com/zmartzone/lua-resty-openidc, with ngnix to implement keycloak authentication in VS Code editor. The VS code editor when accessed directly through the browser gets prompted for keycloak login page and hence can use the editor only after keycloak authentication.
The same VS code editor, when accessed through the web application is expected to get SSO and navigate to the editor within the iframe. This is not happening and the error encountered during rendering through iFrame is
"There was an error while logging in: request to the redirect_uri_path but there's no session state found"
We also see a warning in the set-cookie header attribute, that the set cookie attribute was not set and hence defaulted to "Lax".
The cookie attributes which has this warnings are
Please suggest how we can handle this error. Tried this solution of adding in web.config file in azure appservice, but this did not work. Tried adding this cookie header through Spring boot Filter layer and that also did not work
<rewrite>
<outboundRules>
<clear />
<rule name="Add SameSite" preCondition="No SameSite">
<match serverVariable="RESPONSE_Set-Cookie" pattern=".*" negate="false" />
<action type="Rewrite" value="{R:0}; secure; SameSite=none" />
<conditions>
</conditions>
</rule>
<preConditions>
<preCondition name="No SameSite">
<add input="{RESPONSE_Set-Cookie}" pattern="." />
<add input="{RESPONSE_Set-Cookie}" pattern="; secure; SameSite=none" negate="true" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
