Hello there!

Need Help? We are right here!

miniOrange Email Support

Thanks for your inquiry.

If you dont hear from us within 24 hours, please feel free to send a follow up email to info@xecurify.com

Two-Factor Authentication (2FA/MFA) for Exchange Outlook Web Access (OWA)

Microsoft Office Outlook Web Access (OWA) offers integrated time and information management solutions. E-mail, calendar management, task management, contact management, note-taking, journaling, and online surfing are just a few of the capabilities of Outlook that help with communication and organizing. Outlook helps you to search and categorize your mail, organize your work, and better share your information with others all from one handy spot. You can enable two-factor authentication for Outlook Web Access (2FA/MFA for OWA) managed active directory to increase the security level.

Two-Factor Authentication (2FA) or Multi-factor Authentication (MFA) is the process of authentication in which you have to provide two factors to gain access into a particular application. First Factor is the one that you know - username and password and Second factor is - what you might have as unique, like a phone (For OTP) or Fingerprint. When we integrate 2FA in OWA, this additional layer of security prevents the unauthorized person from accessing your Microsoft OWA Applications even if they know your username and password. miniOrange provides 15+ Multi-factor Authentication methods and solutions to secure your resources.

OWA Exchnage Gateway Single Sign-on login

Connect with External Source of Users

miniOrange provides user authentication from various external sources, which can be Directories (like ADFS, Microsoft Active Directory, Azure AD, OpenLDAP, Google, AWS Cognito etc), Identity Providers (like Shibboleth, Ping, Okta, OneLogin, KeyCloak), Databases (like MySQL, Maria DB, PostgreSQL) and many more.

Apps supported by miniOrange

two factor authentication (2FA) miniOrange authenticator app

Authenticator App

two factor authentication (2FA) google authenticator app

Authenticator App

two factor authentication (2FA) authy authenticator app

Authy 2-Factor
Authentication App

two factor authentication (2FA) Microsoft authenticator app

Authenticator App


Follow the Step-by-Step Guide given below to enable Two-Factor Authentication (2FA) for outlook-web-access

1. Configure Exchange Gateway in miniOrange IdP

  • Login into miniOrange dashboard from the Admin Console.
  • From the left side menu, click on Apps → Manage Apps.
  • OWA Exchange Single Sign-On (SSO) manage apps

  • Click on Add Applicaton button.
  • Outlook Web Access (OWA) Single Sign-On (SSO) add app

  • In choose application type, click on create app button in SAML/WS-FED application type.
  • OWA SSO choose app type

  • In the next step, search for your application from the list, if your application is not found. Search for "custom" and you can set up your app via Custom SAML App.
  • Outlook Web Access (OWA) Exchange Single Sign-On select SAML tab

  • Configure Basic Settings for App:
    1. Custom Application Name: App name you like to provide. E.g. Custom SAML App.
    2. SP Entity ID or Issuer: Enter SP Entity ID / Issuer that would uniquely identify the Exchange Gateway.
      Note that the same value would need to be configured in the Exchange Gateway in the next steps.
    3. ACS URL: Enter ACS (Assertion Consumer Service) URL in the following format:
      https://myhost/exchangegateway/login.php, where https://myhost is the hostname of the server hosting the Exchange Gateway.
    Exchange OWA (Outlook Web Access (OWA)) Single Sign-On (SSO) Add Application

  • Configure Attribute Mapping:
    1. Select the attribute name with which you want to log in your application in Name ID field from the dropdown.
      eg. Username, Email, etc.
    2. Enter Name ID format such as E-mail address, nameid, etc in Name ID Format.
    3. Attributes can be mapped using the Add Attribute tab.
    4. Add attributes such as Email, Full name, etc. with its corresponding value as per shown in image.
    5. Multiple attributes can be added using icons.
    Exchange OWA (Outlook Web Access (OWA)) Setup Name ID and Attributes

  • Create an appropriate policy for the SAML Application.
    1. Group Name : Select an appropriate Group Name from the dropdown.
    2. Policy Name: Policy name you like to provide.
    3. Login Method: Select Appropriate method from the dropdown.
    Exchange OWA Single Sign-On (SSO) set Policy for the SAML Application

  • Click on Save.
  • To upload respective app logo for a Custom SAML App, click on Upload Logo tab.
  • Exchange OWA (Outlook Web Access (OWA)) Single Sign-On (sso) Updload Logo

  • Click on Save.

2. Configure miniOrange Exchange Gateway


    • PHP >=5.4: Official PHP installation guide
    • PHP LDAP Extension: Quick miniOrange guide to enable php-ldap extension
    • OpenSSL libraries
    • PHP DOM extension
    • Setup miniOrange Exchange Gateway
      • Download Exchange Gateway. It can be deployed on any web server(Apache/IIS) on any OS.
      • Extract the zip file in the web applications directory (/var/www/html for Linux or c:\inetpub\wwwroot IIS on WIndows servers)

      Configure AD/LDAP Connection for Exchange Gateway (LdapUtils.php) :

      • Configure server_name, ldap_bind_dn, ldap_bind_password, search_filter, search_base attributes.

      Outlook Exchange Gateway SSO settings

      Configure miniOrange as IdP for the Exchange Gateway (SamlConstants.php) :

      • From the SAML app created in the 1st step, go to metadata details.
      • OWA 2FA Exchnage Gateway Metadata details

      • Choose ‘Information required to authenticate VIA External IDPS’.
      • Update SAML Login URL, SAML Logout URL, X.509 Certificate, IdP Entity ID or Issuer in SamlConstants.php file from the above metadata details.
      • OWA 2FA SSO Metadata details

      Configure Exchange/OWA as application on Exchange Gateway (WsFedConstants.php)

      • Configure OWA/ECP base URL here.

      • Outlook URL: https://Exchange Base URL/owa

      • Exchange Control Panel URL: https://Exchange Base URL/ecp

      • Outlook Web Access (OWA) Exchange SSO login Metadata details

3. Configure Exchange / OWA for Sign-On using miniOrange and Exchange Gateway

  • Add Signing certificate (obtained in above step) to the Trusted People store on the Client Access Server using the steps below:
    • Open WsFedConstants.php copy the public key certificate into a new file and name it exchange-gateway.crt
    • Got to Management Console. Open run dialog (Win + R) and type mmc and press enter.
    • In Management Console, go to File > Add or Remove Snap-ins (Ctrl + M).
    • Search for Certificates on the left side and press Add.
    • In the Certificate Snap In window, select Computer account and press Next. Then select Local Computer and press Finish.
    • You will see an entry for Certificates (Local Computer) in the right pane. Click OK to close the Add or Remove Snap-ins window.
    • You will see a branch named Certificates created under Console Root. Expand the Certificates branch and select Trusted People.
    • Right click on Trusted People > Find > Import and click on Next.
    • Choose the location of the exchange-gateway.crt file you created above and click on Next, again Next and Finish.
    • You have successfully added a Signing Certificate to Trusted People. Now close Management Console and choose No on the Save data prompt.
  • Execute the commands on the Client Access Server using the Exchange Management Shell.

    $uris=@("https://##Base URL##/owa/","https:///##Base URL##/ecp/","https:///##Base URL##/owa","##Base URL##/ecp")
  • In the above command, ##Base URL## is the exchange/OWA host. The command has both URLs: One ending in / and the other one which does not contain a trailing slash.

    Set-OrganizationConfig -AdfsIssuer "https://##Exchange Gateway Host##/exchangegateway/login.php" -AdfsAudienceUris $uris -AdfsSignCertificateThumbprint ##Cert Thumbprint##

  • In the above command, ##Exchange Gateway URL## is the host name of the Exchange Gateway. The Cert Thumbprint is the SHA-1 thumbprint of the certificate you created above (exchange-gateway.crt) in the Exchange Gateway (in the includes directory).

    Get-EcpVirtualDirectory | Set-EcpVirtualDirectory -AdfsAuthentication $true -BasicAuthentication $false -DigestAuthentication $false -FormsAuthentication $false -WindowsAuthentication $false

    Get-OwaVirtualDirectory | Set-OwaVirtualDirectory -AdfsAuthentication $true -BasicAuthentication $false -DigestAuthentication $false -FormsAuthentication $false -WindowsAuthentication $false -OAuthAuthentication $false

    # Restart w3svc and was
    net stop was /y
    net start w3svc

