auth0client


Source link: https://github.com/vanatka/auth0client

#Auth0Client for Android ( version 1.0 )

Overview

Auth0Client, is gradle based Android library, to let developers have basic Auth0 API.

Features

In version 1.0.x:

  • Database & Active Directory / LDAP Authentication
  • Auth0Client - class with Auth0 API's, right now only login
  • Auth0DADLoginTask - AsyncTask for convinient usage in activities, to use it - it's necessary create inhereted class from Auth0DADLoginTask & declare few methods
  • IAuth0Logger - in case if you have your own Logging system, it's possible to redirect all log messages to your subsystem, to do it, it's necessary to add implements IAuth0Logger to your logging class (example of usage you can find in reference app)

Usage

Necessary create project on Auth0 and create application, obtain domain & client id. Then in your Android application create instance of

Example

#####Sample project You can find reference project in app subfolder in the repo.

#####Calling Auth0Client directly:

Auth0Client auth0Client = new Auth0Client("https://androidauth0client.auth0.com","Hmhh2ZigTPHw9kdtu9ZIB2YN4rf4Fm33");
 Auth0ResultHolder resultHolder = auth0Client.loginSyncWithEmailPassword(new EmailPasswordHolder("[email protected]", "qwerty"));
 Auth0ResultHolder.RESULT result = resultHolder.getResult();
 switch (result) {

case SUCCESS:
  Auth0User user = resultHolder.getUser();

  Log.i(">>>", " login was successful, user's nick is " + user.getNickname( ) );

  break;
case FAILED_NETWORK_ERROR:
  Log.i(">>>", " something wrong with network " + resultHolder.getErrorMsg() );

  break;
case FAILED_WRONG_CREDENTIALS:
  Log.i(">>>", " wrong credentials " + resultHolder.getErrorMsg() );

  break;
default:
case HUDSON_THERE_ARE_TROUBLES:
  break; 
}
 

#####Auth0DADLoginTask in activity

public class LoginActivity extends Activity {

 @Override
protected void onCreate(Bundle savedInstanceState) {

  super.onCreate(savedInstanceState);

  Auth0Client auth0Client = new Auth0Client("https://androidauth0client.auth0.com", "Hmhh2ZigTPHw9kdtu9ZIB2YN4rf4Fm33");

  UserLoginTask authTask = new UserLoginTask( auth0Client );

  EmailPasswordHolder emailPasswordHolder = new EmailPasswordHolder("[email protected]", "qwerty");

  authTask.execute( emailPasswordHolder );

}

 public class UserLoginTask extends Auth0DADLoginTask {

  public UserLoginTask(Auth0Client auth0Client) {

 super(auth0Client);

  
}

@Override
  public void onSuccessfulLogin(Auth0ResultHolder resultHolder) {

  
}

@Override
  public void onFailedLogin(Auth0ResultHolder resultHolder, Auth0ResultHolder.RESULT error) {

  
}

}
 
}
 

Compatibility

This library is compatible from API 7 (Android 2.1).

Gradle

Auth0Client library is now pushed to Maven Central as a AAR, so you just need to add the following dependency to your build.gradle:

dependencies {

compile 'com.github.vanatka:auth0client:1.0.2' 
}
 

Developed By

Contributing

Please fork this repository and contribute back using pull requests.

Any contributions, large or small, major features, bug fixes, additional language translations, unit/integration tests are welcomed and appreciated but will be thoroughly reviewed and discussed.

License

The MIT License (MIT)  Copyright (c) 2014 Ivan Aläxkin  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. 

Resources

Another approach to create NavigationDrawer with Material concepts.

async-expandable-list contains 2 View classes: CollectionView and AsyncExpandableListView.

AsyncExpandableListView displays a list of headers and loads a sub-list under a header when a header item is clicked. The loading of sub-items can be done asynchronously and there are callbacks to populate the data into the list when it's done loading.

This is a demo project on Flatbuffers. Flatbuffers is an android parsing library which is much faster then GSON.

This project explains how to setup flatbuffers and use them to serialize and deserialize the models.

Gradle script for downsizing graphical assets in development builds

Usually you don't care how big the deployed APK is. However, if you are using metered connection and remote ADB, it would be good idea to build possibly smallest APK file.

Uglyfier for Android is a gradle script which will shrink all image resources in your application during build. It will look ugly, but image files will be 10 times smaller. Ninepatch (9-patch) PNGs are fully supported, with transparency preserved!

Animated Time View like Timely app.

Circle progress view. Can be used as button.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes