What is the project about?
Have you ever wanted to get rid of that cumbersome step of telling your users to create a user profile? Have you ever as a user closed a window or an app due to the tediousness of the sign-up step? Then social login is for you. Social login allows third-party applications to authenticate using the credentials from popular social networks. In other words, rather than forcing users to create a new profile, remember a new password and fill-in all the required details, you can just point them to the login screen of your selected provider and, after a successful authentication step, get all the needed details from that provider. Easier for users AND easier for developers, a combination rarely seen in software development.
Social network providers often can provide additional information about users, such as location, interests, and birthday. Using social logins you can take advantage of this data, to target personalised, relevant content to users.
Almost every major social network provides an API to allow application developers to authenticate users using their systems. In this article we will focus on the four major social login providers: Google, Facebook, and Twitter.
Technology Stack:
[Java](https://en.wikipedia.org/wiki/Java_(programming_language))
[Android](https://developer.android.com/)
Roadmap:
I want to improve the application further and design a complete user management system for android. I would like to add a few more social connectors, upload and change profile photo.
Install or Setup:
Download Android Social login App via github or clone your computer.
cd socialloginfolder
git clone https://github.com/santoshhiremani/sociallogin-android
Okey now, Import the project folder into Android studio.
*Enable Google Login*
implementation 'com.google.android.gms:play-services-auth:15.0.1'
1. Create app in Google Developer Console:
https://developers.google.com/mobile/add?platform=android
2. Enable Google Signin API.
3. Get Web Client id in Oauth 2.0 client ids area:
https://console.developers.google.com/apis/credentials
4. Set this Client id in this class : [AppConstants](https://github.com/santoshhiremani/sociallogin-android/blob/master/app/src/main/java/com/sociallogin/constants/AppConstants.java)
Note: If you want google+ information follows these steps:
1. Make sure that Google+ Api is enabled in Google Developer Console.
2. Include this dependency:
implementation 'com.google.android.gms:play-services-plus:15.0.1'
Then, you can access all information through person object in GoogleHelper success callback.
*Enable Facebook Login*
implementation 'com.facebook.android:facebook-android-sdk:4.5.0'
1. Create app in Facebook Developer Console.
2. Follow the steps mentioned here :
https://developers.facebook.com/docs/android/getting-started/
3. Set App id here: [Properties](https://github.com/santoshhiremani/sociallogin- android/blob/master/app/src/main/res/values/strings.xml)
*Enable Twitter Login*
implementation('com.twitter.sdk.android:twitter:1.13.1@aar')
1. You need to approve your application for email access at:
https://support.twitter.com/forms/platformv
2. Copy twitter_key and secret into [AppConstants](https://github.com/santoshhiremani/sociallogin-android/blob/master/app/src/main/java/com/sociallogin/constants/AppConstants.java)
After this steps, you can easily run your application and login.
You can use following helper classes for integrating any type of login process in your application.
[TwitterHelper](https://github.com/santoshhiremani/sociallogin-android/blob/master/app/src/main/java/com/sociallogin/helpers/TwitterHelper.java)
[GoogleHelper](https://github.com/santoshhiremani/sociallogin-android/blob/master/app/src/main/java/com/sociallogin/helpers/GoogleHelper.java)
[FacebookHelper](https://github.com/santoshhiremani/sociallogin-android/blob/master/app/src/main/java/com/sociallogin/helpers/FacebookHelper.java)
License
This project is licensed under the Apache License.
How to contribute?
You can reach me by commenting on this post or send message on the discord (@hiremani#9951).If you want to make this application better, you can make a Pull Request.
[Github](https://github.com/santoshhiremani/sociallogin-android)