I'm working with the EWS Java API 1.2 in an Android application. Logging in with username/password WebCredentials
is working fine using something like this:
ExchangeService service = new ExchangeService();
ExchangeCredentials credentials = new WebCredentials("domain\\username", "password");
service.setCredentials(credentials);
Instead of supplying the password every time, I'd like to supply an authentication token. The EWS API contains a TokenCredentials
class, but how do I use it? Given a username and password, how do I generate a reusable authentication token? Once I generate such a token, how long is it valid?