Closed confile closed 11 years ago
Indeed, exchangeToken() does not return any value. It sets the corresponding properties in ContextUser.
println "Old token $facebookContext.user.token"
println "Old expiration time ${new Date(facebookContext.user.tokenExpirationTime)}"
facebookContext.user.exchangeToken()
println "New token $facebookContext.user.token"
println "New expiration time ${new Date(facebookContext.user.tokenExpirationTime)}"
@benorama
I use your code above and I get the following:
grails> Old token AAAEqZBHQL4O8BAMo1ZCaZABi0rZAUIRs3yZBsBrVBqPjOiQBvCZCIzNaqNnxIZCPqvcKr5cIZBZCEDYlVdByN4wJ3r1vAe7aMnVZBZCWlMEfHQBPgZDZD
grails> Old expiration time Sat Apr 06 00:24:14 CEST 2013
grails> New token AAAEqZBHQL4O8BAMo1ZCaZABi0rZAUIRs3yZBsBrVBqPjOiQBvCZCIzNaqNnxIZCPqvcKr5cIZBZCEDYlVdByN4wJ3r1vAe7aMnVZBZCWlMEfHQBPgZDZD
grails> New expiration time Sat May 25 17:27:01 CEST 2013
Why is the old and the new token the same? Is this correct?
May be the old token has been already exchanged? Could you try with a brand new Facebook session?
If you want to debug a token, you can use this great tool: https://developers.facebook.com/tools/debug/access_token
Enter the token, and it will give you the app/user/token and expiration info about this token.
@benorama But when you look at the expiration time you see that they are different. How can this be even if the token is equal?
The first "old expiration time" is clearly not correct. How did you get it? Those value are stored in session server-side, there was perhaps a mismatch between old and new session.
You might start the authentication process from a fresh session (kill your cookies/browser) to see if you still have the issue.
I have a valid access token
When I request an exchange Token I got null
What do I have to do to get the exchange Token?