Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What should be the Site URL in facebook app settings to work from localhost? #376

Closed
xpanta opened this issue Oct 12, 2013 · 42 comments
Closed

Comments

@xpanta
Copy link

xpanta commented Oct 12, 2013

I am trying to work with the example page (/facebook/example/) from localhost and I always get "Given URL is not permitted by the application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains."

In my Site URL (Facebook app settings) I have this: http://127.0.0.1:8000/facebook/example/

Is it possible to work from locahost? How?

@xpanta
Copy link
Author

xpanta commented Oct 12, 2013

I found the solution. Since I can't delete my question I will post what I found out in case someone else have the same issue.

In the facebook app settings (on Facebook) I went to the Advanced section and looked under Security, for the field "Valid OAuth redirect URIs" - this is where I entered "http://localhost:8000/facebook/example/" and it worked

@xpanta xpanta closed this as completed Oct 12, 2013
@karcsi
Copy link

karcsi commented Jan 15, 2014

Thanks, that helped me a lot. A played around for houres before I found your site. But had to insert the "Canvasseite" (Canvas-site? in english?). My inserted url is https://apps.facebook.com/lokalertester, not the Canvas-URL http://localhost:81/

@roman02
Copy link

roman02 commented Feb 5, 2014

xpanta, I don't understand how Facebook would be able to redirect to your local server when it's being described as localhost. It's not available on the Internet!

@RafikSM
Copy link

RafikSM commented Feb 26, 2014

The redirection is made by the browser not by the server. The server just send a somthing like a redirection header to the browser, and then the browser make the redirection. It is why with localhost this will work

@lucachaco
Copy link

Thanks, It worked @xpanta

@jijunjun1112
Copy link

Thanks very much. It really helps a lot.

@kupecraig
Copy link

Thanks pal. This helped.

@pr4th4m
Copy link

pr4th4m commented May 10, 2014

@xpanta Thanks buddy, this was helpful.

@billwjo
Copy link

billwjo commented May 14, 2014

I tired exactly this but still getting the same "Given URL is not allowed by the Application configuration..." error. I entered "http://localhost:8000/facebook/example" into the facebook settings URL and again into the Valid Oauth Redirect URIs. Was there any settings.py or other facebook setting changes that you made?

@123b0
Copy link

123b0 commented Jul 11, 2014

Hello, can someone please help me. I am trying to create a facebook app that runs on my localhost. For my app domain I have localhost. For my Canvas Url and secure Url I have http://localhost:8000/ and also for site URL.

In my php code I have my canvas page url.

When I access the app via the localhost url, I get the pop up for the permissions i requested but after that I am directed to a broken page on the facebook canvas page. I have done research, I know it is tricky to use localhost due to the ssl problem with facebook..... However I am really confused. I am a novice, can someone please help me out and explain my problem? Thanks.

@dktistakis
Copy link

thanks man. after a lot of search your answer did it!

@guri-dev
Copy link

It works
leave app domain empty
website url empty
go to app->settings->advance settings
here is a field
Valid OAuth redirect URIs

fill it
http://localhost:8080/fb_login_local/

and its done :)

@123b0
Copy link

123b0 commented Jul 25, 2014

Does anyone have any idea about the cURL and ssl errors when using localhost/xampp and creating my own self signed certificate?

@guri-dev
Copy link

@123b0 what error you r facing please paste here

@123b0
Copy link

123b0 commented Jul 28, 2014

@gaganphp I've solved the problem now. Thanks anyway. I made a stupid mistake and didn't put the full path for the image to be uploaded.

@rrohitramsen
Copy link

I am not able to redirect back to localhost. My app is stuck at facebook canvas page "https://apps.facebook.com/springyellow/?code=......." not able to redirect back to localhost. I tried all .

@Tig10
Copy link

Tig10 commented Nov 25, 2015

@ gaganphp, It appears the Website URL field is a 'required' field. It cannot be empty. I am still having this issue persisting even though I have set my localhost url on Valid OAuth redirect URIs.

Ok I resolved this: If anybody else is having some issues, 1. a localhost url will work and 2. you must also set your $redirect_uri variable in your app code to a localhost url.

@rmercer33
Copy link

Hey xpanta, coming to you from 2016, your solution worked for me!!! Many thanks.

