Auth0Client Library

Implementation of the fragment with the ability to display indeterminate progress indicator when you are waiting for the initial dataImplementation of a TextView and all its direct/indirect subclasses with native support for the Roboto fonts, includes the brand new Roboto Slab fonts.

License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

com.github.vanatka
ArtifactId

ArtifactId

auth0client
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

aar
Description

Description

Auth0Client Library
Implementation of the fragment with the ability to display indeterminate progress indicator when you are waiting for the initial dataImplementation of a TextView and all its direct/indirect subclasses with native support for the Roboto fonts, includes the brand new Roboto Slab fonts.
Project URL

Project URL

https://github.com/vanatka/auth0client
Source Code Management

Source Code Management

https://github.com/vanatka/auth0client

Download auth0client

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.vanatka/auth0client/ -->
<dependency>
    <groupId>com.github.vanatka</groupId>
    <artifactId>auth0client</artifactId>
    <version>1.0.2</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.vanatka/auth0client/
implementation 'com.github.vanatka:auth0client:1.0.2'
// https://jarcasting.com/artifacts/com.github.vanatka/auth0client/
implementation ("com.github.vanatka:auth0client:1.0.2")
'com.github.vanatka:auth0client:aar:1.0.2'
<dependency org="com.github.vanatka" name="auth0client" rev="1.0.2">
  <artifact name="auth0client" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.github.vanatka', module='auth0client', version='1.0.2')
)
libraryDependencies += "com.github.vanatka" % "auth0client" % "1.0.2"
[com.github.vanatka/auth0client "1.0.2"]

Dependencies

compile (6)

Group / Artifact Type Version
com.google.code.gson : gson jar 2.+
com.auth0 : java-jwt jar 0.3
com.squareup.okhttp : okhttp-urlconnection jar 2.0.0
com.squareup.okhttp : okhttp jar 2.0.0
com.squareup.retrofit : retrofit jar 1.6.1
com.android.support » appcompat-v7 jar 19.+

Project Modules

There are no modules declared in this project.

#Auth0Client for Android ( version 1.0 )

Android Arsenal

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.

Versions

Version
1.0.2