pobuchi / meteor-accounts-linkedin Goto Github PK
View Code? Open in Web Editor NEWA meteor package for LinkedIn's login service.
Home Page: https://atmospherejs.com/pauli/accounts-linkedin
License: MIT License
A meteor package for LinkedIn's login service.
Home Page: https://atmospherejs.com/pauli/accounts-linkedin
License: MIT License
Steps to reproduce.
I've tried changing the loginStyle to redirect
but I don't think LinkedIn recognizes that function.
I am getting this error message... just installed the package and added the service configuration to the configuration json file.
ERROR:
The passed in client_id is invalid "undefined"
Configuration file (accounts segment):
"accounts": {
"linkedin":{
"service" : "linkedin",
"clientId" : "xxxxxxx",
"secret" : "WkYRjtI8rXc8rglu",
"loginStyle" : "popup"
}
}
If you change your profile picture in LinkedIn, the pictureUrl field from the Users collection is not being updated. I get this error in the browser console when I try to display the pictureUrl field:
Failed to load resource: the server responded with a status of 404 (Not Found)
How to replicate:
Change your picture in LinkedIn and try to browse to the URL from pictureUrl field (https://media.licdn.com/xxx...)
const {
requestPermissions,
...otherOptionsToPassThrough
} = options
This code breaks with
Uncaught TypeError: Cannot destructure property 'requestPermissions' of 'options' as it is null.
when no options were passed in Meteor.loginWithLinkedin
method.
Passing requestPermissions or even an empty object helps as a workaround.
Hi, I am just starting learning how to allow user login in my Meteor using LinkedIn credential and this package. Before adding the package, I still able to run 'meteor -p 8080'. After adding the package, I got the error below. I am not sure the package causing this error so that I tried remove it. It works fine again after removing.
If you still actively working on this package, please assist. Appreciated.
Version: Meteor 1.4.2.7.
Error:
After meteor add pauli:accounts-linkedin
, I have this:
Changes to your project's package version selections:
accounts-base added, version 1.2.14
accounts-oauth added, version 1.1.15
ddp-rate-limiter added, version 1.0.6
localstorage added, version 1.0.12
oauth added, version 1.1.12
oauth2 added, version 1.1.11
pauli:accounts-linkedin added, version 1.3.1
pauli:linkedin added, version 1.3.1
rate-limit added, version 1.0.6
service-configuration added, version 1.0.11
pauli:accounts-linkedin: Accounts service for LinkedIn accounts
Then I start the app (without adding any new code yet)
tpham045:~/workspace/portfolio (LinkedInAPI) $ meteor -p 8080
W20170215-21:40:47.566(0)? (STDERR)
W20170215-21:40:47.698(0)? (STDERR) /home/ubuntu/.meteor/packages/meteor-tool/.1.4.2_6.uykbpj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:313
W20170215-21:40:47.699(0)? (STDERR) throw(ex);
W20170215-21:40:47.699(0)? (STDERR) ^
W20170215-21:40:47.708(0)? (STDERR) MongoError: not authorized on heroku_5x9b24w5 to execute command { insert: "system.indexes", documents: [ { ns: "heroku_5x9b24w5.users", key: { username: 1 }, name: "username_1", unique: 1, sparse: 1 } ], ordered: true }
W20170215-21:40:47.708(0)? (STDERR) at Object.Future.wait (/home/ubuntu/.meteor/packages/meteor-tool/.1.4.2_6.uykbpj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:449:15)
W20170215-21:40:47.709(0)? (STDERR) at MongoConnection._ensureIndex (packages/mongo/mongo_driver.js:828:10)
W20170215-21:40:47.709(0)? (STDERR) at [object Object].Mongo.Collection._ensureIndex (packages/mongo/collection.js:685:20)
W20170215-21:40:47.709(0)? (STDERR) at setupUsersCollection (packages/accounts-base/accounts_server.js:1491:9)
W20170215-21:40:47.710(0)? (STDERR) at new AccountsServer (packages/accounts-base/accounts_server.js:51:5)
W20170215-21:40:47.710(0)? (STDERR) at meteorInstall.node_modules.meteor.accounts-base.server_main.js (packages/accounts-base/server_main.js:9:12)
W20170215-21:40:47.711(0)? (STDERR) at fileEvaluate (packages/modules-runtime.js:181:9)
W20170215-21:40:47.711(0)? (STDERR) at require (packages/modules-runtime.js:106:16)
W20170215-21:40:47.712(0)? (STDERR) at /home/ubuntu/workspace/portfolio/.meteor/local/build/programs/server/packages/accounts-base.js:1972:15
W20170215-21:40:47.713(0)? (STDERR) at /home/ubuntu/workspace/portfolio/.meteor/local/build/programs/server/packages/accounts-base.js:1983:3
W20170215-21:40:47.713(0)? (STDERR) - - - - -
W20170215-21:40:47.713(0)? (STDERR) at Function.MongoError.create (/home/ubuntu/.meteor/packages/npm-mongo/.2.2.11_2.8w0uvr++os+web.browser+web.cordova/npm/node_modules/mongodb-core/lib/error.js:31:11)
W20170215-21:40:47.714(0)? (STDERR) at /home/ubuntu/.meteor/packages/npm-mongo/.2.2.11_2.8w0uvr++os+web.browser+web.cordova/npm/node_modules/mongodb-core/lib/connection/pool.js:483:72
W20170215-21:40:47.714(0)? (STDERR) at authenticateStragglers (/home/ubuntu/.meteor/packages/npm-mongo/.2.2.11_2.8w0uvr++os+web.browser+web.cordova/npm/node_modules/mongodb-core/lib/connection/pool.js:429:16)
W20170215-21:40:47.714(0)? (STDERR) at [object Object].messageHandler (/home/ubuntu/.meteor/packages/npm-mongo/.2.2.11_2.8w0uvr++os+web.browser+web.cordova/npm/node_modules/mongodb-core/lib/connection/pool.js:463:5)
W20170215-21:40:47.715(0)? (STDERR) at Socket.<anonymous> (/home/ubuntu/.meteor/packages/npm-mongo/.2.2.11_2.8w0uvr++os+web.browser+web.cordova/npm/node_modules/mongodb-core/lib/connection/connection.js:309:22)
W20170215-21:40:47.715(0)? (STDERR) at emitOne (events.js:77:13)
W20170215-21:40:47.716(0)? (STDERR) at Socket.emit (events.js:169:7)
W20170215-21:40:47.716(0)? (STDERR) at readableAddChunk (_stream_readable.js:153:18)
W20170215-21:40:47.716(0)? (STDERR) at Socket.Readable.push (_stream_readable.js:111:10)
W20170215-21:40:47.717(0)? (STDERR) at TCP.onread (net.js:537:20)
=> Exited with code: 1
accounts-linkedin
Doesn't go well with accounts-ui
As per latest package I am getting below error.
"Error in OAuth Server: unauthorized_scope_error"
Thanks
I want more information from linkedin, can i use requestPermission with this package?
Please explain how to do it.
Currently I am in the version 2.2.1 but when I try to update to Meteor 2.3.4 (which switches to Node 14 and has dependency updates), it throws errors because the package is using [email protected] (it needs [email protected]) and it is using [email protected] and it needs [email protected].
Update passing of parameters for api code to get info so it can be configed
Is there any difference from the original package?
Why should we spend time trying to understand which of the two packages is the one to be used?
Tnx,
Luca
I'm having a weird issue with Meteor.loginWithLinkedin function. I'm using Collection2 for Schema settings and my user.profile schema looks like that.
Schemas.UserProfile = new SimpleSchema({
full_name: {
type: String,
regEx: /^[a-zA-Z -]{2,64}$/,
optional: true
},
about: {
type: String,
defaultValue: ''
},
skills: {
type: [Skills],
optional: true
},
});
The problem is with my skills array field in UserProfile. I'm using my own skills system and it works perfectly in app. But since LinkedIn also returns "skills" object upon authorization I get this error when creating new user:
I20150430-20:25:43.304(-4)? Exception while invoking method 'login' Error: Skills must be an array
I20150430-20:25:43.304(-4)? at getErrorObject (packages/aldeed:collection2/collection2.js:369:1)
I20150430-20:25:43.304(-4)? at [object Object].doValidate (packages/aldeed:collection2/collection2.js:352:1)
I20150430-20:25:43.305(-4)? at [object Object].Mongo.Collection.(anonymous function) [as insert] (packages/aldeed:collection2/collection2.js:154:1)
I20150430-20:25:43.305(-4)? at Object.Accounts.insertUserDoc (packages/accounts-base/accounts_server.js:1017:1)
I20150430-20:25:43.305(-4)? at Object.Accounts.updateOrCreateUserFromExternalService (packages/accounts-base/accounts_server.js:1164:1)
I20150430-20:25:43.305(-4)? at Object.updateOrCreateUserFromExternalService (packages/splendido:accounts-meld/lib/accounts-meld-server.js:635:1)
I20150430-20:25:43.305(-4)? at [object Object].Package (packages/accounts-oauth/oauth_server.js:45:1)
I20150430-20:25:43.305(-4)? at packages/accounts-base/accounts_server.js:358:1
I20150430-20:25:43.305(-4)? at tryLoginMethod (packages/accounts-base/accounts_server.js:161:1)
I20150430-20:25:43.305(-4)? at runLoginHandlers (packages/accounts-base/accounts_server.js:355:1)
When I'm removing "skills" field from UserProfile Schema, everything works fine and user is created and being logged in automatically.
I'm assuming that Meteor.loginWithLinkedin is trying to match the fields from response and insert them into profile automatically which I do not need (I'm using my own skill system).
I tried to bypass it with collection2 before filter hooks like that:
Meteor.users.before.insert(function(userId, user){
if(typeof(user.services.linkedin) != "undefined"){
console.log(user.services.linkedin);
delete user.services.linkedin.skills;
}
});
But this never gets called because the error happens before that hook.
Is there a way to prevent the UserProfile to be filled automatically with matching fields?
PS: I'm also using Meteor.loginWithGoogle in my app and don't have those issues.
I get the following error using meteor-accounts-linkedin only on mobile, using a Android/ Google Chrome 54.
When Linkedin redirects me to my app, the app cannot login.
message: No matching login attempt found [145546287]
stack:
Error: No matching login attempt found [145546287]
at [object Object]. (packages/accounts-oauth.js:113:21)
at packages/accounts-base/accounts_server.js:471:32
at tryLoginMethod (packages/accounts-base/accounts_server.js:248:14)
at AccountsServer.Ap.runLoginHandlers (packages/accounts-base/accounts_server.js:468:18)
at [object Object].methods.login (packages/accounts-base/accounts_server.js:531:27)
at [object Object].methodMap.(anonymous function) (packages/meteorhacks_kadira.js:2731:30)
at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1712:12)
at packages/ddp-server/livedata_server.js:711:19
at [object Object]..extend.withValue (packages/meteor.js:1122:17)
at packages/ddp-server/livedata_server.js:709:40
https://ui.kadira.io/et/5cba73dd-bbd4-44c0-bff5-504eb116e2c4/qxeEaGEwHYCHvEMfP
can any one guide how to access profile picture url in linkedin using pauli:accounts-linkedin
The package is displaying the credentials information when you run the Meteor.loginWithLinkedIn. This should not be displayed since its sensitive data.
Same issue as mentioned in issue PoBuchi/meteor-linkedin#7. I've found a bug and would like to contribute a fix but need to know the license first.
I notice that your package is a fork of @yefim's package so I mentioning him here in hopes that he will indicate the license associated with his original repo.
"Note: You're using accounts-ui and accounts-linkedin,
but didn't install the configuration UI for the LinkedIn
OAuth. You can install it with:
meteor add linkedin-config-ui"
is showing all the time, even if pauli:linkedin-config-ui is added and even if service-configuration is removed after everything is configured
2016-02-23 14:33:10-05:00{"line":"71","file":"oauth_server.js","message":"Unable to base64 decode state from OAuth query: undefined","time":{"$date":1456255990654},"level":"warn"}
73bw
2016-02-23 14:33:10-05:00{"line":"71","file":"oauth_server.js","message":"Unable to base64 decode state from OAuth query: undefined","time":{"$date":1456255990657},"level":"warn"}
73bw
2016-02-23 14:33:10-05:00{"line":"398","file":"oauth_server.js","message":"Error in OAuth Server: invalid_scope","time":{"$date":1456255990659},"level":"warn"}
this doesn't work for me on weworkmeteor.com - i get the above error when trying to log in - the oauth window pops open for a moment, the closes by itself before the linkedin login prompt is displayed
i've disabled linkedin login on weworkmeteor - if you need to replicate, let me know and i'll turn it back on for you
This issue was reported on stackoverflow. The problem is that pauli:linkedin
retrieved user IDs from the wrong place and LinkedIn recently changed the values stored in that place. As a result, existing users have a value in services.linkedin.id
that doesn't correspond to anything that LinkedIn returns as part of an OAuth response. As a result, the IDs of all existing users need to migrated, if possible.
Proposed fix:
services.linkedin.idIsFixed
property and index it for efficiency.services.linkedin.id
but doesn't have a value of true
for services.linkedin.idIsFixed
:
services.linkedin.accessToken
to request the user's correct id from LinkedIn.services.linkedin.id
with the obtained value, and set services.linkedin.idIsFixed
to true
.There are 2 wrinkles in this plan:
services.linkedin
info. My brettle:accounts-add-service
package might be useful for such a case. Regardless, this wouldn't handle users who don't have any other way of accessing their account. When such a user logs in with LinkedIn, we could see whether his publicProfileUrl
matches that of an existing account, and if it does, update the ID on that account and log the user into it. Of course, this will only work if LinkedIn hasn't and doesn't change the format of that URL.Thoughts?
Hi! I installed the package and are now getting this error... used to work a while ago but I'm not sure which version of Meteor may have presented the issue first.
I get no error on the MEteor server console, but I do get this error on the Client side (other logins work... Facebook, Google, Twitter), so I wonder if there might be an incompatibility issue between Meteor 1.6.1, and your package.
Thanks by the way!
accounts-ui-unstyled.js:1245 Uncaught TypeError: loginWithService is not a function
at Object.click .login-button (accounts-ui-unstyled.js:1245)
at blaze.js:3775
at Function.Template._withTemplateInstanceFunc (blaze.js:3744)
at Blaze.View. (blaze.js:3774)
at blaze.js:2617
at Object.Blaze._withCurrentView (blaze.js:2271)
at Blaze._DOMRange. (blaze.js:2616)
at HTMLDivElement. (blaze.js:863)
at HTMLDivElement.dispatch (jquery.js:4721)
at HTMLDivElement.elemData.handle (jquery.js:4389)
I added meteor add pauli:accounts-linkedin in my meteor application and Configured like below
Template.Login.events({
'click #login-with-linkedin' : function () {
Meteor.loginWithLinkedIn({
requestPermissions: ['r_basicprofile','r_emailaddress']
}, function(err){
if(err){
console.log('error with login is: ', err);
}else{
var user = Meteor.user();
console.log(user);
//In user object I'M able to see the basic information,but how can i get the accesstoken
//Here i want to redirect my dashboard page
}
});
}
});
How can i get the access token ?
On button click I get the following error
Uncaught TypeError: undefined is not a function social.coffee:54Template.entrySocial.events.click .btn social.coffee:54(anonymous function) template.js:272(anonymous function) view.js:746Blaze._withCurrentView view.js:404(anonymous function) view.js:745(anonymous function) events.js:47jQuery.event.dispatch jquery.js:4624elemData.handle
As Linkedin api changed quite a bit, are there a need to get data cleaned up after oauth call.
So if in `ServiceConfiguration.configurations` pass extra option, like `cleanedUpData:true` it will return:
profile: {
firstName: 'Jon',
lastName: 'Doe'
linkedinId: 'id',
email: '[email protected]',
picture: 'singleUrl' // specify wich identifier you want first or last(last one is with highest res)
}
Any thoughts?
Hi, I'm getting the following error while trying out this package and not able to login with LinkedIn.
Unable to parse state from OAuth query: ?<i?rV↨iOZ♥OWj1.t♀?m½ nxµ&E¡⌂áAR
Unable to parse state from OAuth query: ?<i?rV↨iOZ♥OWj1.t♀?m½ nxµ&E¡⌂áAR
Unable to parse state from OAuth query: ?<i?rV↨iOZ♥OWj1.t♀?m½ nxµ&E¡⌂áAR
Error in OAuth Server: Failed to complete OAuth handshake with LinkedIn. failed [400] {"error_description":"missing required parameters, includes an invalid parameter value, parameter more than once. : Unable to retrieve access token : appId or redirect uri does not match authorization code or authorization code expired","error":"invalid_request"}
Here's my server side configuration
ServiceConfiguration.configurations.remove({
service: "linkedin"
});
ServiceConfiguration.configurations.insert({
service: "linkedin",
clientId: <my clientid>,
secret: <my secret>
});
And on client side event I do
Meteor.loginWithLinkedin({}, function(err) {
if (err) {
console.log("ERROR: ", err.message); //error handling
} else {
console.log("NO ERROR ON LOGIN");
}
});
Saw this error here as well
According to the following, LinkedIn will drop support for OAuth 1.0 on March 1st, 2019.
https://engineering.linkedin.com/blog/2018/12/developer-program-updates
It will only allows OAuth2.
Does this package currently uses OAuth2. By default? or we need to do something special?
Hi,
I noticed that the package, for me at least, fails to function with LinkedIn profiles without a profile picture. Could this issue be addressed as profile picture is an optional field in LinkedIn and it is not unheard of that people do not add a profile pic.
I went through the compiled code and it seems that there is no option to disable getImage()
function from being called? If I am mistaken, and it is simple, could you provide an example in the README.md.
Thanks in advance.
Hi there,
after updating to 2.0.0 alongside Meteor 1.4.3.1, it seems like an ID somewhere isn't set properly for the accounts-core package to execute loginWithService()
.
Interestingly enough, downgrading to 1.3.1 works once again without a hitch, even with Meteor 1.4.3.1.
EDIT: Logging in works again by downgrade, but logging out doesn't - there is no error. Is this just me?
I have used meteor official accounts-ui, accounts-password, accounts-facebook and this linkedin package, but only in case of linkedin, after logging in, in the login hyperlink, name/email does not show up, only a down arrow. (as can be seen in top left corner of screenshot.), where as in case of facebook, name shows, and in case of accounts-password, email shows up.
I'm getting an error for these uris :
Do I need to configure something ?
Hello package works great, but for some reason it creates bad data on register/login: profile.name : "[object Object] [object Object]"
Is there any possibility to get response in the callback function, so I can maybe call a method to get the correct data?
Hi Pauli,
I installed your package and tried to login using Meteor.loginWithLinkedin(...)
However nothing happens when doing this code. The function works and there are no errors but there is no popup either.
Any idea why?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.