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:
https://github.com/keycloak/keycloak/blob/master/examples/demo-template/angular-product-app/src/main/webapp/js/app.js#L23

Just remove { onLoad: 'login-required' } and it won't automatically login, instead you run login() to login.

On 20 January 2016 at 21:46, replymenot <replymenot@gmail.com> wrote:
Hi all,

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.
I use AngularJS as my front-end and I have this burning question.

How can I use Keycloak as security provider in a SPA after the angular app has already been bootstrapped?

The website I’m creating has anonymous and role based secure parts. So I only want login based on context and not on load.
I can’t seem te be able to find examples.
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...

Help will be appreciated.

Ivo.
_______________________________________________
keycloak-dev mailing list
keycloak-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/keycloak-dev