From 0c6964ccd8b54299e7c42c4de24efe715fc82016 Mon Sep 17 00:00:00 2001 From: mguessan Date: Wed, 29 Jan 2014 23:03:48 +0000 Subject: [PATCH] EWS: Override authentication mode test: EWS is never form based git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2219 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- .../davmail/exchange/ews/EwsExchangeSession.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/java/davmail/exchange/ews/EwsExchangeSession.java b/src/java/davmail/exchange/ews/EwsExchangeSession.java index 016999b2..986bd795 100644 --- a/src/java/davmail/exchange/ews/EwsExchangeSession.java +++ b/src/java/davmail/exchange/ews/EwsExchangeSession.java @@ -141,6 +141,22 @@ public class EwsExchangeSession extends ExchangeSession { super(url, userName, password); } + /** + * Override authentication mode test: EWS is never form based. + * + * @param url exchange base URL + * @param httpClient httpClient instance + * @return true if basic authentication detected + */ + @Override + protected boolean isBasicAuthentication(HttpClient httpClient, String url) { + if (url.toLowerCase().endsWith("/ews/exchange.asmx")) { + return false; + } else { + return super.isBasicAuthentication(httpClient, url); + } + } + @Override protected HttpMethod formLogin(HttpClient httpClient, HttpMethod initmethod, String userName, String password) throws IOException { LOGGER.debug("Form based authentication detected");