<div dir="ltr">Hello. I migrated my keycloak to keycloak-1.6.1.Final and i have a problem with the session persistence.<div><br></div><div>I have a pure javascript application, this uses javacript adapter. When i had other version of keycloak, the session is close when i do logout or close the browser, but now in keycloak-1.6.1.Final the session is not detroyed when i close the browser, i see that session is on cookie.</div><div><br></div><div>I delete the offline role of my users and roles but the session don't close. How can i delete the session when i close the brower? Please help me.</div><div><br></div><div>this is my angular interceptor an bootstrap method:</div><div><br></div><div><pre style="color:rgb(0,0,0);font-family:'DejaVu Sans Mono'"><span style="color:rgb(69,131,131)">keycloak</span>.<span style="color:rgb(122,122,67)">init</span>({<span style="color:rgb(102,14,122);font-weight:bold">onLoad</span>: <span style="color:rgb(0,128,0);font-weight:bold">'login-required'</span>}).<span style="color:rgb(122,122,67)">success</span>(<span style="color:rgb(0,0,128);font-weight:bold">function </span>() {<br> <span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">window</span>.<span style="color:rgb(102,14,122);font-weight:bold">auth</span>.<span style="background-color:rgb(255,228,255)">authz</span> = <span style="color:rgb(69,131,131)">keycloak</span>;<pre style="font-family:'DejaVu Sans Mono'"><span style="color:rgb(102,14,122);font-weight:bold"> angular</span>.<span style="color:rgb(102,14,122);font-weight:bold">module</span>(<span style="color:rgb(0,128,0);font-weight:bold">'mean'</span>).<span style="color:rgb(122,122,67)">factory</span>(<span style="color:rgb(0,128,0);font-weight:bold">'Auth'</span>, <span style="color:rgb(0,0,128);font-weight:bold">function </span>() {<br> <span style="color:rgb(0,0,128);font-weight:bold">return </span><span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">window</span>.<span style="color:rgb(102,14,122);font-weight:bold">auth</span>;<br> });</pre> <span style="color:rgb(128,128,128);font-style:italic">//Then init the app</span></pre><pre style="color:rgb(0,0,0);font-family:'DejaVu Sans Mono'"><span style="color:rgb(102,14,122);font-weight:bold"> angular</span>.<span style="color:rgb(102,14,122);font-weight:bold">bootstrap</span>(<span style="color:rgb(102,14,122);font-weight:bold">document</span>, [<span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">ApplicationConfiguration</span>.<span style="color:rgb(102,14,122);font-weight:bold">applicationModuleName</span>]); <span style="color:rgb(128,128,128);font-style:italic"> </span></pre><pre style="color:rgb(0,0,0);font-family:'DejaVu Sans Mono'"><pre style="font-family:'DejaVu Sans Mono'">}).<span style="color:rgb(122,122,67)">error</span>(<span style="color:rgb(0,0,128);font-weight:bold">function </span>() {<br> <span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">window</span>.<span style="color:rgb(102,14,122);font-weight:bold">location</span>.<span style="color:rgb(122,122,67)">reload</span>();<br>});</pre></pre><pre style="color:rgb(0,0,0);font-family:'DejaVu Sans Mono'"><br></pre></div><div><pre style="color:rgb(0,0,0);font-family:'DejaVu Sans Mono'"><span style="background-color:rgb(228,228,255)">angular</span>.<span style="color:rgb(102,14,122);font-weight:bold">module</span>(<span style="color:rgb(0,128,0);font-weight:bold">'mean'</span>).<span style="color:rgb(122,122,67)">factory</span>(<span style="color:rgb(0,128,0);font-weight:bold">'authInterceptor'</span>, <span style="color:rgb(0,0,128);font-weight:bold">function </span>($q, Auth) {<br> <span style="color:rgb(0,0,128);font-weight:bold">return </span>{<br> <span style="color:rgb(122,122,67)">request</span>: <span style="color:rgb(0,0,128);font-weight:bold">function </span>(config) {<br> <span style="color:rgb(0,0,128);font-weight:bold">if </span>(!config.<span style="color:rgb(102,14,122);font-weight:bold">url</span>.<span style="color:rgb(122,122,67)">match</span>(<span style="color:rgb(0,0,255)">/.html$/</span>)) {<br> <span style="color:rgb(0,0,128);font-weight:bold">var </span><span style="color:rgb(69,131,131)">deferred </span>= $q.<span style="color:rgb(122,122,67)">defer</span>();<br> <span style="color:rgb(0,0,128);font-weight:bold">if </span>(Auth.<span style="color:rgb(102,14,122);font-weight:bold">authz</span>.<span style="color:rgb(102,14,122);font-weight:bold">token</span>) {<br> Auth.<span style="color:rgb(102,14,122);font-weight:bold">authz</span>.<span style="color:rgb(122,122,67)">updateToken</span>(<span style="color:rgb(0,0,255)">5</span>).<span style="color:rgb(122,122,67)">success</span>(<span style="color:rgb(0,0,128);font-weight:bold">function </span>() {<br> config.<span style="color:rgb(102,14,122);font-weight:bold">headers </span>= config.<span style="color:rgb(102,14,122);font-weight:bold">headers </span>|| {};<br> config.<span style="color:rgb(102,14,122);font-weight:bold">headers</span>.<span style="color:rgb(102,14,122);font-weight:bold">Authorization </span>= <span style="color:rgb(0,128,0);font-weight:bold">'Bearer ' </span>+ Auth.<span style="color:rgb(102,14,122);font-weight:bold">authz</span>.<span style="color:rgb(102,14,122);font-weight:bold">token</span>;<br><br> <span style="color:rgb(69,131,131)">deferred</span>.<span style="color:rgb(102,14,122);font-weight:bold">resolve</span>(config);<br> }).<span style="color:rgb(122,122,67)">error</span>(<span style="color:rgb(0,0,128);font-weight:bold">function </span>() {<br> <span style="color:rgb(102,14,122);font-weight:bold">location</span>.<span style="color:rgb(122,122,67)">reload</span>();<br> });<br> }<br> <span style="color:rgb(0,0,128);font-weight:bold">return </span><span style="color:rgb(69,131,131)">deferred</span>.<span style="color:rgb(122,122,67)">promise</span>;<br> } <span style="color:rgb(0,0,128);font-weight:bold">else </span>{<br> <span style="color:rgb(0,0,128);font-weight:bold">return </span>config;<br> }<br> }<br> };<br>});</pre><pre style="color:rgb(0,0,0);font-family:'DejaVu Sans Mono'"><br></pre><pre style="color:rgb(0,0,0);font-family:'DejaVu Sans Mono'"><br></pre><div><br></div>-- <br><div class="gmail_signature">Carlos E. Feria Vila<br></div>
</div></div>