<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">It seems that what you need is to call
keycloak.init with 'check-sso' flag. Something like this:<br>
<br>
keycloak.init({ onLoad: 'check-sso' })<br>
<br>
See docs for some more details
<a class="moz-txt-link-freetext" href="http://keycloak.github.io/docs/userguide/keycloak-server/html/ch08.html#javascript-adapter">http://keycloak.github.io/docs/userguide/keycloak-server/html/ch08.html#javascript-adapter</a>
.<br>
<br>
With the 'check-sso' option, the javascript adapter will try to
redirect to KEycloak server and see if user was already logged-in
to keycloak through SSO (which is the case after successful
registration). If he is logged, the keycloak will redirect back to
application with the login success (code+state) and javascript
application will be logged-in automatically.<br>
<br>
Marek<br>
<br>
On 02/05/16 15:12, JAYAPRIYA ATHEESAN wrote:<br>
</div>
<blockquote
cite="mid:57275248.1a45620a.83d75.ffffa36c@mx.google.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 12 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">Hi Team,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">We have UI written in angular JS. We have
integrated the same with keycloak for authentication and
authorization.<o:p></o:p></p>
<p class="MsoNormal">When we follow the reset password link, a
mail is sent to the associated user’s email id. When I click
on the link sent for password reset, a page opens up for
providing new password.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">After I submit the password change request,
the application just changes the password. But the problem is
that, it does not login to our application dashboard. If we
click on login button, the user gets logged in.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">How to make the application seamlessly go
to the dashboard? By going through the files shared by your
team in example, we see that we cannot capture the onsuccess.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Onlogin method goes through, but it is not
being redirected. Is it possible to specify the url to be
redirected after successful password reset?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The flow reaches the below part<span
style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">var kInit =
function () {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">
keycloakAuth.init().success(function () {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">
$rootScope.keycloak = keycloakAuth;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">
console.log('token = ' + keycloakAuth.token);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">
}).error(function () {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">
//console.log("failed to intialize");<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> });<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> };<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> kInit();<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">We expect that the flow should go through
the below method<span style="color:#1F497D"> also</span>, but
it doesn’t happen.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">keycloakAuth.onAuthSuccess = function () {<o:p></o:p></p>
<p class="MsoNormal"> $rootScope.authLogin = true;<o:p></o:p></p>
<p class="MsoNormal"> console.log('coming in auth
success');<o:p></o:p></p>
<p class="MsoNormal"> loginService.login(keycloakAuth);<o:p></o:p></p>
<p class="MsoNormal"> $rootScope.dataloading = true;<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> };<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt">Jayapriya
Atheesan</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
keycloak-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/keycloak-user">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></pre>
</blockquote>
<br>
</body>
</html>