I have completed writing the login flow for a user that clicks on a linkedin button on the homepage. It takes them to the linkedin endpoint. The user signs into their linkedin account, my app receives the access_token
which I use to get the users linkedin profile details, such as they full name, email address.
Now, how can I use this linkedin data, i.e., the users unique linkedin access_token, email address in order for the user to be 'logged' into the meteor app?
I do not want to use another package, I want to build this myself. I would like help to understand what I can do from this point please.
Is this what I need to set up once I have the access_token
Template.home.onRendered(function() {
})
Template.home.events({
'click #li-logo': function() {
Meteor.loginWithLinkedin();
}
})
I'm afraid implementing your own login system from scratch in Meteor is going to be too time consuming for you. Let me point out that one of the main reasons to use Meteor is to take advantage of the ease of app development it provides and the vast collection of available packages.
Anyway, if you really want to learn the inner workings of the login system and how a properly coded linkedin sign-in should work, the best possible thing to do is to look at the source code of the accounts-base and meteor-accounts-linkedin packages.
Configure your linkedin package this way (place this in a server-only block or file):
Meteor.startup(function() {
ServiceConfiguration.configurations.update(
{ "service": "linkedin" },
{
$set: {
"clientId": "<your client id>",
"secret": "<your secret>"
}
},
{ upsert: true }
);
});
HTH!