All Projects → maksim88 → Easylogin

maksim88 / Easylogin

Licence: mit
Login effortlessly with different social networks like Facebook, Twitter or Google Plus

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Easylogin

Ultimate Metatags
A large snippet for your page's <head> that includes all the meta tags you'll need for OPTIMAL sharing and SEO. Extensive work has been put into ensuring you have the optimal images for the most important social media platforms.
Stars: ✭ 24 (-73.33%)
Mutual labels:  twitter, facebook, social-network
Network Avatar Picker
A npm module that returns user's social network avatar. Supported providers: facebook, instagram, twitter, tumblr, vimeo, github, youtube and gmail
Stars: ✭ 74 (-17.78%)
Mutual labels:  twitter, facebook, social-network
Social Post Bundle
Symfony bundle to publish status updates on Facebook, LinkedIn and Twitter.
Stars: ✭ 35 (-61.11%)
Mutual labels:  twitter, facebook, social-network
Reaper
Social media scraping / data collection tool for the Facebook, Twitter, Reddit, YouTube, Pinterest, and Tumblr APIs
Stars: ✭ 240 (+166.67%)
Mutual labels:  api, twitter, facebook
Socialreaper
Social media scraping / data collection library for Facebook, Twitter, Reddit, YouTube, Pinterest, and Tumblr APIs
Stars: ✭ 338 (+275.56%)
Mutual labels:  api, twitter, facebook
Laravel Social Auto Posting
🌈Laravel social auto posting
Stars: ✭ 306 (+240%)
Mutual labels:  twitter, facebook, social-network
Sharer.js
🔛 🔖 Create your own social share buttons. No jquery.
Stars: ✭ 1,624 (+1704.44%)
Mutual labels:  twitter, facebook, social-network
Social Network Harvester V1.0
Stars: ✭ 5 (-94.44%)
Mutual labels:  twitter, facebook, social-network
Social ids
Get user ids from social network handlers
Stars: ✭ 9 (-90%)
Mutual labels:  twitter, facebook, social-network
Imageviewer.swift
An easy to use Image Viewer that is inspired by Facebook
Stars: ✭ 1,071 (+1090%)
Mutual labels:  twitter, facebook
Broid Kit
Bot framework powered by Broid
Stars: ✭ 58 (-35.56%)
Mutual labels:  api, twitter
Django Graphql Social Auth
Python Social Auth support for Graphene Django
Stars: ✭ 90 (+0%)
Mutual labels:  twitter, facebook
Keyring
Keyring is an authentication framework for WordPress. It comes with definitions for a variety of HTTP Basic, OAuth1 and OAuth2 web services. Use it as a common foundation for working with other web services from within WordPress code.
Stars: ✭ 52 (-42.22%)
Mutual labels:  twitter, facebook
Nemiro.oauth.dll
Nemiro.OAuth is a class library for authorization via OAuth protocol in .NET Framework
Stars: ✭ 45 (-50%)
Mutual labels:  twitter, facebook
Share Selected Text
share selected text on twitter, buffer, and some others. Inspired by medium.com
Stars: ✭ 64 (-28.89%)
Mutual labels:  twitter, facebook
Friend.ly
A social media platform with a friend recommendation engine based on personality trait extraction
Stars: ✭ 41 (-54.44%)
Mutual labels:  api, social-network
Autohook
Automatically setup and serve webhooks for the Twitter Account Activity API
Stars: ✭ 67 (-25.56%)
Mutual labels:  api, twitter
Bash2mp4
Video Downloader for Termux .
Stars: ✭ 68 (-24.44%)
Mutual labels:  twitter, facebook
Skraper
Kotlin/Java library and cli tool for scraping posts and media from various sources with neither authorization nor full page rendering (Facebook, Instagram, Twitter, Youtube, Tiktok, Telegram, Twitch, Reddit, 9GAG, Pinterest, Flickr, Tumblr, IFunny, VK, Pikabu)
Stars: ✭ 72 (-20%)
Mutual labels:  twitter, facebook
React Share Button
📱 React share button component with web-share api and fallback modal with native intent urls
Stars: ✭ 89 (-1.11%)
Mutual labels:  twitter, facebook

Android Arsenal jCenter

EasyLogin

Easy Login in your app with different social networks. Currently supported:

  • Facebook
  • Google Plus
  • Twitter

Global Configuration

To be able to use one of the social network connections you need to create an EasyLogin instance:

EasyLogin.initialize();
EasyLogin easyLogin = EasyLogin.getInstance();

Also make sure to call through to EasyLogin in onActivityResult() of your Activity:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  super.onActivityResult(requestCode, resultCode, data);
  easyLogin.onActivityResult(requestCode, resultCode, data);
}

Afterwards you can connect to the social networks one by one.

Facebook Connection

To connect to facebook you need to do the following:

  • First of all you need to init a list of permissions you want to take:
    List<String> fbScope = Arrays.asList("public_profile", "email");
    
  • Add the facebook social network:
    easyLogin.addSocialNetwork(new FacebookNetwork(this, fbScope));
    
  • Add the Facebook LoginButton and the listeners:
    facebook = (FacebookNetwork) easyLogin.getSocialNetwork(SocialNetwork.Network.FACEBOOK);
    
    LoginButton loginButton = (LoginButton) findViewById(R.id.facebook_login_button);
    // Call this method if you are using the LoginButton provided by facebook
    // It can handle its own state
    facebook.requestLogin(loginButton, this);
    
  • In the next step you will get an onSuccess() or onError() callback. The easiest solution is to implement the OnLoginCompleteListenerin your activity and handle all the connections there.

You also need to make sure to add the Facebook ApplicationId in your manifest:

<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>

If an email permission is requested, the library also does a /me request on the facebook graph api to try to fetch the email.

Note that it is still not guaranteed that you will get an email because the user might not have a valid / verified email or signed up with a telephone number. So I would advise to use the userId for figuring out the user identity.

Twitter Connection

One gotcha of using the Twitter Social connection is to create the TwitterNetwork before calling to setContentView() as Twitter would complain otherwise.

// Initialization needs to happen before setContentView() if using the LoginButton!
easyLogin.addSocialNetwork(new TwitterNetwork(this, twitterKey, twitterSecret));

setContentView(R.layout.activity_main);

twitter = (TwitterNetwork) easyLogin.getSocialNetwork(SocialNetwork.Network.TWITTER);
twitterButton = (TwitterLoginButton) findViewById(R.id.twitter_login_button);
twitter.requestLogin(twitterButton, this);

If you also want to request an email from the Twitter use, use twitter.setAdditionalEmailRequest(true); Make sure that your app has the 'Request email addresses from users' checkbox checked in the Twitter app permission settings.

Note that it is still not guaranteed that you will get an email because the user might have signed up with a telephone number. So I would advise to use the userId for figuring out the user identity.

Google Plus Connection

easyLogin.addSocialNetwork(new GooglePlusNetwork(this));
gPlusNetwork = (GooglePlusNetwork) easyLogin.getSocialNetwork(SocialNetwork.Network.GOOGLE_PLUS);

gPlusButton = (SignInButton) findViewById(R.id.gplus_sign_in_button);
gPlusButton.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        if (!gPlusNetwork.isConnected()) {
            gPlusNetwork.requestLogin(MainActivity.this);
        }
    }
});

You can pass a reference to the SignInButton to the SocialNetwork by calling gPlusNetwork.setSignInButton(gPlusButton);. This will make sure to disable and enable the button on connection state changes. Unfortunately the state is not handled automatically inside the Button like the facebook button does.

As the state is not handled by the SignInButton you may need to call silentSignIn() in your onStart() to be logged in again. You will get a callback. For more info check the sample project. If you call silentSignIn() make sure to set a listener before.

You also need to include a valid google-services.json file in your project to be able to use G+: For more information you can consult the official docs.

Callbacks

 public class MainActivity extends AppCompatActivity implements OnLoginCompleteListener {
 
 [...]
 
 @Override
 public void onLoginSuccess(SocialNetwork.Network network) {
     // You can check the network by e.g.: if (network == SocialNetwork.Network.FACEBOOK) 
     AccessToken token = network.getAccessToken();
     Log.d("MAIN", "Login successful: " + token.getToken());
 }
 
 @Override
 public void onError(SocialNetwork.Network socialNetwork, String errorMessage) {
     Toast.makeText(getApplicationContext(), errorMessage, Toast.LENGTH_SHORT).show();
 }

Download

The library is available through jcenter().

After that you can easily include the library in your app build.gradle:

dependencies {
	        implementation 'com.maksim88:EasyLogin:{latest-version}'
	}

The builds are also available via jitpack.io.

License

Licensed under the MIT license. See LICENSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].