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

1

23

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?

Lyman answered 27/12, 2012 at 0:57 Comment(3)
Did you get anywhere with this question? I'm thing on something similar too and would be useful if you could share how you solved this issue (if you did it).Aquifer
@uthomas: Never found a solutionLyman
So after 6 years the problem is still relevant. Is there any solution ?Nuli
B
1

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.

Boiling answered 13/3, 2014 at 7:22 Comment(4)
While potentially helpful info, this isn't really an answer to this question. It appears Exchange servers don't support OAuth by default and require a third-party authentication provider. Further, the basic question of how to provide a token to the EWS Java API remains.Lyman
Mimi, thank you for your willingness to help. It is better to use include essential parts of the link in your answer because links may and do become broken over time, unfortunately.Furnary
Thanks for the tip Laszlo, I'll be sure to do that in the future. I was thinking more about this thread. I know about EWS & EWS Managed API, but not much about the Java API. Does the Java API enable you to add headers to your request? If so, then I think you could get OAuth to work with the EWS Java API - or that's my hypothesis anyways.Boiling
Unfortunately, it is very very very basic info :(Flycatcher

© 2022 - 2024 — McMap. All rights reserved.