@dpasie2
Copy link

dpasie2 commented Mar 4, 2016

Thank you @xpanta ! Cured my headache!

@shtaabhishek
Copy link

thank you @xpanta and @gaganphp for the soln

@jobinthepast
Copy link

It doesn't seem to have Valid OAuth redirect URIs in the Settings > Advanced tab anymore as of May 2016. Or am I missing something? Thanks!

Facebook app setting

@mbaggio
Copy link

mbaggio commented May 9, 2016

They changed the layout.
OAuth section is now placed here:

oauth redirect config 2

@chis
Copy link

chis commented Jul 25, 2016

Add product -> Facebook Login.
Goto product settings.
Enter 'http://localhost:5000' [with your correct port] under 'Valid OAuth redirect URIs'
This worked for me.

@ghost
Copy link

ghost commented Aug 10, 2016

thank's man

@parthiban26
Copy link

i am also having same problem, whenever i tried to login via facebook i will get below error
error:
given url is not allowed by the application configuration one or more of the given url is not allowed by bthe app settings to use this url you must add a valid native platform in your app settings

so, please give any suggestions.

@parthiban26
Copy link

i need to finish this task ASAP, So please give solution..

@parthiban26
Copy link

i am using ionic app, with development stage..

@jsvaughan
Copy link

@zumzar96
Copy link

zumzar96 commented May 19, 2017

I'm trying to allow users to login with facebook to my website but I am getting the following error:
URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs.
I configured my Facebook app like this:
1.Made it Public
2.Website
site URL: http://localhost:8000/ (since I'm running locally)
3. App Domains:Empty
4.Client OAuth Login -ON
Web OAuth Login -ON
5.Valid OAuth redirect URIs: http://localhost:8000/

@panamantis
Copy link

Add a custom domain url in your hosts file (if on windows) to mast the localhost or 127.0.0.1

@purnimakumari748
Copy link

I applied the above solution but it still not working for me .. it showing error --

"URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs"
my fb configrations :-
1-Valid OAuth redirect URIs: http://localhost:8000/demo/index/
2- App Domains:Empty
3-Client OAuth Login -O
4-Web OAuth Login -ON
5-Website
site URL: empty
Please suggest solution

@Tig10
Copy link

Tig10 commented Jul 26, 2017

Try this:
App Domians: http://localhost/
Site URL: http://localhost/
Then in the Facebook Login Product settings;
Valid OAuth redirect URIs:
http://localhost/ http://localhost/demo http://localhost/demo/index

This should work if not then add your port to every http://localhost:80 part of these entries. Let me know how it goes.

@mkgdev
Copy link

mkgdev commented Jul 26, 2017

I am getting localhost refused to connect in chrome while using passport-facebook . Can anyone help me!

@purnimakumari748
Copy link

purnimakumari748 commented Jul 26, 2017 via email

@faiaz000
Copy link

Still not working

@alboteanud
Copy link

not working. I think, generating your own SSL certificate for testing is a better solution https://stackoverflow.com/questions/8169999/how-can-i-create-a-self-signed-cert-for-localhost

@himanshutyagi623
Copy link

Hello
my website is www.xyz.com and what will be my valid oauth redirect url
i entered www.xyz.com/my-account/facebook/int_callback but its working all the process but not login to my fb account
Please help soon

@vaibhav011286
Copy link

Hello,
I setup wamp with virtual host like https://abc, so how can I make this url work for fb login? plz help

@saurabhp75
Copy link

saurabhp75 commented Sep 7, 2018

The solution is not working for me. Is there any change in facebook implementation. I am using flask dance and my oauth url is https://localhost:5000/login/facebook/authorize

@kenmorechalfant
Copy link

kenmorechalfant commented Dec 4, 2018

Facebook no longer allows you to add URIs that are not HTTPS, so I can't add localhost.

When I try to log into my app during development I now get an error "This IP can't make requests for that application."

Any current solutions?

@hugoscavino
Copy link

You can create a local cert using https for localhost.

@xxRockOnxx
Copy link

There's something called "Test App" now. It's hidden so it isn't obvious that you have to create one.
Found the answer here: https://stackoverflow.com/a/57607570/10975709

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests