Facebook Oauth redirects to IP address instead of domain name

Hi all,

I’m having an issue when I try to log into Facebook using Oauth.

When I’m confirmed logged in, it wants to redirect me to my Digital Ocean IP address instead of the hostname (where it originally came from.) Here is the error I’m getting :

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.

This error means I need to add the redirect URI to my Facebook Developers App, but I want it to redirect to my URL hostname and not my IP address. I tried fixing it on the Facebook side but no luck, so I’m thinking it might be a Digital Ocean issue.

The link is a screenshot of the error / URL address bar.

Any ideas? Keith

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


You cannot use IP addresses to redirect to them you need to use domain names or sub-domains.

Please check here

I hope this helps.

Welp, I’m an idiot. I spent around 3 hours trying to figure out this problem, and of course figured it out RIGHT AFTER I posted this question.

It had to do with my passport.js file using the IP address as a callbackURL for the Facebook Strategy that I had set months ago. It was working just fine.

If I could figure out how to delete this thread, I would! Sorry for the false alarm!