facebook authentication using laravel 5.1 socialite - facebook

hello im using localhost so i have recently switched to laravel 5.1 and im trying to use 'socialite' it provides so i have updated my config , services and the .env files so in my routes i also added these codes
Route::get('/', function () {
return view('welcome');
});
Route::get('auth/facebook', 'Auth\AuthController#redirectToProvider');
Route::get('auth/facebook/callback','Auth\AuthController#handleProviderCallback');
Route::get('home', array('as' => 'home', 'uses' => function(){
return view('home');
}));
then in my AuthController i have these codes
in my view the button 'login with facebook' has the href of auth/facebook but what happens is facebook is giving me an error saying
note: i also made my facebook app live in the facebook developers
i also added this on my domain but also have a warning
im still confused on where my error is. any idea what im doing wrong? thanks for advices.

Have you checked your site url value into Site URL field. Update it and check.
This should be work for you.

Related

Is there a way to get a users Bitmoji using Access tokens from Snapkit login web api?

I am attempting to use the snapkit login web api for a hybrid application. I have successfully been able to intercept the access token in the redirectURL. I was wondering if there was a way to get the users Bitmoji using this access_token and either the functions found in login.js or an http get call?
Api docs: https://docs.snapchat.com/docs/login-kit/#web
currently I have the access_token in a deeplinking function on my app.component.ts . I have attempted to push to a new page with the navController and passing in the access_token as a parameter, but this doesn't help when attempting to get the users information.
Thanks in advance for your help.
Here is the Deeplinking where I intercept the access_token using myapp://settings-set/ as the URL redirect and attempt to push a new page with the matching url.
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
statusBar.styleDefault();
splashScreen.hide();
this.deeplinks.routeWithNavController(this.nav,{
'/settings-set/:token': SettingsSetPage
}).subscribe((match) => {
// match.$route - the route we matched, which is the matched entry from the arguments to route()
// match.$args - the args passed in the link
// match.$link - the full link data
this.nav.push(SettingsSetPage, {
args: match
});
console.log('Successfully matched route', match.$args);
},
(nomatch) => {
// nomatch.$link - the full link data
console.error('Got a deeplink that didn\'t match', nomatch);
});
});
}
In the setting-set page I recieve the parameter using:
this.args = navParams.get('args');
console.log("this is args", JSON.stringify(this.args));
but don't know how to use the information to get the users information
The Bitmoji API can be very confusing at times. I suggest using Passport, a Node JS tool for OAuth, along with the Ionic framework. Snapchat has a guide that explains how to grab specific fields, such as user name and Bitmoji avatar, from a user's Snapchat profile using passport. You can follow this tutorial to learn how to integrate Node JS into your existing ionic app.
So in conclusion, try following these steps:
Integrate Node JS into your existing ionic app
Install Passport and follow Snapchat's guide for obtaining specific fields from the user's profile
Yes, like Mora said you can use passport which will make your life easier. We also have a sample passport app running here:
From the context you provided it seems like you have generated the code and not the access_token. After you get the code from the redirect url, you need to use the code to generate the access token. Check section 2.5 here.
Once you have the access token you can use that to request information. The crux of this lies in setting the "scope" correctly. To get the Bitmoji avatar make sure you set your scope to this at the very least:
var scope = ['https://auth.snapchat.com/oauth2/api/user.bitmoji.avatar'];
Hope this helps!

MVC6 Facebook identity misses email claim

I am debugging MVC6 MusicStore. What I've found is that Facebook ExternalIdentity which is accessed in ExternalLoginCallback method does not have an email claim. At the same time my test MVC5 application successfully gets that claim, so it's not the Facebook app problem.
Does anyone know if that is a beta bug?
For some reason this did not work after upgrading to Facebook API v 2.4. However adding .UserInformationEndpoint like this worked:
app.UseFacebookAuthentication(options =>
{
options.AppId = Configuration["Authentication:Facebook:AppId"];
options.AppSecret = Configuration["Authentication:Facebook:AppSecret"];
options.Scope.Add("email");
options.UserInformationEndpoint = "https://graph.facebook.com/v2.4/me?fields=id,name,email,first_name,last_name,location";
});
You would need to add email in the Facebook authentication options in Startup.cs
app.UseIdentity().UseFacebookAuthentication(options =>
{
options.Scope.Add("email");
});

Getting this error after months of no problems - redirect_uri not owned by application

