<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi , <div><br></div><div>I'm looking for a simple way to login to keycloak with an AngularJS app. </div><div>If i use the example (angular-produt-app) one can find with the keyCloak appliance, the js adapter redirects the user to the Keycloak login pase "onload " (<span style="font-family: 'Courier New'; font-size: 7.2pt; color: rgb(69, 131, 131);">keycloakVar</span><span style="font-family: 'Courier New'; font-size: 7.2pt;">.</span><span style="font-family: 'Courier New'; font-size: 7.2pt; color: rgb(122, 122, 67);">init</span><span style="font-family: 'Courier New'; font-size: 7.2pt;">({</span><span style="font-family: 'Courier New'; font-size: 7.2pt; color: rgb(102, 14, 122); font-weight: bold;">onLoad</span><span style="font-family: 'Courier New'; font-size: 7.2pt;">: </span><span style="font-family: 'Courier New'; font-size: 7.2pt; color: rgb(0, 128, 0); font-weight: bold;">'login-required'</span><span style="font-family: 'Courier New'; font-size: 7.2pt;">})...</span><span style="font-size: 12pt;">) </span></div><div><br></div><div>But i want to login only when I specifically click on some button. F<span style="font-size: 12pt;">rom what I can gather</span><span style="font-size: 12pt;"> </span><span style="font-size: 12pt;">the method </span><span style="color: rgb(69, 131, 131); font-family: 'Courier New'; font-size: 9.60000038146973px;">keycloakVar.login() </span></div><div>from the docs & JS reference is the way to go.. but replacing the .init() method with the .login() method doesn't seem to work...</div><div><br></div><div>Also, in the "normal" case, the init() regular example itself lets me, after logging-in succesfully, with still empty Javasript objects once I am successfully redirected to my app page. (the auth global variable)</div><div><br></div><div><br></div><div>The official angular + js-adapter : <a href="https://github.com/keycloak/keycloak/blob/master/examples/demo-template/angular-product-app/src/main/webapp/js/app.js" target="_blank" style="font-size: 12pt;">https://github.com/keycloak/keycloak/blob/master/examples/demo-template/angular-product-app/src/main/webapp/js/app.js</a></div><div><br></div><div><br></div><div>Could you help me ? I must be missing something.</div><div><br></div><div><br>Thanks a lot</div><div><br><font face="Franklin Gothic Medium">Fabio M</font></div>                                            </div></body>
</html>