Redirect URI hasn't updated - facebook

I have a Meteor app and am using the following function to login with facebook
fbLogin = function() {
Meteor.loginWithFacebook({
requestPermissions: ['public_profile', 'email', 'user_location']
}, function(err) {
if (err)
// redirect to register if popup comes and user isn't on register
Session.set('errorMessage', err.reason || 'Unknown Eror');
console.log(Session.get('errorMessage'));
});
}
The credentials are set and working properly ( app id and secret)
Recently, I updated my Facebook app settings with a new Domain and Site url and yet it does not let me login. It throw the:
Given URL is not allowed 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.
error with the redirect_uri parameter in the url set to the old site url
Is there possibly a delay on Facebook's end or some other issue at hand?

This can happen when the redirect_uri submitted with the https://www.facebook.com/dialog/oauth request is not present in the list of Valid OAuth redirect URIs under:
Settings >> Advanced >> Security
add a redirect_uri like https://www.facebook.com/connect/login_success.html as an example

Related

What will be the correct Redirect URI after authentication for MSAdal in ionic 4?

My question is: when I authenticated from my Ionic 4 app I want to redirect it to the app root page. What will be the correct Redirect URI for authContext.acquireTokenAsync ? I have an error.
Answer from Microsoft.
The reply url specified in the request does not match the reply urls configured for the application: '1111111111111111111111111111'.
I use such code.
let authContext: AuthenticationContext = this.msAdal.createAuthenticationContext('https://login.windows.net/common');
authContext.acquireTokenAsync('https://graph.windows.net', 'ClinetID', 'http://localhost:8000','','')
.then((authResponse: AuthenticationResult) => {
console.log('Token is' , authResponse.accessToken);
console.log('Token will expire on', authResponse.expiresOn);
})
.catch((e: any) => console.log('Authentication failed', e));
You need to register an app as Native app on Active directory with the suggested redirect url or use a cutom redirect url.
I use urn:ietf:wg:oauth:2.0:oob as the redirect url, so the code should be
authContext.acquireTokenAsync('https://graph.windows.net','<Your Native App client ID>' , 'urn:ietf:wg:oauth:2.0:oob', '', null)
Note :You must keep the redirect url in azure portal and the redirect url in your code the same.

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

Users on my site can login with Facebook from this page: https://www.wonderweddings.com/login
However, I'm getting the 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 subdomains of your app to the App Domains field in your app settings.
I checked these posts to see what I could do:
How to turn off "Use Strict Mode for Redirect URIs" in facebook app
Facebook OAuth "The domain of this URL isn't included in the app's domain"
So I added what I thought were all possible URLs, but I keep getting the same error. Whether I disable or enable "Enforce HTTPS" does not matter. I also tried with "Embedded Browser OAuth Login" enabled and disabled.
https://www.wonderweddings.com/login.aspx
https://www.wonderweddings.com/login.aspx?loggedin=true&scope=email
https://www.wonderweddings.com/login
https://www.wonderweddings.com/login?loggedin=true
https://www.wonderweddings.com:443/login.aspx
https://www.wonderweddings.com:443/login.aspx?loggedin=true&scope=email
https://www.wonderweddings.com:443/login
https://www.wonderweddings.com:443/login?loggedin=true
I also tested if appId or app secret was changed due to saving, but that is not the case either.
I have a copy of this site running on another domain. This domain connects to another app, but other than that has similar settings, only this other app still has the setting "Use Strict Mode for Redirect URIs" disabled. There my code works perfectly. So I'm sure it's something I'm missing on Facebook with these settings.
My settings:
What else can I try?
The login button on your site is currently loading this URL:
https://www.facebook.com/v2.8/dialog/oauth?client_id=143381855734017&redirect_uri=https://www.wonderweddings.com/login.aspx?loggedin=true&scope=email
Facebook receives these query parameters:
client_id = 143381855734017
redirect_uri = https://www.wonderweddings.com/login.aspx?loggedin=true
scope = email
So the callback they are expecting is probably: https://www.wonderweddings.com/login.aspx?loggedin=true
Note that to be safe, the callback parameter should be URL encoded so that special characters are handled correctly (: / ? = all mean something in URLs)
You should change your site so that the link it opens is:
https://www.facebook.com/v2.8/dialog/oauth?client_id=143381855734017&redirect_uri=https%3A%2F%2Fwww.wonderweddings.com%2Flogin.aspx%3Floggedin%3Dtrue&scope=email
There has been Facebook update in October 2017. Use Strict Mode for Redirect URIs is now always enabled in Facebook App dashboard.
Solution in my case was related to that update: make sure that Valid Oauth redirect URIs input contains the same URI as provided in redirect_uri param.