4. Configure 2FA for Outlook Web Access (OWA)

4.1: Enable 2FA for Users of Outlook Web Access (OWA) app

  • To enable 2FA for Users of Outlook Web Access (OWA) application. Go to Policies >> App Authentication Policy
  • Click on Edit against the configured application.
  • Two factor-authentication for Outlook Web Access (OWA) | Two Factor Authentication configure 2fa of application

  • Enable the Enable 2-Factor Authentication (MFA) option.
  • Two factor-authentication for Outlook Web Access (OWA) | Two Factor Authentication enable 2fa

  • Click on Save.

4.2: Configure 2FA for your Endusers

  • To enable 2FA/MFA for endusers, go to 2-Factor Authentication >> 2FA Options For EndUsers.
  • Select default Two-Factor authentication method for end users. Also, you can select particular 2FA methods, which you want to show on the end users dashboard.
  • Once Done with the settings, click on Save to configure your 2FA settings.
  • MFA/Two-Factor Authentication(2FA) for   Configure 2FA Panel

4.3: Enduser 2FA Setup

  • Login to End-User Dashboard using end user login URL.
    • For Cloud Version: The login URL (branding url) which you have set.
    • For On-Premise version: The login URL will be the same as of Admin Login URL.
  • Select Setup 2FA from left panel. Then select any of the 2FA method available.
  • For now, we have selected the SMS >> OTP OVER SMS as our 2FA method. You can explore the guide to setup other 2FA methods here.
  • Enable the OTP over SMS if you have your phone number added under your profile section else click on Edit button.
  • MFA/Two-Factor Authentication(2FA) for   Configure 2FA Panel

  • Enter you Phone Number along with the necessary country code and click on the SAVE button.
  • MFA/Two-Factor Authentication(2FA) for   Configure Second Factor-SMS(Enter Mobile Number)

5. Test Outlook Web Access (OWA) 2FA

  • Go to your Outlook Web Access (OWA) Domain. It will redirect you to miniOrange Single Sign-On Service console.
  • zoom two factor authentication(2fa) user credentials

  • Enter your miniOrange login credentials and click on Login.
  • Since we have Two-factor authentication(2FA) enabled, you will be prompted to register for it. It's a one time process.
  • Configure your basic details.
  • zoom two factor authentication(2fa) user registration

  • Configure any authentication method of your choice.
  • zoom two factor authentication(2fa) add new security

  • After successful registration, you will be logged in to your Outlook Web Access (OWA) account.
  • Now we have Two-factor authentication enabled.
  • To verify your Two-factor authentication(2FA) configuration, go to your Outlook Web Access (OWA) Domain. You will be redirected to miniOrange login console.
  • zoom two factor authentication(2fa) verify user credentials

  • Enter your login credentials, and click on login. It will prompt to verify yourself against the configured 2fa method.
    e.g. If you have configured OTP over SMS, after login into Outlook Web Access (OWA) it will prompt for OTP.
  • zoom two factor authentication(2fa) otp prompt

  • Enter the OTP received in your phone, after successful 2fa verification, you will be redirected to the Outlook Web Access (OWA) dashboard.

  • Not able to configure or test MFA?

    Contact us or email us at idpsupport@xecurify.com and we'll help you setting it up in no time.

6. Adaptive Authentication with Outlook Web Access (OWA)

