Closed confile closed 11 years ago
The token should be exchanged, but expiration time is currently not updated in the request scope, so you do not see the new value (this will be fixed in 4.0.11 version released tomorrow). Try to re-execute the request, you should see the new expiration time.
@benorama Please check it again. I my case the token remains the same. Or is there something wrong in the code above?
@benorama what do you mean by re-exchange the request?
Sorry, I could not reproduce the issue.
In https://github.com/agorapulse/grails-facebook-sdk-demo , I've added the following code in @WebsiteController@ at L.24 and it worked fine.
println "Old token: $token"
println "expireTime: "+new Date(facebookContext.user.tokenExpirationTime)
facebookContext.user.exchangeToken()
println "New token: $facebookContext.user.token"
println "expireTime new Token: "+new Date(facebookContext.user.tokenExpirationTime)
It is working now. I get the long term token as first token. Don't know why, but it works.
I have tried to get a lon term (2 month token) with exchangeToken() as follows:
it turns out that both tokens are the same. This is alway the case. Both tokens are only valid for 2 hours. Is there something wrong with the exchange method?