I had this problem initially when I started the Facebook integration of our site. After doing some searching, found the solution and fixed it.
Now, a few months later, it has just stopped working. Nothing was changed in either the javascript code or the app settings on the Facebook developers site. I once again set about searching, and found the same answers as before: Site URL must match redirect_uri etc.
I currently have the App Domain: "domain.com"
And the Site URL: "http://www.domain.com"
Error given:
API Error Code: 191 API Error Description: The specified URL is
not owned by the application Error Message: redirect_uri is not
owned by the application.
I'm at a loss as to what has happened. Has Facebook changed their API? (I did check their documentation, and it's still the same).
Any help would be greatly appreciated. Javascript code below:
var publish = {
method: 'feed',
redirect_uri: 'http://www.domain.com',
link: 'http://www.domain.com',
picture: 'http://pathtoimage/logo.png',
name: 'Name',
caption: 'Title',
description: 'Description, blah blah'
};
function fbcallback(response) {
// do stuff here
}
FB.ui(publish, fbcallback);
Thanks
EDIT:
I checked the timestamp and the JS file hasn't been touched since the 16th of March, neither has the App Settings on Facebook, and my colleague tested this just a week ago (was still working then)
RESOLVED:
For others that are having the same problem, here's what worked for me.
It appears that FB have tightened their security, which is why it was originally working.
We were working on a new release, and were using the IP address instead of the domain to access the site. A new message I hadn't seen previously started appearing in the dev console:
When using FB.ui, you should not specify a redirect_uri.
Looks like the FB api now checks the URL domain in the address field of the browser (rather than the redirect_uri) against the Site URL in the Facebook App Settings. Tested this by temporarily pointing our domain to the IP address, and running the Facebook api code via the domain loaded site, and it worked. So while we're testing before the release, I'll use http://localhost:8080 as the Site URL, then update it to the site's domain when it goes live.
Thanks to the people who helped to point me in the right direction!
Try to check if in your app settings (on Facebook Developers) you have set:
'App domain' with the domain where you're using the app
Check the 'Website with Facebook Login' option and then set the domain there

Get Group details from Facebook using Appcelerator

I am developing an iOS app using Appcelerator. In this app I need to get information from a Facebook Group.
Using the URL directly works fine. I get a complete data set of all groups docs.
https://graph.facebook.com/2389876494501676/docs?access_token=TOKEN HERE
But using the Appcelerator Facebook module just returns an empty data set.
Titanium.Facebook.requestWithGraphPath('2389876494501676/docs', {}, 'GET', function(e) {
Ti.API.info(e);
});
What is wrong?
I don't see you passing token via your function. That might be the problem
Nope, the token is handle by the module already.
Try Ti.API.info(e.result) you should be able to see the result.

webview is not redirecting anymore (Facebook API in webos)

I am trying to implement the possibility to post on your facebook wall from my app. http://developers.facebook.com/docs/authentication/ web application section.
It used to work. What i did was open the following URL in a webview
"https://graph.facebook.com/oauth/authorize?client_id=123456789123456&redirect_uri=http://www.mydomain.com&scope=publish_stream&display=wap"
And after the user typed his credentials and gives me the neede permissions, the webview was redirected to the redirect uri (www.mydomain.com) including a get variable from which i parsed a code which is needed.
But all of a sudden i am not redirected to the redirect_uri anymore. I am redirected to a blank facebook page (http://m.facebook.com/connect/uiserver.php)
It DOES work on a PC Browser and even in the webos browser, but not in the webview.
I even wrote a complete new application with nothing but a webiveiw in it. The main-assistant.js looks like this.
function MainAssistant(argFromPusher) {
}
MainAssistant.prototype = {
setup: function() {
Ares.setupSceneAssistant(this);
console.log("setup");
//this.controller.get("facetimes").mojo.clearCookies();
//this.controller.get("facetimes").mojo.clearCache();
this.controller.get("facetimes").mojo.openURL("https://graph.facebook.com/oauth/authorize?client_id=123456789&redirect_uri=http://www.mydomain.com/callback&scope=publish_stream&display=touch");
this.controller.listen("facetimes",Mojo.Event.webViewTitleUrlChanged,this.titleChanged.bind(this));
},
cleanup: function() {
Ares.cleanupSceneAssistant(this);
},
titleChanged: function(event){
console.log(event.url + " DAS IST DIE URL");
}
};
Any ideas?
Thanks in advance.
Blockquote
I wrote up the entire SDK with facebook api example on my blog
Facebook Connect WebOS
It's open sourced, the guide will give you the github address