<div dir="ltr"><div>Ok, will check the original AngularJS demo for that harmless window.postMessage().<br><br></div>Thanks for your effort!<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 8, 2016 at 2:50 PM, Stian Thorgersen <span dir="ltr"><<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Just spotted you're using the Angular2 example. I've got no clue about that one. It was community contributed and we've not had any experience with Angular2 ourselves.<div><br></div><div>Please try if you're getting similar behavior with Angular 1 example.</div><div><br></div><div>There should be no page reload on the cookie check. It's just a window postMessage and it doesn't do anything that should cause the page to reload.</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 8 September 2016 at 14:07, Andy Yar <span dir="ltr"><<a href="mailto:andyyar66@gmail.com" target="_blank">andyyar66@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Yes, I did - Web Origins: <a href="http://localhost:4200" target="_blank">http://localhost:4200</a>. Thats where my dev server runs. When I change the origin in the Keycloak admin console to something different I can't even log in due to CORS errors. So I guess this setting is correct.<br><br></div><div>Setting a really short max SSO session TTL results in both cookie checks (quiet Chrome and page reloading Firefox/Edge) detecting the tokens' validity and redirecting to the login page.<br></div><div><br></div>My other observation, when I perform a SSO logout in Keycloak the app running in Chrome doesn't log me out after its quiet cookie check. In Firefox/Edge it detects the SSO logout correctly during the horrible cookie checking page reload.<br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 8, 2016 at 7:39 AM, Stian Thorgersen <span dir="ltr"><<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Did you add correct origins for your app in the Keycloak admin console?</div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 7 September 2016 at 16:30, Andy Yar <span dir="ltr"><<a href="mailto:andyyar66@gmail.com" target="_blank">andyyar66@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hello,<br></div>I've tried running <a href="https://github.com/keycloak/keycloak/tree/master/examples/demo-template/angular2-product-app" target="_blank">https://github.com/keycloak/ke<wbr>ycloak/tree/master/examples/de<wbr>mo-template/angular2-product-a<wbr>pp</a> app on localhost against my Keycloak instance. The page reloading issue caused by iFrame checks was present too.<br><br></div><div>The only significant change I made to the demo app was replacing the keycloak.json with mine. The difference is using a non-localhost URL: "auth-server-url": "http://<serverURL>:8080/sso". CORS comes to mind.<br></div><div><br></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 6, 2016 at 2:43 PM, Andy Yar <span dir="ltr"><<a href="mailto:andyyar66@gmail.com" target="_blank">andyyar66@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I've spent some time in Firefox's debugger and found out that the redirect occurs right after the window.postMessage() is called in the checkLoginFrame function.<br><br></div><div>The demo project code seems to be in line with my code. Might try it's runtime behavior later.<br></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 6, 2016 at 8:19 AM, Marek Posolda <span dir="ltr"><<a href="mailto:mposolda@redhat.com" target="_blank">mposolda@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><span>
<div>On 01/09/16 23:34, Andy Yar wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>Hello,<br>
</div>
I've created a template of a Angular based app using
keycloak.js lib. After a successful login the app/page
periodically reloads itself. I guess it's because of the
iFrame session check being set to 5sec interval
(requesting url:
<base_url>/#state=<hash>&code=<wbr><hash>).<br>
</div>
</div>
</div>
</div>
</blockquote></span>
That's strange... IFrame is supposed to just check the cookie, not
to do any reload.<br>
<br>
Maybe take a look at our angular examples and see if you do
something differently? See
<a href="https://github.com/keycloak/keycloak/tree/master/examples/demo-template/angular-product-app" target="_blank">https://github.com/keycloak/ke<wbr>ycloak/tree/master/examples/de<wbr>mo-template/angular-product-ap<wbr>p</a>
. Note the angular.bootstrap called after Keycloak authentication is
fully finished.<br>
<br>
Marek<br>
<blockquote type="cite"><span>
<div dir="ltr">
<div>
<div>
<div><br>
</div>
This happens in latest Firefox and Edge. Chrome seems to
handle these reloads quietly.<br>
<br>
</div>
Is this intended?<br>
<br>
</div>
Thanks<br>
</div>
<br>
<fieldset></fieldset>
<br>
</span><pre>______________________________<wbr>_________________
keycloak-user mailing list
<a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/keycloak-user</a></pre>
</blockquote>
<br>
</div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
keycloak-user mailing list<br>
<a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/keycloak-user</a><br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>