views:

27

answers:

1

Hi

We have an ASP.Net MVC site that needs to authenticate to facebook to post photos to a user account. All fine so far.

Facebook redirect back to the mvc site. Again fine.

The url that facebook replies with include the access_token BUT this is prefixed with a # char and MVC strips this and the token from the url so the controller and action get nothing useful.

This is using the user agent type of authentication. If we use the standard auth then it works fine but this doesnt give enough access rights.

Anyone got any clues ??

Thanks

+1  A: 

There's no way to read the hash part of an URL (everything that follows the # sign) on the server side because this part is never sent to the server. The only way to access it is on the client side, so you might need to read it using javascript and then send it to the server again using for example AJAX or setting it as a value of a hidden field that is part of a form that you submit to the server.

Darin Dimitrov