mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-07 03:38:05 -05:00
EWS: allow autodiscover after authentication failure
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1540 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
1b2c7c720c
commit
e8a7e0b750
@ -148,13 +148,15 @@ public class EwsExchangeSession extends ExchangeSession {
|
|||||||
// check EWS access
|
// check EWS access
|
||||||
try {
|
try {
|
||||||
checkEndPointUrl("/ews/exchange.asmx");
|
checkEndPointUrl("/ews/exchange.asmx");
|
||||||
} catch (DavMailAuthenticationException e) {
|
|
||||||
throw e;
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
try {
|
try {
|
||||||
// failover, try to retrieve EWS url from autodiscover
|
// failover, try to retrieve EWS url from autodiscover
|
||||||
checkEndPointUrl(getEwsUrlFromAutoDiscover());
|
checkEndPointUrl(getEwsUrlFromAutoDiscover());
|
||||||
} catch (IOException e2) {
|
} catch (IOException e2) {
|
||||||
|
// autodiscover failed and initial exception was authentication failure => throw original exception
|
||||||
|
if (e instanceof DavMailAuthenticationException) {
|
||||||
|
throw (DavMailAuthenticationException)e;
|
||||||
|
}
|
||||||
LOGGER.error(e2.getMessage());
|
LOGGER.error(e2.getMessage());
|
||||||
throw new DavMailAuthenticationException("EXCEPTION_EWS_NOT_AVAILABLE");
|
throw new DavMailAuthenticationException("EXCEPTION_EWS_NOT_AVAILABLE");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user