Thanks for the reply. Yea, might I should have done it that way. I now just call a static page and on return I call my original page with the parameters formatted correctly. It works so not going to fiddle with it:)
Regards
Willie
Willie, it looks like to me you are using the "client-side flow" method as specified here:
http://developers.facebook.com/docs/authentication/client-side/
Not sure why you're not using the "server-side flow" but normally, if you're using the client-side flow you are also using the "JS SDK":
http://developers.facebook.com/docs/reference/javascript/
and in that you will find code that pulls the access token from the "windows.location.hashtag". No idea why they do it like that but I think this post details how you can handle it without having to use the JS SDK:
http://stackoverflow.com/questions/7131909/facebook-callback-appends-to-return-url
Hope that helps.
The one where I need to read the access token.
Step no 3.
http://[your_site_URL]/signin.cp#access_token=AAAE7LWFNHUgBAJOZAuVSZA03Jwm6dHU34EZALv4tvTNsxLdSCZB0Gxk8am2WyMGpPW5NwxVWombtrsJXy5MqsPXR3BIHteaFvezynDeF7L4kuIOSGrAs&expires_in=6372
And it is because of the # sign in the URL
And which part doesn't work exactly? Lots of Urls getting hit here between redirects.
+++ Rick ---
Yes QueryString.
If you want to integrate with Facebook and want users to sign in you need to do several stuff.
1. Register your app and URL on their developer platform. You then get a APPID
2. On your form you will have a Facebook button where the user can click. This then goes to FB. FB then evaluates the user and user is asked for access to certain information. FB then calls the redirect page in the URL and in that the valid access code is added at the back of the URL you specified to be the redirect URL
URL example: https://www.facebook.com/dialog/oauth?client_id=[your_client_id]&redirect_uri=[your_site_URL (as specified in FB dev)]/signin.cp&response_type=token&scope=email
3. When FB hits your redirect page it looks something like this:
http://[your_site_URL]/signin.cp#access_token=AAAE7LWFNHUgBAJOZAuVSZA03Jwm6dHU34EZALv4tvTNsxLdSCZB0Gxk8am2WyMGpPW5NwxVWombtrsJXy5MqsPXR3BIHteaFvezynDeF7L4kuIOSGrAs&expires_in=6372
4. Now you need to read this access token and use it when querying this user info.
lcHtml = oHTTP.HttpGet("https://graph.facebook.com/me?access_token=" + fbAccessCode)
This then returns info like
{
"id": "xxxxxxxxxxxxxx",
"name": "Willie van Schalkwyk",
"first_name": "Willie",
"last_name": "van Schalkwyk",
"link": "http://www.facebook.com/profile.php?id=xxxxxxxxxxxxxx",
"gender": "male",
"email": "willie\u0040cyberprop.com",
"timezone": 2,
"locale": "en_US",
"verified": true,
"updated_time": "2012-03-16T20:37:20+0000"
}
All I can think of getting the access_token is redirect to a html page and with Java script call the FB page and read the # in java and then call my actual redirect with a form or string var. Unfortunately my java skills sucks
What are you doing to retrieve the URL? QueryString?
# is not valid on the querystring unless it is encoded because # is a URL hash. If it's in a querystring the # must be encoded, otherwise it's treated like a page hash to jump to.
++ Rick ---
Hi Rick
I am integrating Facebook into my websites.
When a user logs in, it first goes to Facebook and then Facebook sends back a URL to validate.
My problem is the following. The URL sent back contains a '#' charter #access_token=AAAE7LWFNHUgBAJO
I stepped through the code but the everything after and including the '#' character is missing.
Any idea what I am doing wrong or how I can fix this?
Thanks
Willie