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

Android application compatible with ZX2C4's Pass command line application.

Highly flexible Android Camera which offers granular control over the video quality and file size, while restricting recordings to be landscape only.

MvpCleanArchitecture is a sample project using Clean architecture and MVP.

Adroit is a smart way to develop android applications. Enhance your application development skills by providing safe checks and speed up development process.

IconicDroid is a custom Android Drawable which allows to draw icons from several iconic font.

Sometimes we want/need to know what's going on behind the scenes but our app is not always connected to our computer to let us check the logs. Galgo will let you display your log messages as an overlay on top of your UI.

Extremely useful for testers who want to have more insight into what's going on behind the scenes in our apps when it misbehaves.

You can also define some basic settings such as background color, text color, text size and number of lines to display on screen so it better fits your needs.

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