A. Restricting access to Outlook Web Access (OWA) with IP Blocking

    You can use adaptive authentication with Outlook Web Access (OWA) Single Sign-On (SSO) to improve the security and functionality of Single Sign-On. You can allow a IP Address in certain range for SSO or you can deny it based your requirements and you can also challenge the user to verify his authenticity. Adaptive authentication manages the user authentication bases on different factors such as Device ID, Location, Time of Access, IP Address and many more.

    You can configure Adaptive Authentication with IP Blocking in following way:
  • Login to Self Service Console >> Adaptive Authentication.
  • Add a Policy Name for your Adaptive Authentication Policy.
  • Outlook Web Access (OWA) Single Sign-On (SSO) Restrict Access adaptive authnetication policy

  • Select your Action for behaviour Change and Challenge Type for user from the Action for behaviour Change Section.
  • Outlook Web Access (OWA) Single Sign-On (SSO) Restrict Access adaptive authentication behaviour change

    Action for behaviour Change Options :

    Attribute Description
    Allow Allow user to authenticate and use services if Adaptive authentication condition is true.
    Challenge Challenge users with one of the three methods mentioned below for verifying user authenticity.
    Deny Deny user authentications and access to services if Adaptive authentication condition is true.

    Challenge Type Options :

    Attribute Description
    User second Factor The User needs to authenticate using the second factor he has opted or assigned for such as
  • OTP over SMS
  • PUSH Notification
  • OTP over Email
  • And 12 more methods.
  • KBA (Knowledge-based authentication) The System will ask user for 2 of 3 questions he has configured in his Self Service Console. Only after right answer to both questions user is allowed to proceed further.
    OTP over Alternate Email User will receive a OTP on the alternate email he has configured threw Self Service Console. Once user provides the correct OTP he is allowed to proceed further.

  • Now Enable Enable IP Restriction option from the IP RESTRICTION CONFIGURATION section to configure custom IP range.
  • Outlook Web Access (OWA) Single Sign-On (SSO) Restrict Access adaptive authentication ip blocking

  • Select the Action you want to perform if the IP address is out of the range. i.e. Allow, Challenge & Deny.
  • Specify the IP Address range for which you want above setting to reflect. You can add more than one IP Address ranges by clicking on following button +.
  • Scroll to the end and click on save.

B. Adaptive Authentication with Limiting number of devices.

    Using Adaptive Authentication you can also restrict the number of devices the end user can access the Services on. You can allow end users to access services on a fixed no. of devices. The end users will be able to access services provided by us on this fixed no. of devices.

    You can configure Adaptive Authentication with Device Restriction in following way

  • Login to Self Service Console >> Adaptive Authentication.
  • Add a Policy Name for your Adaptive Authentication Policy.
  • Select your Action for behaviour Change and Challenge Type for user from the Action for behaviour Change Section.
  • Outlook Web Access (OWA) Single Sign-On (SSO) Restrict Access adaptive authentication behaviour and challenge type

  • Scroll down to Device Configuration section and enable Allow User to Register Device option to allow users to register their devices.
  • Enter the Number of Devices which are allowed to register in field next to Number of Device Registrations Allowed
  • Choose Action if number of devices exceeded (This will override your setting for Action for Behaviour Change.)
    1. Challenge: The user needs to verify himself using any of the three methods mentioned in table in step 6.1
    2. Deny : Deny users access to the system
  • Enable option Send email alerts to Users if number of Device registrations exceeded allowed count if you want to alert the user about no of devices exceeding the limit. Save the configuration.
  • Outlook Web Access (OWA) Single Sign-On (SSO) Restrict Access adaptive authentication enable device restriction

C. Add Adaptive Authentication policy to Outlook Web Access (OWA).

  • Login to Self Service Console >> Policies.
  • Click on Edit option for predefined SAML app policy.
  • Outlook Web Access (OWA) Single Sign-On (sso) edit device restriction policy

  • Set your application name in the Application and select password as Login Method.
  • Enable Adaptive Authentication on Policy page and select the required restriction method as an option.
  • From Select Login Policy dropdown select the policy we created in last step and click on save.
  • Outlook Web Access (OWA) Single Sign-On (SSO) Restrict Access save device restriction policy

    How to add a trusted Device
    1. When End-user log in to the self service console after the policy for device restriction is on, he is provided the option to add the current device as a trusted device.

External References

Our Other Identity & Access Management Products