Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exchange Web Services (EWS) Single Sign-On using TokenCredentials?

Tags:

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?

like image 403
quietmint Avatar asked Dec 27 '12 00:12

quietmint


People also ask

Does EWS support modern authentication?

Basic authentication is no longer supported for EWS to connect to Exchange Online. Use OAuth authentication in all your new or existing EWS applications to connect to Exchange Online. OAuth authentication for EWS is only available in Exchange Online as part of Microsoft 365.

How do I enable OAuth in EWS?

To use OAuth with your application you will need to: Register your application with Azure Active Directory. Add code to get an authentication token to get an authentication token from a token server. Add an authentication token to EWS requests that you send.

What is Exchange EWS service?

Exchange Web Services (EWS) is an application program interface (API) that allows programmers to access Microsoft Exchange items such as calendars, contacts and email.


1 Answers

You can now use OAuth tokens: http://msdn.microsoft.com/en-us/library/office/dn626019(v=exchg.150).aspx. This topic was just updated a few weeks ago with some basic info.

like image 164
Mimi Gentz Avatar answered Oct 13 '22 00:10

Mimi Gentz