Menu

#111 Two factor authentication on EWS

v5.0.0
closed
None
5
2018-12-03
2017-06-06
No

Not sure if this could be called a bug, so I request a feature.
Situation:
Microsoft exchange server and previous settings that worked up till noon today was:

EWS protocol with owa url https://post.intility.no/owa

This has worked for years until IT figured they'd add two factor authentication (SMS) to the web mail "client" today at 12:00 sharp.

Now, when going to https://post.intility.no/owa in a web browser, I'm redirected to another login page, and upon success I'm back to https://post.intility.no/owa again. Can't really tell, but I suspect the EWS endpoint would be available after authenticating...

In logs I see 10 redirects before davmail gives up.

Attaching full davmail logs. It seems the problem is:
1) davmail unable to process the new login page or
2) NEW FEATURE: catch a two-factor login page (something like the Lightning for Thunderbird's google auth page) and then move on to contact EWS on the (original) owa url?

I might be barking up the wrong tree here, but it seems like not-a-bug but new-feature(?)

1 Attachments

Discussion

1 2 3 .. 5 > >> (Page 1 of 5)
  • Arno Teigseth

    Arno Teigseth - 2017-06-06

    Just found out that the organization also has an Android endpoint WITHOUT two-factor authentication... (well, could be the endpoint works for other OS as well) Tried that as OWA url in davmail and it worked. Until they add additional security to it, it worked with https://eas.intility.no/owa

    Perhaps this finding could be of help for others whose organizations do something like this and do support android clients: try and look in the android email settings and copy that to the OWA URL ;)

     
  • casso

    casso - 2017-09-14

    My company has also started using two-factor authentication. In our case they're using Office365 MFA. I believe in both cases that OAuth2 support would resolve this issue. If the email client attempts OAuth2 authentication then DavMail should be able to work through an OAuth2 authentication process.

     
  • Mickael Guessant

    • status: open --> wont-fix
     
  • Pavel Tatashin

    Pavel Tatashin - 2018-08-15

    DavMail does not work with Office365 and MFA if organization disabled the application password feature. So, having OAuth2 support is still needed.

     
  • Jack Thomasson

    Jack Thomasson - 2018-08-21

    also not working with my organization's email on office365.com. looks like application password is disabled.

     
  • Mickael Guessant

    Not sure there is a way to authenticate with EWS without an application password and without an oauth application clientid :-(

     
  • Jack Thomasson

    Jack Thomasson - 2018-09-08

    i created an Application ID for my user account (not Administrator!) using the instructions at https://wiki.gnome.org/Apps/Evolution/EWS/OAuth2.

     
  • Mickael Guessant

    • status: wont-fix --> open
     
  • Mickael Guessant

    Reopening, MFA support is indeed required when application passwords are disabled on tenant.

     
  • Mickael Guessant

    • status: open --> accepted
    • assigned_to: Mickael Guessant
    • Group: Next Release (example) --> v5.0
     
  • Mickael Guessant

    Ok, first working prototype of an interactive Oauth2 authentication with EWS, see EWSAuthenticationFrame.java
    => this application should open an authentication frame, and on success retrieve an Oauth2 token to authenticate against Office365 EWS endpoint

    Note that Java >= 9 is a prerequisite.

     
  • Jack Thomasson

    Jack Thomasson - 2018-09-13

    do you have a nightly build? i installed four different versions of jdk but only java-1.8.0-openjdk-devel-1.8.0.181.b15-0.fc28.x86_64 had the tools.jar ant requires but davmail would not compile. i'm guessing because it is Java < 9.

     
    • Mickael Guessant

      Sorry, forgot to commit the jettison lib, only added it to Maven POM.

      You can compile with Java 8 or later, Java 9 is only mandatory for Microsoft logon page

       
  • Pavel Tatashin

    Pavel Tatashin - 2018-09-13

    Thank you Mickael for working on this feature. A quick question, do you anticipate that this will work only when davmail is installed on local computer? Or will it somehow work when it is installed on a server, and is used from various devices?

     
    • Mickael Guessant

      Currently only desktop will work, as we have an interactive authentication and consent.

      In the future we may be able to automatically authenticate, after the initial consent that must be manual.

       
  • Mickael Guessant

    Just to be clear: we do not have a working DavMail with Oauth support, just a standalone app (EWSAuthenticationFrame) that demonstrates interactive authentication.

     
  • Mickael Guessant

    Update: add davmail.enableOauth2=true with latest trunk commit to test interactive OAuth2 authentication

     
  • Jack Thomasson

    Jack Thomasson - 2018-09-26

    i tried on Mac OS High Sierra with:

    brew install ant
    brew cask install java10

    and built DavMail-MacOSX-4.9.0-2664-trunk.app.zip. yay!

    i added to .davmail.properties:

    davmail.enableOauth2=true

    then launched DavMail.app and Thunderbird.app. i get a new DavMail window labeled https://or.company.com/IWA/ with:

    Unauthorized: Access is denied due to invalid credentials.

     
  • Mickael Guessant

    IWA means integrated windows authentication => this is not a form based authentication, and I did not implement username/password callback.

    We now have two authenticators, please remove the enableOauth2 parameter and set:
    davmail.authenticator=davmail.exchange.auth.O365Authenticator
    => for headless authenticator, you may have to open the consent page first, please check logs

    davmail.authenticator=davmail.exchange.auth.O365InteractiveAuthenticator
    => for interactive authentication, will automatically send username/password if requested by target server

    Additional note: tested only with standard Office 365 authentication (with Azure AD), may need some adjustments for other use cases (ADFS, ...)

     

    Last edit: Mickael Guessant 2018-09-29
  • Jack Thomasson

    Jack Thomasson - 2018-10-03

    yes, it does work and i am very grateful for that.

    is it possible to make the interactive MFA window come to the front? my experience is that while Thunderbird repeatedly requests your password nothing good happens. it wasn't until i pulled up the DavMail logs window did i realize there was this other completely obscured window asking for MFA.

     
  • Mickael Guessant

    Great, thanks for your feedback, tried to fix the focus issue in trunk.

    I also refactored code to implement token refresh => you should no longer get the MFA prompt every hour, DavMail will try to refresh token transparently.

     
  • Jack Thomasson

    Jack Thomasson - 2018-10-04

    nice, pops to the top; unfortunately, locks up when i use it:
    press checkbox
    press pull down
    * press the button to interact with my phone does cause the phone to pop up an approval but once that is acknowledged DavMail locks up

    in all cases i have to Force Quit.

     
  • Mickael Guessant

    Ok, this is probably the progress bar getting in the way => use it only on initial page load.
    Fix available in trunk

     
1 2 3 .. 5 > >> (Page 1 of 5)

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.