Skip to content

Commit

Permalink
EWS: Send authentication failed instead of generic error in case of u…
Browse files Browse the repository at this point in the history
…sername mismatch in O365Authenticator

git-svn-id: https://svn.code.sf.net/p/davmail/code/trunk@2804 3d1905a2-6b24-0410-a738-b14d5a86fcbd
  • Loading branch information
mguessan committed Nov 24, 2018
1 parent 27b23af commit 2160eb1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import davmail.BundleMessage;
import davmail.Settings;
import davmail.exception.DavMailAuthenticationException;
import davmail.exchange.ews.BaseShape;
import davmail.exchange.ews.DistinguishedFolderId;
import davmail.exchange.ews.GetFolderMethod;
Expand Down Expand Up @@ -297,7 +298,7 @@ public void run() {

LOGGER.debug("Authenticated username: " + token.getUsername());
if (username != null && !username.isEmpty() && !username.equalsIgnoreCase(token.getUsername())) {
throw new IOException("Authenticated username " + token.getUsername() + " does not match " + username);
throw new DavMailAuthenticationException("Authenticated username " + token.getUsername() + " does not match " + username);
}

} else {
Expand Down

0 comments on commit 2160eb1

Please sign in to comment.