1

I'm trying to configure my application in facebook but I have a trouble.

My application works through a servlet (http://www.mysite.com:port/myproject/servlet). In the settings of the application I'm setting:

Site URL: http://mysite:port/myproject/servlet?

Canvas URL: http://mysite:port/myproject/servlet?

This configuration works properly except for one detail. If I access it by its URL "http://apps.facebook.com/myapp" or on my home page (column applications on the left side of the page the user) works correctly. But if new user accesses the application, after clicking the "allow" in permission dialog (https://developers.facebook.com/docs/beta/authentication), the application is redirected to a URL outside of facebook (http://mysite:port/myproject/servlet?) When it should be redirected to http://apps.facebook.com/myapp.

What is the correct configuration?

Thanks.

vctlzac
  • 837
  • 2
  • 16
  • 38

1 Answers1

1

By which URL does the user get to the Auth dialog?

In the first place he should be redirected to:

https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&scope=email,read_stream

and YOUR_URL should be http://apps.facebook.com/myapp or anything else you want it to be.

Michael Vain
  • 486
  • 3
  • 4
  • Well, I tried to pass the value http://apps.facebook.com/myapp in redirect_uri, but I get following error in browser: "Refused to display document because display forbidden by X-Frame-Options." When I use the value http://mysite:port/myproject/servlet? in redirect_uri the error does not occur, but the redirect occurs to the wrong place. – vctlzac Nov 18 '11 at 10:22
  • check out http://stackoverflow.com/questions/6666423/overcoming-display-forbidden-by-x-frame-options, they suggest adding a header there that will fix that. What happens if you omit the redirect_uri at all. By default you should be redirected to the http://apps.facebook.com/myapp. P.S. Wild guess, maybe this has something to do with you not using a standart port (!=80) – Michael Vain Nov 18 '11 at 11:18
  • In my servlet I added the following command: httpServletResponse.addHeader("X-FRAME-OPTIONS", "SAMEORIGIN" ); But not worked. There another way? – vctlzac Nov 18 '11 at 17:59