Facebook access token not working in php - facebook-javascript-sdk

I take the access_token in my html page.
function fb_login() {
FB.login(
function(response){
//etc....
},
{scope:'email,user_about_me,user_activities,user_birthday,user_education_history, user_groups,user_hometown,user_likes,user_location,user_subscriptions,user_website, user_events,user_games_activity,user_status,friends_website,publish_actions, user_online_presence,publish_stream,offline_access,status_update,share_item, read_friendlists'}
);
}
Facebook Login...
after that, I want to publish stream with a php page. But this is impossible with access token error.
How to fix it? Why it isnt working?

See the example on github for integrating Facebook JS SDK authorization with PHP SDK authoriziation. Also make sure you are using the latest version of each SDK.

Related

Problem with Azure AD B2C MSAL authentication

I'm trying to add basic authentication to a Vue.js spa. I'm following the tutorial on https://learn.microsoft.com/en-us/azure/active-directory-b2c/tutorial-single-page-app
In case of the sample SPA provied by MS everything works. When I try to do the same in Vue.js I get the following error:
"ClientAuthError: access_token_entity_null: Access token entity is null, please check logs and cache to ensure a valid access token is present." when doing
.then(handleResponse)
.catch(error => {
console.log(error);
});
However after refreshing the page user seems to be logged in:
myMSALObj.getAllAccounts()
returnes the account used during the login.
What I may be doing wrong? I was unable to find any useful info about it :(
As mentioned in the comments using an older version of the library solved the problem.
This issue seems to have been solved in version 2.14.2
Instead of downgrading you should try upgrading :-)

Is there anyway/endpoint to create access_token in code for Dropbox SDK authorization?

I am using dropbox javascript sdk for file uploads using following end points.
For file below 150MB
/upload
For file above 150MB
/files/upload_session/start
/files/upload_session/append_v2
For Authorization, I am using the following code for now.
const ACCESS_TOKEN = 'my_access_token_created_manualy_from_app_console';
var dbx = new Dropbox.Dropbox({ accessToken: ACCESS_TOKEN, refresh_token });
Now I don't want to go to the app console every now and then to get access token.
Is there any way I could handle it in my code? Any API/ajax request to get access token in response to app_key and app_secret?
Getting a Dropbox access token for a user's account always requires some initial manual interaction from the user to authorize the app in some way. This cannot be done entirely programmatically. For the developer's own account, such as in your case, you can generate an access token on the App Console. For arbitrary end-users, this is instead processed via the OAuth app authorization flow.
You can refer to the OAuth Guide and authorization documentation for more information. For the Dropbox JavaScript SDK in particular, there's an example of processing the OAuth flow here.

How to obtain a LinkedIn token via Titanium

I want to log in to my application via LinkedIn. This can be done via a call to Cloud.SocialIntegrations.externalAccountLogin() .
However, the function above needs a 'token' parameter. The 'token' is provided by LinkedIn by following the oauth flow(retrieve an authorization code, exchange of the Authorization Code for a Request Token).
Is there an easy way in titanium to obtain this token? I have investigated aaronksaunders's(https://github.com/aaronksaunders/clearlyinnovative.linkedIn) code, and searched on gitt.io. Or do we need to write all of this boilerplate code ourselves?
NOTE: At the moment, I don't want to proxy the call via a server(I prefer not to set up an SSL certificate, etc) and I don't have an appcelerator team or enterprise plan, so I can't use their node(arrow) backend to proxy these calls.
Additional question: is it sufficient to configure the iOS Bundle Identifiers(on the LinkedIn app settings page)? And do I need to use this 'iOS settings' application Id(also on the LinkedIn app settings page)?
I have successfully finished my flow. Everything is explained in this blog post from Ramkumar M: http://shareourideas.com/2012/12/18/linkedin-connect-for-appcelerator-titanium/. The result is achieved by using a modified commonjs module version of the social.js library: https://gist.github.com/rampicos/4320296
This library has a very clean api, the whole flow is nothing more than:
var social = require('social');
var linkedin = social.create({
consumerSecret : CONSUMER_SECRET,
consumerKey : CONSUMER_KEY,
site: 'linkedin'
});
linkedin.authorize(function(){
//callback
});
I don't use the
Cloud.SocialIntegrations.externalAccountLogin()
because the login is done by the social.js library.
LinkedIn app: I have only configured the iOS bundle identifiers.

android simple facebook returns "Canceled by user" when publishing post

I have configured android simple facebook library for my app.
It's working properly, but the problem is when using mSimpleFacebook.publish(feed, true, onPublishListener), it always fails with error "canceled by user".
Permission[] permissions = new Permission[] {
Permission.EMAIL,
Permission.PUBLIC_PROFILE,
Permission.PUBLISH_ACTION
};
Any idea what the problem might be?
Thanks

Tweeting from within meteor application

I am trying to build an app with Meteor that involves the user signing in with twitter, facebook, or google+, and then posting to those accounts from within the application.
First I'm trying to get twitter to work. I have my twitter sign in working, with the permission to tweet on their behalf working, but how to I actually send a tweet?
I think I need this: https://dev.twitter.com/docs/api/1.1/post/statuses/update but I can't figure out how the authentication works with Meteor.
Are there any examples that can help me here? Or tutorials?
You need an API to help you a bit unless you want to do it manually using REST with Meteor.http. I'd recommend you get meteorite: https://github.com/oortcloud/meteorite
Its installed like a node module via npm install -g meteorite
Meteorite is a wrapper for meteor that lets you use the community packages over at http://atmosphere.meteor.com
The twitter package you could use is twitter-api installed via mrt add twitter-api : https://github.com/Sewdn/meteor-twitter-api
Once added using the server api you can add a tweet via:
Server JS
var twitter = new Twitter();
Meteor.methods({
postTweet: function (text) {
if(Meteor.user())
twitter.postTweet(text),
return true;
}
});
Client JS
//Use this in your click handler where you want to post a tweet:
Meteor.call("postTweet", "This is Twweeeeeetttt!", function(err,result) {
if(!err) {
alert("Tweet posted");
}
});
The api takes care of the user's oauth tokens so you don't have to worry too much