"Facebook OAuth" The domain of this my domain isn't included in the app's domain how to add it? - laravel

when i try to set up login with facebook i keep getting this error
Can't load URL
The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and sub-domains of your app to the App Domains field in your app settings.
ps:i try a lot of solution on stackoverflow and other website

Related

How can I deploy a gatsby site and a react app on the same domain, but render a different root page based on authentication status?

I have a react app and a gatsby site that I would like to deploy on the same domain.
The app and the website have non conflicting routes for all pages except for the root page /.
Ex.
Website
/
/blog/example-1
/blog/example-2
/about
/pricing
App
/
/:id
/profile
/settings
/new
There is plenty of documentation on how to deploy 2 apps that have non conflicting domains but how can I serve the website root path (/) when the user is not authenticated and the app root path (/) when the user is authenticated.
I'm deploying with Heroku and my authentication is done through Auth0.
How can I do this? Options I'm considering/finding are:
Add some sort of proxy (HAProxy, Caddy) in front of the app that determines if the user is authenticated and serves the correct page.
Building the website alongside the app but using SSR for the website for SEO purposes
Something else?

Django sign up with facebook return an error

*as Can't load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and sub-domains of your app to the App Domains field in your app settings.**
im using http://127.0.0.1:8000
so here is how i have set my facebook
domain App domains is 127.0.0.1
Then the url to the sign up page on django is
http://127.0.0.1:8000/user
first you need to install django ssl server then dont access with 127.0.0.1 but use localhost even though it will redirect you to 127.0.0.1 just use localhost:8000
Then on login to admin and on sites rename the domain name to localhost:8000
go to facebook development and add the following
domain name = localhost
go to add platform on bottom of the page and add website then fill this way
http://localhost:8000
HOW TO INSTALL DJANGO SSLSERVER
https://github.com/teddziuba/django-sslserver
HOPE IT WORKS😖😖

Sharing cookies between specific subdomains

I'm developing a spring-boot based backend app and an angularjs based frontend app hosted on the same domain with different subdomains.
myapp-frontend.mydomain.com //my angularjs app
myapp-backend.mydomain.com //my spring-boot app
otherapp-frontend.mydomain.com //some existing app running on same domain but unrelated
I'm trying to set the cookie which contains the jwt token generated in the backend to the browser when login api is called from the angularjs.
Cookie is set into browser with this code when I set the base domain url in spring-boot:
Cookie cookie = new Cookie("Authentication", jwt);
cookie.setPath("/");
cookie.setDomain("mydomain.com"); //this works
response.addCookie(cookie);
This set the cookie for other apps hosted on our company domain, but doesn't share user credentials with my app. Since I want the Authentication cookie header to be visible only to my frontend app, I tried to set the frontend subdomain url in the code. But this doesn't work.
...
cookie.setDomain("myapp-frontend.mydomain.com"); //not setting cookie
...
I understand that cookie cannot be set across different domains for security reasons but why is setting the subdomain url not working?
Out of curiosity, I tried putting backend subdomain in the setDomain() and cookie is set under myapp-backend.mydomain.com when I checked in chrome developer tools. Since it's working with base domain url, I believe I have already implemented the CORS correctly.
Am I missing something here? Any input would be greatly appreciated.

Laravel Socialite facebook login: Can't Load URL: The domain of this URL isn't included in the app's domains

I know this question has asked before many times. I've tried every one but no luck,
I my situation,
Website url: https://mywebsite.com/qa
redirect url: https://mywebsite.com/qa/login/facebook/callback
I have added my domain to app domain, redirect url to valid oAuth redirect url. But same error.
I even created a new app.
However facebook authentication is working fine with https://mywebsite.com/ domain. It's is a different app and a website.
The issue happens only with the site in the sub folder.
Any help ?
Thank you.
EDIT
Screenshot
Can you check if "Valid OAuth Redirect URIs" in Facebook app "Facebook login" setting is properly defined like shown in screenshot attached ?
Also have you checked if your app has strict mode enabled ?
This error occurs if your OAuth setting is not correct.
I would suggest to check all settings of your app thoroughly.

Spring social: authentication with Facebook on machines with a load balancer

My site uses spring social (1.1.6.RELEASE) and spring social facebook (2.0.3.REALEASE) to let users to sign in with their Facebook accounts.
Recently, Facebook requires all websites to use HTTPS based URIs for "Valid OAuth Redirect URIs". Here is what I have for "Valid OAuth Redirect URIs" at Facebook:
https://www.example.com/signin/facebook https://localhost/signin/facebook
I followed the suggestion at https://jira.spring.io/browse/SOCIAL-447 and have custom classes for FacebookConnectionFactory and OAuth2Template so that redirect URIs can start with https.
Everything works correctly on my laptop. However, I am unable to get it work for the site on the internet.
Here is the environment of my system: A load balancer device distributes requests to two Dell boxes. The loadbalancer takes HTTPS requests and sends HTTP requests to boxes.
Here is what I experience on the internet site: when I click the Facebook button to start authentication with Facebook, I am directed to Facebook login. After entering correct username and password, I am redirected my site, but with an exception: Here is the exception message:
Response body: {"error":{"message":"Can't Load URL: The domain of this
URL isn't included in the app's domains. To be able to load this URL,
add all domains and subdomains of your app to the App Domains field in
your app
settings.","type":"OAuthException","code":191,"fbtrace_id":"GeA8sXoebS3"}}
I have example.com in the App Domains field at Facebook, but it still fails. Does the system setup (including the load balancer) play a role here? I believe so, but cannot figure out how to fix it? Spent quite an amount of time and no success.
Any suggestion and info would be really appreciated.
Update
My site has been using SSL for a long time. It's authentication with Facebook was working before, but now it is not because of "https" requirement Facebook recently imposed.

Resources