Android Open Source - roborouter Authenticator






From Project

Back to project page roborouter.

License

The source code is released under:

Apache License

If you think the Android project roborouter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.raycoarana.roborouter.sample.auth;
/*from w  w  w. ja  va 2  s  . co m*/
import android.accounts.AbstractAccountAuthenticator;
import android.accounts.Account;
import android.accounts.AccountAuthenticatorResponse;
import android.accounts.NetworkErrorException;
import android.content.Context;
import android.os.Bundle;

public class Authenticator extends AbstractAccountAuthenticator {

  // Simple constructor
  public Authenticator(Context context) {
    super(context);
  }

  // Editing properties is not supported
  @Override
  public Bundle editProperties(
      AccountAuthenticatorResponse r, String s) {
    throw new UnsupportedOperationException();
  }

  // Don't add additional accounts
  @Override
  public Bundle addAccount(
      AccountAuthenticatorResponse r,
      String s,
      String s2,
      String[] strings,
      Bundle bundle) throws NetworkErrorException {
    return null;
  }

  // Ignore attempts to confirm credentials
  @Override
  public Bundle confirmCredentials(
      AccountAuthenticatorResponse r,
      Account account,
      Bundle bundle) throws NetworkErrorException {
    return null;
  }

  // Getting an authentication token is not supported
  @Override
  public Bundle getAuthToken(
      AccountAuthenticatorResponse r,
      Account account,
      String s,
      Bundle bundle) throws NetworkErrorException {
    throw new UnsupportedOperationException();
  }

  // Getting a label for the auth token is not supported
  @Override
  public String getAuthTokenLabel(String s) {
    throw new UnsupportedOperationException();
  }

  // Updating user credentials is not supported
  @Override
  public Bundle updateCredentials(
      AccountAuthenticatorResponse r,
      Account account,
      String s, Bundle bundle) throws NetworkErrorException {
    throw new UnsupportedOperationException();
  }

  // Checking features for the account is not supported
  @Override
  public Bundle hasFeatures(
      AccountAuthenticatorResponse r,
      Account account, String[] strings) throws NetworkErrorException {
    throw new UnsupportedOperationException();
  }

}




Java Source Code List

com.raycoarana.roborouter.RoboRouterBuilder.java
com.raycoarana.roborouter.RoboRouter.java
com.raycoarana.roborouter.sample.LoginActivity.java
com.raycoarana.roborouter.sample.MainActivity.java
com.raycoarana.roborouter.sample.SampleApplication.java
com.raycoarana.roborouter.sample.WalkthroughActivity.java
com.raycoarana.roborouter.sample.auth.AuthenticatorService.java
com.raycoarana.roborouter.sample.auth.Authenticator.java