How can I solve the error when accessing facebook login

I am new in mobile application. I am trying to do facebook login. I followed this Sample application https://pub.dartlang.org/packages/flutter_facebook_connect
but I am getting error in facebook page like this-
"cannot load URl: this domain URL is not included in api domain. to enable this url uploaded, enter all your app domains and subdomains on the api domain field in your app settings".
Use it this way:
_facebookSignIn() async {
final _facebookConnect = new FacebookConnect(
appId: '<APP_ID>',
clientSecret: '<CLIENT_SECRET>');
FacebookOAuthToken token = await _facebookConnect.login();
//FirebaseUser user = await FirebaseAuth.instance.signInWithFacebook(accessToken: token.access);
// return user;}
You have to follow the instructions at developers.facebook, and add http://localhost:8080 in your app Settings under Products>MyApp>Settings

Facebook login and share not working in Chrome extension because of app domain

I'm new to creating extensions so please bear with me.I'm trying to create an extension that shares the current page URL via Facebook. I followed the instructions Facebook developers site and created a project but i don't know what to put up as the app domain because local host works but chrome-extension://"id" doesn't.
On clicking share button, Error appears"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."
What do I put as the app domain and url?
I had the same problem. This is my solution:
Turn on Embedded Browser OAuth Login in facebook login settings (https://developers.facebook.com/apps/ -> choose your app -> Add product)
Implement manually login flow (https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow). Open oauth url in new tab, listen on changes and than when tab update to success page get from url access token, save token to storage and remove tab.
User facebook graph api (https://developers.facebook.com/docs/graph-api)
Use chrome.identity api to avoid protocol issue. It's looks like:
let options = {
interactive: true,
url: 'https://www.facebook.com/dialog/oauth?' +
stringifyQuery(Object.assign({
app_id: 'your app id here',
redirect_uri: `https://${chrome.runtime.id}.chromiumapp.org/provider_cb`,
response_type: 'token',
access_type: 'online',
}))
};
chrome.identity.launchWebAuthFlow(options, function (redirectUri) {
if (chrome.runtime.lastError) {
callback(new Error((chrome.runtime.lastError as string)));
return;
}
const response = parseUrl(redirectUri);
access_token = response[`#access_token`];
callback(null, access_token);
});

Facebook returning error message when using Firebase Login

I am trying to use a Firebase Facebook login in the following way:
Added this to my HTML (to test):
<div
class="fb-like"
data-share="true"
data-width="450"
data-show-faces="true">
</div>
and the firebase script:
<script src="https://cdn.firebase.com/js/client/2.2.5/firebase.js"></script>
This in my module:
var app = angular.module('myApp' ['firebase']);
and then inside my controller:
controller('yokoAppCtrl', function($scope, $firebaseObject, $firebaseAuth, wordsFactory){
var ref = new Firebase("https://resplendent-fire-4284.firebaseio.com/data");
// download the data into a local object
var syncObject = $firebaseObject(ref);
// synchronize the object with a three-way data binding
// click on `index.html` above to see it used in the DOM!
syncObject.$bindTo($scope, "data");
// create an instance of the authentication service
var auth = $firebaseAuth(ref);
// login with Facebook
auth.$authWithOAuthPopup("facebook").then(function(authData) {
console.log("Logged in as:", authData.uid);
}).catch(function(error) {
console.log("Authentication failed:", error);
});
})
When I reload the page in localhost:8000 I get the following message from Facebook:
Given URL is not allowed 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.
I followed the Firebase docs and this stackoverflow url: Facebook App: Firebase Simple Login URL error but I am still lost.
Under Site URL my app has http://localhost:8000/, I also tried to include under domain name localhost:8000 but Facebook removes it saying "No Top-Level Domains allowed". This is all under "Basic" Settings.
Under "Advanced" I have the following under Valid OAuth redirect URIs:
https://auth.firebase.com/v2/<myFirebase>/auth/facebook/callback
http://localhost:8080/
https://auth.firebase.com/auth/facebook/callback
and I already enabled Facebook connection in Firebase. What am I missing?