[prev in list] [next in list] [prev in thread] [next in thread] 

List:       keycloak-user
Subject:    [keycloak-user] updateToken method not working
From:       stian () redhat ! com (Stian Thorgersen)
Date:       2014-10-31 7:18:26
Message-ID: 828758206.4624335.1414739906070.JavaMail.zimbra () redhat ! com
[Download RAW message or body]

That looks correct to me. 

Looks like for some reason the token refresh isn't successful. The default session \
idle timeout is pretty low so it could be that. Try increasing 'SSO Session Idle \
Timeout' in the admin console (Session and Tokens -> Timeout Settings) to make sure \
that's not the problem.

We don't currently pass the error details to the error method, which we should, but \
you can look at the actual request http using your a dev console to see if there's \
any details in the response to why the refresh fails.

----- Original Message -----
> From: "Dean Peterson" <peterson.dean at gmail.com>
> To: keycloak-user at lists.jboss.org
> Sent: Thursday, 30 October, 2014 8:57:51 PM
> Subject: [keycloak-user] updateToken method not working
> 
> I use the following code to make sure I have a valid token before making a
> request. Even though I am logged in, if I wait until the token expires then
> make a request, the error function is called most of the time when I try to
> update the token using the updateToken method. I have the page reload, and I
> have a valid token again. However, I did not have to log in again because
> the session had not expired. I am using 1.1.0-Alpha1-SNAPSHOT I have read
> the documentation. Am I missing something?
> 
> keycloak.updateToken().success(function() {
> if (data) {
> $http({
> url: ' http://localhost:8080 ' + url,
> method: method,
> data: data,
> headers: {
> 'Content-Type': contentType,
> 'Accept': acceptType,
> 'Authorization': 'Bearer ' + service.auth.token
> },
> transformRequest: angular.identity
> }).success(success).error(error);
> } else {
> $http({
> url: ' http://localhost:8080 ' + url,
> method: method,
> headers: {
> 'Content-Type': contentType,
> 'Accept': acceptType,
> 'Authorization': 'Bearer ' + service.auth.token
> }
> }).success(success).error(error);
> }
> }).error(function() {
> alert("Token could not be refreshed!");
> location.reload();
> });
> 
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic