Androidoauth

A simple way to authenticate with Google and Facebook using OAuth 2.0 in Android
Alternatives To Androidoauth
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Hackathon Starter34,3862a day ago7December 09, 202013mitJavaScript
A boilerplate for Node.js web applications
Google Api Nodejs Client10,84019a day ago20July 10, 2023179apache-2.0TypeScript
Google's officially supported Node.js client library for accessing Google APIs. Support for authorization and authentication with OAuth 2.0, API Keys and JWT (Service Tokens) is included.
Gam3,194
2 days ago65apache-2.0Python
command line management for Google Workspace
Gcalcli3,064
52 months ago19June 01, 2020190mitPython
Google Calendar Command Line Interface
Google Signin2,856265 days ago25May 24, 202318mitJava
Google Sign-in for your React Native applications
Wordpress Android2,840
a day ago1,022gpl-2.0Kotlin
WordPress for Android
Gcsf2,315
2 months ago23July 24, 202341mitRust
a FUSE file system based on Google Drive
Login With2,29322 years ago9August 08, 201835mitJavaScript
Stateless login-with microservice for OAuth
Youtube Upload1,960
2 months ago105Python
Upload videos to Youtube from the command line
Outlookgooglecalendarsync1,603
a month ago182mpl-2.0C#
Sync your Outlook and Google calendars
Alternatives To Androidoauth
Select To Compare


Alternative Project Comparisons
Readme

Android Arsenal Release

AndroidOAuth

A simple way to authenticate with Google and Facebook using OAuth 2.0 in Android

How To Use

Google

Google Consent Google Auth

Login

// Use a Web credential instead of Android credential
GoogleOAuth.login(this)
    .setClientId(Credentials.GOOGLE_CLIENT_ID)
    .setClientSecret(Credentials.GOOGLE_CLIENT_SECRET)
    .setAdditionalScopes("https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/user.birthday.read")
    .setRedirectUri(Credentials.GOOGLE_REDIRECT_URI)
    .setCallback(new OnLoginCallback() {
        @Override
        public void onSuccess(String token, SocialUser user) {
            Log.d("Google Token", token);
            Log.d("Google User", user+"");
        }
        @Override
        public void onError(Exception error) {
            error.printStackTrace();
        }
    })
    .init();

Logout (revoke token)

GoogleOAuth.logout(this)
    .setToken(currentToken)
    .setCallback(new OnLogoutCallback() {
        @Override
        public void onSuccess() {
            
        }
        @Override
        public void onError(Exception error) {
            
        }
    })
    .init();

Facebook

Facebook Consent Facebook Auth

Login

// No need to configure Android section on Facebook app
FacebookOAuth.login(this)
    .setClientId(Credentials.FACEBOOK_APP_ID)
    .setClientSecret(Credentials.FACEBOOK_APP_SECRET)
    .setAdditionalScopes("user_friends user_birthday")
    .setRedirectUri(Credentials.FACEBOOK_REDIRECT_URI)
    .setCallback(new OnLoginCallback() {
        @Override
        public void onSuccess(String token, SocialUser user) {
            Log.d("Facebook Token", token);
            Log.d("Facebook User", user+"");
        }
        @Override
        public void onError(Exception error) {
            error.printStackTrace();
        }
    })
    .init();

Logout (revoke token)

FacebookOAuth.logout(this)
    .setToken(currentToken)
    .setCallback(new OnLogoutCallback() {
        @Override
        public void onSuccess() {
            
        }
        @Override
        public void onError(Exception error) {
            
        }
    })
    .init();

Import to your project

Put this into your app/build.gradle:

repositories {
  maven {
    url "https://jitpack.io"
  }
}

dependencies {
  compile 'com.github.adrielcafe:AndroidOAuth:1.1.5'
}

TODO

  • [ ] Twitter support
  • [X] Get name, email, profileUrl, coverUrl and birthday from authenticated user
  • [X] logout() method to revoke token
  • [X] setAdditionalScopes() method to add more scopes from Google and Facebook

Dependencies

License

The MIT License (MIT)

Copyright (c) 2016 Adriel Café

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Popular Oauth Projects
Popular Google Projects
Popular Security Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Java
Google
Token
Oauth
Google Login