<div dir="ltr">We could do with a proper Angular wrapper, but without it you have to let Keycloak initialize first, then have Keycloak initialize Angular. Take a look at:<div><a href="https://github.com/keycloak/keycloak/blob/master/examples/demo-template/angular-product-app/src/main/webapp/js/app.js#L23">https://github.com/keycloak/keycloak/blob/master/examples/demo-template/angular-product-app/src/main/webapp/js/app.js#L23</a><br></div><div><br></div><div>Just remove { onLoad: &#39;login-required&#39; } and it won&#39;t automatically login, instead you run login() to login.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 20 January 2016 at 21:46, replymenot <span dir="ltr">&lt;<a href="mailto:replymenot@gmail.com" target="_blank">replymenot@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
Recently I attended a seminar on Keycloak and I was totally blown away. Loved it and it seems to be exactly what I need for my microservices architecture.<br>
I use AngularJS as my front-end and I have this burning question.<br>
<br>
How can I use Keycloak as security provider in a SPA after the angular app has already been bootstrapped?<br>
<br>
The website I’m creating has anonymous and role based secure parts. So I only want login based on context and not on load.<br>
I can’t seem te be able to find examples.<br>
Right now I get the login from keycloack but after redirect my angular app is re-bootstrapped and I loose my login, because it is not part of my single page app...<br>
<br>
Help will be appreciated.<br>
<br>
Ivo.<br>
_______________________________________________<br>
keycloak-dev mailing list<br>
<a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a></blockquote></div><br></div>