Here are the examples of the java api android.accounts.AccountAuthenticatorResponse taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
86 Examples
19
Source : Authenticator.java
with GNU General Public License v3.0
from Welthungerhilfe
with GNU General Public License v3.0
from Welthungerhilfe
@Override
public Bundle confirmCredentials(AccountAuthenticatorResponse response, Account account, Bundle options) {
if (options != null && options.containsKey(AccountManager.KEY_PreplacedWORD)) {
final String preplacedword = options.getString(AccountManager.KEY_PreplacedWORD);
final boolean verified = true;
final Bundle result = new Bundle();
result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, verified);
return result;
}
final Intent intent = new Intent(mContext, LoginActivity.clreplaced);
intent.putExtra(AppConstants.PARAM_AUTH_NAME, account.name);
intent.putExtra(AppConstants.PARAM_AUTH_CONFIRM, true);
intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
final Bundle bundle = new Bundle();
bundle.putParcelable(AccountManager.KEY_INTENT, intent);
return bundle;
}
19
Source : Authenticator.java
with GNU General Public License v3.0
from Welthungerhilfe
with GNU General Public License v3.0
from Welthungerhilfe
@Override
public Bundle hasFeatures(AccountAuthenticatorResponse response, Account account, String[] features) {
final Bundle result = new Bundle();
result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, false);
return result;
}
19
Source : Authenticator.java
with GNU General Public License v3.0
from Welthungerhilfe
with GNU General Public License v3.0
from Welthungerhilfe
@Override
public Bundle editProperties(AccountAuthenticatorResponse response, String accountType) {
return null;
}
19
Source : Authenticator.java
with GNU General Public License v3.0
from Welthungerhilfe
with GNU General Public License v3.0
from Welthungerhilfe
@Override
public Bundle getAuthToken(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options) {
if (!authTokenType.equals(AppConstants.AUTHTOKEN_TYPE)) {
final Bundle result = new Bundle();
result.putString(AccountManager.KEY_ERROR_MESSAGE, "invalid authTokenType");
return result;
}
final AccountManager am = AccountManager.get(mContext);
final String preplacedword = am.getPreplacedword(account);
if (preplacedword != null) {
final Bundle result = new Bundle();
result.putString(AccountManager.KEY_ACCOUNT_NAME, account.name);
result.putString(AccountManager.KEY_ACCOUNT_TYPE, AppConstants.ACCOUNT_TYPE);
result.putString(AccountManager.KEY_AUTHTOKEN, preplacedword);
return result;
}
final Intent intent = new Intent(mContext, LoginActivity.clreplaced);
intent.putExtra(AppConstants.PARAM_AUTH_NAME, account.name);
intent.putExtra(AppConstants.PARAM_AUTHTOKEN_TYPE, authTokenType);
final Bundle bundle = new Bundle();
bundle.putParcelable(AccountManager.KEY_INTENT, intent);
return bundle;
}
19
Source : Authenticator.java
with GNU General Public License v3.0
from Welthungerhilfe
with GNU General Public License v3.0
from Welthungerhilfe
@Override
public Bundle updateCredentials(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options) {
final Intent intent = new Intent(mContext, LoginActivity.clreplaced);
intent.putExtra(AppConstants.PARAM_AUTH_NAME, account.name);
intent.putExtra(AppConstants.AUTHTOKEN_TYPE, authTokenType);
intent.putExtra(AppConstants.PARAM_AUTH_CONFIRM, false);
final Bundle bundle = new Bundle();
bundle.putParcelable(AccountManager.KEY_INTENT, intent);
return bundle;
}
19
Source : Authenticator.java
with GNU General Public License v3.0
from Welthungerhilfe
with GNU General Public License v3.0
from Welthungerhilfe
@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) {
final Intent intent = new Intent(mContext, LoginActivity.clreplaced);
intent.putExtra(AppConstants.PARAM_AUTHTOKEN_TYPE, authTokenType);
intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
final Bundle bundle = new Bundle();
bundle.putParcelable(AccountManager.KEY_INTENT, intent);
return bundle;
}
19
Source : AuthenticatorBase.java
with GNU General Public License v3.0
from swentel
with GNU General Public License v3.0
from swentel
@Override
public Bundle getAuthToken(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options) {
throw new UnsupportedOperationException();
}
19
Source : AuthenticatorBase.java
with GNU General Public License v3.0
from swentel
with GNU General Public License v3.0
from swentel
@Override
public Bundle hasFeatures(AccountAuthenticatorResponse response, Account account, String[] features) {
throw new UnsupportedOperationException();
}
19
Source : AuthenticatorBase.java
with GNU General Public License v3.0
from swentel
with GNU General Public License v3.0
from swentel
@Override
public Bundle confirmCredentials(AccountAuthenticatorResponse response, Account account, Bundle options) {
throw new UnsupportedOperationException();
}
19
Source : AuthenticatorBase.java
with GNU General Public License v3.0
from swentel
with GNU General Public License v3.0
from swentel
@Override
public Bundle editProperties(AccountAuthenticatorResponse response, String accountType) {
throw new UnsupportedOperationException();
}
19
Source : AuthenticatorBase.java
with GNU General Public License v3.0
from swentel
with GNU General Public License v3.0
from swentel
@Override
public Bundle updateCredentials(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options) {
throw new UnsupportedOperationException();
}
19
Source : AuthenticatorPleroma.java
with GNU General Public License v3.0
from swentel
with GNU General Public License v3.0
from swentel
@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) {
final Intent intent = new Intent(context, AuthActivity.clreplaced);
intent.putExtra("com.indieweb.indigenous.AccountType", accountType);
intent.putExtra(PLEROMA_TOKEN_TYPE, authTokenType);
final Bundle bundle = new Bundle();
bundle.putParcelable(AccountManager.KEY_INTENT, intent);
return bundle;
}
19
Source : AuthenticatorPixelfed.java
with GNU General Public License v3.0
from swentel
with GNU General Public License v3.0
from swentel
@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) {
final Intent intent = new Intent(context, AuthActivity.clreplaced);
intent.putExtra("com.indieweb.indigenous.AccountType", accountType);
intent.putExtra(PIXELFED_TOKEN_TYPE, authTokenType);
final Bundle bundle = new Bundle();
bundle.putParcelable(AccountManager.KEY_INTENT, intent);
return bundle;
}
19
Source : AuthenticatorMastodon.java
with GNU General Public License v3.0
from swentel
with GNU General Public License v3.0
from swentel
@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) {
final Intent intent = new Intent(context, AuthActivity.clreplaced);
intent.putExtra("com.indieweb.indigenous.AccountType", accountType);
intent.putExtra(MASTODON_TOKEN_TYPE, authTokenType);
final Bundle bundle = new Bundle();
bundle.putParcelable(AccountManager.KEY_INTENT, intent);
return bundle;
}
19
Source : AuthenticatorIndieWeb.java
with GNU General Public License v3.0
from swentel
with GNU General Public License v3.0
from swentel
@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) {
final Intent intent = new Intent(context, AuthActivity.clreplaced);
intent.putExtra("com.indieweb.indigenous.AccountType", accountType);
intent.putExtra(INDIEWEB_TOKEN_TYPE, authTokenType);
final Bundle bundle = new Bundle();
bundle.putParcelable(AccountManager.KEY_INTENT, intent);
return bundle;
}
19
Source : FilmyAuthenticator.java
with Apache License 2.0
from salRoid
with Apache License 2.0
from salRoid
// Updating user credentials is not supported
@Override
public Bundle updateCredentials(AccountAuthenticatorResponse r, Account account, String s, Bundle bundle) {
throw new UnsupportedOperationException();
}
19
Source : FilmyAuthenticator.java
with Apache License 2.0
from salRoid
with Apache License 2.0
from salRoid
// Getting an authentication token is not supported
@Override
public Bundle getAuthToken(AccountAuthenticatorResponse r, Account account, String s, Bundle bundle) throws NetworkErrorException {
throw new UnsupportedOperationException();
}
19
Source : FilmyAuthenticator.java
with Apache License 2.0
from salRoid
with Apache License 2.0
from salRoid
// Checking features for the account is not supported
@Override
public Bundle hasFeatures(AccountAuthenticatorResponse r, Account account, String[] strings) {
throw new UnsupportedOperationException();
}
19
Source : FilmyAuthenticator.java
with Apache License 2.0
from salRoid
with Apache License 2.0
from salRoid
// No properties to edit.
@Override
public Bundle editProperties(AccountAuthenticatorResponse r, String s) {
throw new UnsupportedOperationException();
}
19
Source : FilmyAuthenticator.java
with Apache License 2.0
from salRoid
with Apache License 2.0
from salRoid
// Because we're not actually adding an account to the device, just return null.
@Override
public Bundle addAccount(AccountAuthenticatorResponse r, String s, String s2, String[] strings, Bundle bundle) throws NetworkErrorException {
return null;
}
19
Source : FilmyAuthenticator.java
with Apache License 2.0
from salRoid
with Apache License 2.0
from salRoid
// Ignore attempts to confirm credentials
@Override
public Bundle confirmCredentials(AccountAuthenticatorResponse r, Account account, Bundle bundle) throws NetworkErrorException {
return null;
}
19
Source : Authenticator.java
with GNU Affero General Public License v3.0
from RooyeKhat-Media
with GNU Affero General Public License v3.0
from RooyeKhat-Media
// Editing properties is not supported
@Override
public Bundle editProperties(AccountAuthenticatorResponse r, String s) {
throw new UnsupportedOperationException();
}
19
Source : Authenticator.java
with GNU Affero General Public License v3.0
from RooyeKhat-Media
with GNU Affero General Public License v3.0
from RooyeKhat-Media
// Checking features for the account is not supported
@Override
public Bundle hasFeatures(AccountAuthenticatorResponse r, Account account, String[] strings) throws NetworkErrorException {
throw new UnsupportedOperationException();
}
19
Source : Authenticator.java
with GNU Affero General Public License v3.0
from RooyeKhat-Media
with GNU Affero General Public License v3.0
from RooyeKhat-Media
// Don't add additional accounts
@Override
public Bundle addAccount(AccountAuthenticatorResponse r, String s, String s2, String[] strings, Bundle bundle) throws NetworkErrorException {
return null;
}
19
Source : Authenticator.java
with GNU Affero General Public License v3.0
from RooyeKhat-Media
with GNU Affero General Public License v3.0
from RooyeKhat-Media
// Updating user credentials is not supported
@Override
public Bundle updateCredentials(AccountAuthenticatorResponse r, Account account, String s, Bundle bundle) throws NetworkErrorException {
throw new UnsupportedOperationException();
}
19
Source : WebsigninTask.java
with GNU General Public License v3.0
from pstuifzand
with GNU General Public License v3.0
from pstuifzand
public clreplaced WebsigninTask extends AsyncTask<String, Void, Bundle> {
static final String ME = "eu.stuifzand.micropub.ME";
protected AccountAuthenticatorResponse response;
protected Activity activity;
public clreplaced AuthResponse {
String me;
String endpoint;
}
public WebsigninTask(Activity activity, AccountAuthenticatorResponse response) {
this.activity = activity;
this.response = response;
}
@Override
protected Bundle doInBackground(String... strings) {
Log.i("micropub", "Starting WebsigninTask.doInBackground");
Bundle bundle = new Bundle();
HashMap<String, String> linkHeaders = new HashMap<>();
try {
String profileUrl = strings[0];
bundle.putString(ME, profileUrl);
Connection conn = Jsoup.connect(profileUrl);
conn.timeout(10 * 1000);
Doreplacedent doc = conn.get();
Connection.Response resp = conn.response();
List<String> headers = resp.headers("Link");
Pattern linkParser = Pattern.compile("<([^>]+)>;\\s+rel=\"([^\"]+)\"");
for (String header : headers) {
Log.d("micropub", header);
Matcher matcher = linkParser.matcher(header);
while (matcher.find()) {
MatchResult results = matcher.toMatchResult();
String url = results.group(1);
String rel = results.group(2);
HttpUrl base = HttpUrl.parse(profileUrl);
HttpUrl resolvedUrl = base.resolve(url);
if (resolvedUrl != null && !rel.isEmpty() && !linkHeaders.containsKey(rel)) {
Log.d("micropub", "Found url=" + resolvedUrl + " and rel=" + rel);
linkHeaders.put(rel, resolvedUrl.toString());
}
}
}
Elements links = doc.select("link");
for (Element link : links) {
String rel = link.attr("rel");
if (!rel.isEmpty() && !linkHeaders.containsKey(rel)) {
linkHeaders.put(rel, link.attr("href"));
}
}
} catch (Exception e) {
bundle.putString("ERROR", e.getMessage());
return bundle;
}
String[] rels = new String[] { "authorization_endpoint", "token_endpoint", "micropub" };
for (String rel : rels) {
if (linkHeaders.containsKey(rel)) {
bundle.putString(rel, linkHeaders.get(rel));
}
}
for (String rel : rels) {
if (bundle.getString(rel) == null) {
bundle.putString("ERROR", "Missing header or link: " + rel);
break;
}
}
Log.i("micropub", bundle.toString());
return bundle;
}
@Override
protected void onPostExecute(Bundle bundle) {
String error = bundle.getString("ERROR");
if (error != null && error.length() > 0) {
Toast.makeText(this.activity, error, Toast.LENGTH_LONG).show();
return;
}
Intent intent = new Intent(this.activity, AuthenticationActivity.clreplaced);
intent.putExtras(activity.getIntent());
intent.putExtras(bundle);
intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
this.activity.startActivityForResult(intent, AUTHENTICATION_REQUEST);
}
}
19
Source : Authenticator.java
with GNU General Public License v3.0
from pstuifzand
with GNU General Public License v3.0
from pstuifzand
@Override
public Bundle hasFeatures(AccountAuthenticatorResponse response, Account account, String[] features) throws NetworkErrorException {
throw new UnsupportedOperationException();
}
19
Source : Authenticator.java
with GNU General Public License v3.0
from pstuifzand
with GNU General Public License v3.0
from pstuifzand
@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) throws NetworkErrorException {
final Intent intent = new Intent(context, WebSigninActivity.clreplaced);
// This key can be anything. Try to use your domain/package
intent.putExtra("eu.stuifzand.micropub.AccountType", accountType);
// This key can be anything too. It's just a way of identifying the token's type (used when there are multiple permissions)
intent.putExtra("full_access", authTokenType);
// This key can be anything too. Used for your reference. Can skip it too.
intent.putExtra(AuthenticationActivity.ARG_IS_ADDING_NEW_ACCOUNT, true);
// Copy this exactly from the line below.
intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
final Bundle bundle = new Bundle();
bundle.putParcelable(AccountManager.KEY_INTENT, intent);
return bundle;
}
19
Source : Authenticator.java
with GNU General Public License v3.0
from pstuifzand
with GNU General Public License v3.0
from pstuifzand
@Override
public Bundle updateCredentials(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options) throws NetworkErrorException {
throw new UnsupportedOperationException();
}
19
Source : Authenticator.java
with GNU General Public License v3.0
from pstuifzand
with GNU General Public License v3.0
from pstuifzand
@Override
public Bundle confirmCredentials(AccountAuthenticatorResponse response, Account account, Bundle options) throws NetworkErrorException {
throw new UnsupportedOperationException();
}
19
Source : AuthenticationActivity.java
with GNU General Public License v3.0
from pstuifzand
with GNU General Public License v3.0
from pstuifzand
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_authentication);
if (savedInstanceState != null) {
bundle = savedInstanceState.getBundle("response");
return;
}
Intent intent = getIntent();
bundle = intent.getExtras();
if ("android.intent.action.VIEW".equals(intent.getAction())) {
Log.i("micropub", intent.toString());
Uri uri = intent.getData();
String code = uri.getQueryParameter("code");
// @TODO: check/use state
String state = uri.getQueryParameter("state");
AppDatabase db = Room.databaseBuilder(getApplicationContext(), AppDatabase.clreplaced, "auth").build();
new AsyncTask<String, Void, Auth>() {
@Override
protected Auth doInBackground(String... strings) {
String state = strings[0];
Auth auth = db.authDao().load(state);
db.close();
return auth;
}
@Override
protected void onPostExecute(Auth auth) {
if (auth != null) {
finish();
return;
}
Bundle bundle = new Bundle();
bundle.putString(AccountManager.KEY_ACCOUNT_TYPE, "Indieauth");
bundle.putString(AccountManager.KEY_ACCOUNT_NAME, auth.getMe());
bundle.putString(AuthenticationActivity.PARAM_USER_Preplaced, code);
Intent loginIntent = new Intent();
loginIntent.putExtras(bundle);
finishLogin(loginIntent);
}
}.execute(state);
return;
}
String endpoint = bundle.getString("authorization_endpoint");
String me = bundle.getString(WebsigninTask.ME);
AccountAuthenticatorResponse response = bundle.getParcelable(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE);
String state = RandomStringUtils.randomString(16);
HttpUrl.Builder builder = HttpUrl.parse(endpoint).newBuilder();
builder.setQueryParameter("me", me).setQueryParameter("client_id", "https://wrimini.net").setQueryParameter("redirect_uri", "https://wrimini.net/oauth/callback").setQueryParameter("response_type", "code").setQueryParameter("state", state).setQueryParameter("scope", // @TODO use different scope
"create");
AppDatabase db = Room.databaseBuilder(getApplicationContext(), AppDatabase.clreplaced, "auth").fallbackToDestructiveMigration().build();
Auth auth = new Auth(state, me);
new AsyncTask<Auth, Void, Void>() {
@Override
protected Void doInBackground(Auth... auths) {
db.authDao().save(auths[0]);
db.close();
return null;
}
}.execute(auth);
String url = builder.toString();
Log.i("micropub", "LoadUrl: " + url);
Intent webIntent = new Intent(Intent.ACTION_VIEW);
webIntent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
webIntent.setData(Uri.parse(url));
startActivity(webIntent);
}
19
Source : AuthenticationActivity.java
with GNU General Public License v3.0
from pstuifzand
with GNU General Public License v3.0
from pstuifzand
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
Log.i("micropub", "onCreate action: " + intent.getAction());
if ("android.intent.action.VIEW".equals(intent.getAction())) {
Log.i("micropub", intent.toString());
Uri uri = intent.getData();
String code = uri.getQueryParameter("code");
// String state = uri.getQueryParameter("state"); // @TODO: check/use state
Bundle response = bundle;
String me = response.getString(WebsigninTask.ME);
Bundle bundle = new Bundle();
bundle.putString(AccountManager.KEY_ACCOUNT_TYPE, "Indieauth");
bundle.putString(AccountManager.KEY_ACCOUNT_NAME, me);
bundle.putString(AuthenticationActivity.PARAM_USER_Preplaced, code);
Intent loginIntent = new Intent();
loginIntent.putExtras(bundle);
finishLogin(loginIntent);
AccountAuthenticatorResponse r = response.getParcelable(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE);
if (r != null) {
r.onResult(bundle);
}
}
}
19
Source : Authenticator.java
with MIT License
from PacktPublishing
with MIT License
from PacktPublishing
@Override
public Bundle getAuthToken(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options) {
return null;
}
19
Source : Authenticator.java
with MIT License
from PacktPublishing
with MIT License
from PacktPublishing
@Override
public Bundle hasFeatures(AccountAuthenticatorResponse response, Account account, String[] features) {
return null;
}
19
Source : Authenticator.java
with MIT License
from PacktPublishing
with MIT License
from PacktPublishing
@Override
public Bundle updateCredentials(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options) {
return null;
}
19
Source : Authenticator.java
with MIT License
from PacktPublishing
with MIT License
from PacktPublishing
@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) {
return null;
}
19
Source : Authenticator.java
with MIT License
from PacktPublishing
with MIT License
from PacktPublishing
@Override
public Bundle confirmCredentials(AccountAuthenticatorResponse response, Account account, Bundle options) {
return null;
}
19
Source : AccountAuthenticator.java
with MIT License
from massivedisaster
with MIT License
from massivedisaster
@Override
public Bundle confirmCredentials(AccountAuthenticatorResponse response, Account account, Bundle options) throws NetworkErrorException {
return null;
}
19
Source : AccountAuthenticator.java
with MIT License
from massivedisaster
with MIT License
from massivedisaster
@Override
public Bundle hasFeatures(AccountAuthenticatorResponse response, Account account, String[] features) throws NetworkErrorException {
return null;
}
19
Source : AccountAuthenticator.java
with MIT License
from massivedisaster
with MIT License
from massivedisaster
@Override
public Bundle getAuthToken(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options) throws NetworkErrorException {
return null;
}
19
Source : AccountAuthenticator.java
with MIT License
from massivedisaster
with MIT License
from massivedisaster
@Override
public Bundle updateCredentials(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options) throws NetworkErrorException {
return null;
}
19
Source : Authenticator.java
with Apache License 2.0
from googlearchive
with Apache License 2.0
from googlearchive
@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) throws NetworkErrorException {
Log.d(TAG, "addAccount");
final Intent intent = new Intent(mContext, AuthenticatorActivity.clreplaced);
intent.putExtra(AccountManager.KEY_ACCOUNT_TYPE, accountType);
intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
final Bundle bundle = new Bundle();
bundle.putParcelable(AccountManager.KEY_INTENT, intent);
return bundle;
}
19
Source : LoginActivity.java
with Apache License 2.0
from google
with Apache License 2.0
from google
@Override
public void onTicketGrantingTicketResult(TicketRequestResult ticketRequestResult, Subject ticket) {
if (accountConfiguration.getDebugWithSensitiveData()) {
Log.d(TAG, String.format("Result of attempt to authenticate user: %s , valid ticket? %s", ticketRequestResult, ticket != null));
}
Bundle result = new Bundle();
KerberosAccount account = KerberosAccount.getAccount(this);
boolean successGettingTgt = ticketRequestResult.successful() && ticket != null;
if (successGettingTgt && account != null) {
TicketGrantingTicket tgt = new TicketGrantingTicket(ticket);
account.setTicketGrantingTicket(tgt.replacederialized());
account.save(this);
isPreplacedwordRetry = false;
} else {
if (ticketRequestResult.isPreplacedwordBad() && !isPreplacedwordRetry) {
Log.i(Constants.TAG, String.format("Bad preplacedword for user %s, removing and attempting re-authentication.", account.getName()));
KerberosAccount.removeAccount(this);
isPreplacedwordRetry = true;
authenticateAccount(true);
} else {
setErrorResultAndFinish(AccountManager.ERROR_CODE_BAD_AUTHENTICATION, ticketRequestResult.toString());
}
return;
}
String serviceName = getIntent().getStringExtra(Constants.SERVICE_NAME);
if (serviceName == null) {
result.putString(AccountManager.KEY_ACCOUNT_NAME, account.getName());
result.putString(AccountManager.KEY_ACCOUNT_TYPE, Constants.KERBEROS_ACCOUNT_TYPE);
// Change UI to show the TGT is obtained correctly.
setResultAndFinish(result);
} else {
// A service name was provided - meaning the TGT had to be renewed before getting a service
// ticket. As the TGT was renewed successfully, launch the service ticket activity.
AccountAuthenticatorResponse response = getIntent().getParcelableExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE);
Intent serviceTicketIntent = ServiceTicketActivity.getServiceTicketIntent(this, serviceName, response);
serviceTicketIntent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
startActivity(serviceTicketIntent);
finish();
}
}
19
Source : KerberosAuthenticator.java
with Apache License 2.0
from google
with Apache License 2.0
from google
@Override
public Bundle hasFeatures(AccountAuthenticatorResponse response, Account account, String[] features) {
Bundle result = new Bundle();
for (String feature : features) {
if (!feature.equals("SPNEGO")) {
result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, false);
return result;
}
}
result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, true);
return result;
}
19
Source : KerberosAuthenticator.java
with Apache License 2.0
from google
with Apache License 2.0
from google
@Override
public Bundle editProperties(AccountAuthenticatorResponse response, String accountType) {
return unsupportedOperationBundle("editProperties");
}
19
Source : KerberosAuthenticator.java
with Apache License 2.0
from google
with Apache License 2.0
from google
@Override
public Bundle updateCredentials(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options) {
return unsupportedOperationBundle("updateCredentials");
}
19
Source : KerberosAuthenticator.java
with Apache License 2.0
from google
with Apache License 2.0
from google
@Override
public Bundle confirmCredentials(AccountAuthenticatorResponse response, Account account, Bundle options) {
return unsupportedOperationBundle("confirmCredentials");
}
19
Source : KerberosAuthenticator.java
with Apache License 2.0
from google
with Apache License 2.0
from google
@Override
public Bundle addAccountFromCredentials(AccountAuthenticatorResponse response, Account account, Bundle accountCredentials) throws NetworkErrorException {
return super.addAccountFromCredentials(response, account, accountCredentials);
}
19
Source : KerberosAuthenticator.java
with Apache License 2.0
from google
with Apache License 2.0
from google
@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) {
Bundle bundle = new Bundle();
Intent intentToReturn;
// Request comes from Chrome, add account.
if (requiredFeatures != null && Arrays.asList(requiredFeatures).contains(Constants.SPNEGO)) {
if (hasValidAccountConfiguration()) {
intentToReturn = LoginActivity.getAuthenticateIntent(context, response);
} else {
intentToReturn = DeclineAddingAccountActivity.getDeclineIntentDueToConfigMissing(context, response);
}
} else {
// User cannot add account themselves.
intentToReturn = DeclineAddingAccountActivity.getDeclineIntentDueToUserAdded(context, response);
}
bundle.putParcelable(AccountManager.KEY_INTENT, intentToReturn);
return bundle;
}
19
Source : Authenticator.java
with MIT License
from GoIntegro
with MIT License
from GoIntegro
@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) {
throw new UnsupportedOperationException();
}
See More Examples