views:

26

answers:

2

/facebook/promo/#access_token=162592277090170%7C2.yCch3otjrdit_rgBFS6F0A__.3600.1285369200-727781553%7CtugQmoO0bRiadumHVQrrSiPRD9Y&expires_in=7174

This is the request facebook calls back. How can I parse the access_token ffrom the url? I could not find any way to get the access_token value.

Please aware that it is not a reqular parameter.

Thanks in advance

A: 

You could use a Regex to match it out of the url. Or simply take everything as a sub-string between access_token= and the next &-character or the end of the url, which ever comes first.

randomguy
OK however I could not find it in the request url, request.request_uri etc...
tolga
A: 

I believe that it's not possible - the part after # is simply ignored. See this answer: http://stackoverflow.com/questions/2651080/rails-extracting-the-raw-url-from-the-request

pawien