- Create credentials;
- Install and configure vue-authenticate;
- Create Social Login component;
- Get post from the social network on API;
- Set data to local storage.
Let's get started!
First of all, you need to create credentials that will send to the social network, for this purpose need account Google or Facebook because this article will be about login with Google and Facebook.
If you want to use google, go to the https://console.developers.google.com/
You should see this page. Click create.
Enter your project name and organization(if needed).
Our next step will add API services for your project. After the successfully created project you can see something like this:
Here click Enable APIs and Services.
And search for the next services: Google+ API and Contacts API
Click on service and click enable
After you enable two services to go to the dashboard page and click Credentials.
In the Credentials page click Create consent screen and perform the next steps.
Choose external and go to next.
Here you need to enter the project name and authorization domain, this domain cannot be localhost
or site.local
. You need to enter something like this mysite.com
, mysite.do
- you can add an alias in your /etc/hosts.
Now you need to create credentials for this return to the Credentials page and click Create credentials and choose OAuth client ID.
On the next page choose Web application. Enter the name and click Create.
Now you can see your client_id and client_secret. Save it in the future we will use it.