[keycloak-user] Keycloak offline token

Carlos Feria carlosthe19916 at gmail.com
Tue Nov 24 18:00:15 EST 2015


Hello. I migrated my keycloak to keycloak-1.6.1.Final and i have a problem
with the session persistence.

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.

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.

this is my angular interceptor an bootstrap method:

keycloak.init({onLoad: 'login-required'}).success(function () {
  window.auth.authz = keycloak;

  angular.module('mean').factory('Auth', function () {
    return window.auth;
  });

//Then init the app

  angular.bootstrap(document,
[ApplicationConfiguration.applicationModuleName]);

}).error(function () {
  window.location.reload();
});


angular.module('mean').factory('authInterceptor', function ($q, Auth) {
  return {
    request: function (config) {
      if (!config.url.match(/.html$/)) {
        var deferred = $q.defer();
        if (Auth.authz.token) {
          Auth.authz.updateToken(5).success(function () {
            config.headers = config.headers || {};
            config.headers.Authorization = 'Bearer ' + Auth.authz.token;

            deferred.resolve(config);
          }).error(function () {
            location.reload();
          });
        }
        return deferred.promise;
      } else {
        return config;
      }
    }
  };
});




-- 
Carlos E. Feria Vila
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20151124/bc1f4bb9/attachment.html 


More information about the keycloak-user mailing list