Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8139367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:48:10+00:00 2026-06-06T11:48:10+00:00

I am working on an Android 3.0 program that can connect to a SSL’d

  • 0

I am working on an Android 3.0 program that can connect to a SSL’d php webservice (outputs data in JSON, I can modify the server). The tablets that are connecting to this service have a corporate Microsoft ActiveSync (exchange 2010) account, and only that account (no google accounts,FB, etc). I would like to write a program that can use the credentials saved in the tablet’s android.accounts.AccountManager to make secure requests on that PHP webservice. I tried following some google examples but I think the problem lies when I use the line:
AccountManagerFuture<Bundle> data = am.getAuthToken(b, "JWT", options, this, ota, null);
The application just hangs and I get no results.
In fact, setting a breakpoint at any line in the OnTokenAcquired class, doesn’t do anything. AKA OnTokenRequired never gets executed

Any advice or direction? I’m sure this could be helpful for getting corporate android client software

import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AccountManagerFuture;
import android.app.Activity;
import android.os.Bundle;
import android.widget.EditText;
public class AcctestActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        AccountManager am = AccountManager.get(this);
        EditText et = (EditText) findViewById(R.id.editText1);
        OnTokenAcquired ota = new OnTokenAcquired(et);
        Account exchange = null;
        Bundle options = new Bundle();
        for(Account a : am.getAccounts()){
              if(a.type.equals("com.android.exchange") && a.name.endsWith("@domain.com"))
                     exchange = a;
        }
        AccountManagerFuture<Bundle> data = am.getAuthToken(exchange, "JWT", options, this, ota, null);
    }
}

import android.accounts.AccountManager;
import android.accounts.AccountManagerCallback;
import android.accounts.AccountManagerFuture;
import android.accounts.AuthenticatorException;
import android.accounts.OperationCanceledException;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.Toast;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
public class OnTokenAcquired implements AccountManagerCallback<Bundle> {
       private EditText et;
       public OnTokenAcquired(EditText et){
              this.et = et;
       }
       public void run(AccountManagerFuture<Bundle> result) {
              Bundle bundle;
              try {
                     Toast.makeText(null, "Start!", Toast.LENGTH_LONG).show();
                     bundle = result.getResult(1, TimeUnit.SECONDS);
                     String token = bundle.getString(AccountManager.KEY_AUTHTOKEN);                         et.append("\nToken: " + token);
                     Toast.makeText(null, token, Toast.LENGTH_LONG).show();
              } catch (OperationCanceledException e) {
                     e.printStackTrace();
              } catch (AuthenticatorException e) {
                     e.printStackTrace();
              } catch (IOException e) {
                     e.printStackTrace();
              }            
       }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T11:48:12+00:00Added an answer on June 6, 2026 at 11:48 am

    After some hours of research in the sources I’ve found this code:

    public Bundle  getAuthToken(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle loginOptions) throws NetworkErrorException {
         return null;
    }
    

    This means, the android exchange Authenticator doesn’t provide the Tokenbased Authentication for Exchange-Server…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on a Android Web Services program that uses a number
I am working on a simple program that collects data from the field on
I am working on an Android program which calls in to native code. That
I am working on a project that a program in an android phone connects
I have the following php snippet. I am working on an android program and
I am now working on a program for Android which is something related to
I'm working on my first android application and running into an issue I can't
I changed some code on an android application that was working perfectly fine at
I'm working on a program for android very similar to a car/media dock program
I am trying to cross-compile a very simple program for Android that worked with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.