Sathish Kumar
Sathish Kumar

Reputation: 321

EWS API (Java) OAuth not working

I am facing an issue with EWS OAuth, my requirement is to access mailbox of other users(EWS permissions are set). I got oauth2 authorization token and trying to do:

    service.getHttpHeaders().put("Authorization", "Bearer <token>");
    service.autodiscoverUrl("<email id>", new RedirectionUrlCallback());

and I get this error: microsoft.exchange.webservices.data.autodiscover.exception.AutodiscoverLocalException: The Autodiscover service couldn't be located.

Any idea?

Upvotes: 1

Views: 671

Answers (1)

Glen Scales
Glen Scales

Reputation: 22032

AFAIK you can't get an oAuth Token that will work against the Autodiscover endpoint in office365 (Autodiscover and EWS are different webservices so EWS permissions won't do). You don't really need to do an autodisccover in Office365 as the endpoint will should be https://outlook.office365.com/EWS/Exchange.asmx.

Cheers Glen

Upvotes: 2

Related Questions