Liferay 7.0 Facebook Integration - facebook

I'm trying to integrate Facebook with Liferay. I have configured all the necessary settings required (Reference : https://community.liferay.com/blogs/-/blogs/sso-via-facebook). When I click on facebook link from Login Portlet a popup window appears with Facebook app request and credentials to login, as I enter email id and password, it redirects to Liferay home page but does not get logged in. The following url appears after redirecting : http://localhost:8080/web/guest/home#=
And When I make the facebook app public and try to login then I get below error
{
"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 sub-domains of your app to the App Domains field in your app settings.",
"type": "OAuthException",
"code": 191,
"fbtrace_id": "GQI8Z8xFfoB"
}
}
Any idea why user is not getting logged in? Am I missing any step?
Liferay version : 7.0 GA3

The answer you are looking for is on the message itself:
"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."
Your issue is not on Liferay's side but on your Facebook configuration. All domains you intent to use need to be white-listed on your facebook app page.

Related

Facebook login through Instagram: Error validating verification code

I am using a web view (in an iOS Swift app) to let the users to login to their Instagram account or Facebook account to later get their display name to use it in my app.
I have an Instagram app (added inside a Facebook app in Meta for Developers console's dashboard), I finished setup for this Instagram app in the section: Instagram Basic Display -> Basic Display in the dashboard, and I got it to work well ONLY if I login with an Instagram account (added in the Instagram Test Users section), but when I try to login using Facebook (by pressing on the "Login with Facebook" button) and finish the login flow, calling the method https://api.instagram.com/oauth/access_token fails with the following error:
{
"error_type": "OAuthException",
"code": 400,
"error_message": "Error validating verification code. \
Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request"
}
I double checked that I use the same redirect uri in both methods:
https://api.instagram.com/oauth/authorize
and
https://api.instagram.com/oauth/access_token
which is simply as this one: "https://my-domain.com/" (with a trailing slash)
I also set the same exact redirect uri in Facebook Login and Instagram Basic display in the console's dashboard.
The following options are enabled in Facebook login console:
Enforce HTTPS, Embedded Browser OAuth Login, Client OAuth login, Use Strict Mode for redirect URIs, Web OAuth login and Login from Devices.
I tried to use the Facebook client id and secret instead of IG's but to no avail.
any thoughts are appreciated.

On Mobile Login : Can't Load URL: The domain of this URL isn't included in the app's domains

I always get this error when I try to login in my application, which uses facebook login on my phone, however my app links perfectly fine on my computer, just not on my phone.
I believe it may have something to do with the facebook login being a new pop-up page on computers, whereas on mobile its loaded as a page.
I have tried everything and the errors will alternate between:
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.
and
URL blocked: This redirect failed because the redirect URI is not white-listed in the app's client OAuth settings. Make sure that the client and web OAuth logins are on and add all your app domains as valid OAuth redirect URIs. (which I able to login but the app fails to go to my main page which then gives this error)
depending on whether I leave the "Valid OAuth ReDIRECT Urls" section blank.(till this point I have tried all posisble redirect urls I can think of, but its no use) I have also enabled client and web oauth login and login from devices.
The Url error is of no help, which is just the error:
https://m.facebook.com/dialog/oauth?client_id=xxxxxxxxxxxx&redirect_uri=https%3A%2F%2Fxxxxxxxxxxx.azurewebsites.net%2F%3Fcode%3DAQBuiSRMjQ3Cpsy4SClqCyzTU9ReSvOTynI67PNIBAI0kmj1qLDb5poUzVEZSlPtUjnQ_TpXTvS7yggVJpnZiVuP6tcp4kyD3EYfjc-_5g9bSNBdUDnjixB4AufqfbYiQD6pHlRR3qhkDoOXrL56WfP7WlA0a_OZ4Me8BqfrmDd6tLuqIezi4IE-88QljOdDtekKed9z-AQuakSKty1Zu8ER91Ie3iCLBG8Fd7CczXFJkJm6aLB29QjWTC3HTPWIsknNSl_O93urR8ChochH2ANuN2hYLUD8SH6SDVYS0q4oN3_OLqqdToYwWWoZwzjop0OcWq6xiDzb5_CXnapPsP78%26state%3Dfacebookdirect%23_%3D_&state=facebookdirect&return_scopes=false&scope=public_profile%2Cemail&response_type=code&auth_type

Facebook Login - Can't Load URL: The domain of this URL isn't included in the app's domains

I really have problem with Facebook. The old application don't require Valid OAuth redirect URIs, today, I have a problem with this app and remove it. I created again. I have two problem is:
Facebook Login not accept http protocol (resolved).
Facebook Login require Valid OAuth redirect URIs (current question)
My URL is: https://sharengay.com/anlink/
When click button Login it show error like:
Can't Load URL: The domain of this URL isn't included in the app's domains
The URL when click button login is:
https://www.facebook.com/v2.10/dialog/oauth?client_id=2165341230417089&state=4bd285b45a9d3fdba98d894cb2fc7efc&response_type=code&sdk=php-sdk-5.5.0&redirect_uri=https%3A%2F%2Fsharengay.com%2Fanlink%2Flogin.php&scope=public_profile%2Cuser_friends
I was add in Valid OAuth redirect URIs is:
Sorry about language, I add three values:
https://sharengay.com/anlink
https://sharengay.com/
https://sharengay.com/anlink/layouts/Social/Connector/SocialLogin.ashx?type=access
I don't have experience with Facebook OAuth. I think I lost URL, so Facebook show this error.

Facebook Login Integration Error:

I'm working with a contest platform and am trying to get it to where and individual can create an account via Facebook.
The biggest issue I'm running into is that whenever I enter the domains into the App Domains portion I receive this:"App domains must match the domain of the Secure Canvas URL, Mobile Site URL, Unity Binary URL, Site URL, or Secure Page URL. Please correct these domains:"
Additionally, when I attempt to test the Facebook login button, I receive this error message in the pop-up:"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've inquired with the Support Team from the contest platform and was informed of this:
"We had the Engineers look at this issue on your site and it looks like the configuration in facebook might not be correct.
What you need to make sure of is that facebook login authentication is enabled for the Website (Web) then only it will work.
The app domain:------
Contact email: your email address
Then in the Website section
Site url:------"
I can't seem to locate where the "Site URL" section is that I need to be putting in a url. I've put in the OAuth Client Redirect URLs...maybe they aren't correct?
Need some major help here.

Is Mobile Web URL enough to add an app domain in Facebook apps?

When I first tried to add an app domain to my Facebook app, it gave the following error..
Error You have specified an App Domains but have not specified a Site
URL or a Mobile Web URL must be derived from your Site URL
or your Mobile Web URL.
OK. So i added a Mobile Web URL. Now I am able to add an App Domain. I click save.
But When i come back to the page App Domain field is empty
But if I fill in the Site URL field under "Website with Facebook Login", I am able to give the app domain and the app domain field stays put.
SO BASICALLY, to give an app domain, I must give a SITE URL, even if I am not using "Website with Facebook Login" Is that Correct?