logo
search
Power Query Problems

How to Connect Excel Power Query to a Website with Two-Factor Authentication (2FA)

Algirdas JasaitisAlgirdas Jasaitis Oct 10, 2026 869 views

Question details

The user wants to know if Excel Power Query can connect to web services that require two-factor authentication (2FA), and how to configure the connection.

How to Connect Excel Power Query to a Website with Two-Factor Authentication
Product
Microsoft Excel
Device & OS
not provided
Scenario
Pulling data from a secure web service or application like Business Central using Power Query.
Observed behavior
Needs to authenticate securely via 2FA, import the web data into Excel, and understand how 2FA affects data refresh capabilities.
Before you start

Ensure you have the exact web service URL or API endpoint ready, and keep your mobile device or authenticator app nearby to approve the two-factor authentication prompt during the initial sign-in.

Solution 1Recommended

Connect and Authenticate via 'From Web' in Excel

Use Excel's built-in web connection tool to access the service, choosing the appropriate authentication method (like OAuth or Web API) to trigger the 2FA prompt.

Power Query can successfully connect to web platforms protected by two-factor authentication (2FA), provided the web service supports modern authentication flows like OAuth. The connection process involves an interactive sign-in where you approve the login just as you would in a web browser.

1
Launch the Get Data Wizard

Open your Excel workbook, navigate to the 'Data' tab on the top ribbon, click on 'Get Data', select 'From Other Sources', and then click 'From Web'.

2
Enter the Web URL

In the dialog box that appears, paste the URL of the web service, API endpoint, or Business Central environment you wish to connect to, and click 'OK'.

3
Select the Authentication Method

A new window will prompt you for credentials. Select the authentication method required by your provider (often 'Organizational account' or 'Web API' for corporate services).

4
Sign In and Approve 2FA

Click 'Sign In'. A browser-like popup will appear. Enter your username and password, then approve the two-factor authentication request on your phone or authenticator app.

5
Load and Transform Data

Once authenticated, click 'Connect'. The Power Query Navigator will open, allowing you to select the specific tables you need, transform the data, and load it into your spreadsheet.

Connect and Authenticate via 'From Web' in Excel
Limitations on Automated Refresh: Because two-factor authentication requires human interaction (e.g., tapping 'Approve' on a phone), unattended or scheduled automated refreshes may fail. You will generally need to refresh this data manually so you can respond to any 2FA prompts.
Free Microsoft Office alternative

Try WPS Office for Seamless Data Management

While advanced API connections with 2FA are specific to Microsoft's Power Query ecosystem, WPS Office provides an incredibly lightweight, free, and highly compatible alternative for your daily spreadsheet and data analysis needs. Enjoy all standard data processing tools without expensive subscriptions.

  1. 1. Download and Install: Visit the official WPS Office website to download and install the free software suite on your computer.
  2. 2. Open WPS Spreadsheet: Launch WPS Office and click on 'Spreadsheet' to create a new blank workbook or open an existing Excel file.
  3. 3. Import and Analyze Data: Use the 'Data' tab to easily import CSV files, web queries, and text files, then utilize built-in tools to filter and summarize your data.
Fully compatible with Microsoft Excel formats (.xlsx, .xls, .csv).Lightweight design ensures fast startup and smooth data handling on any device.Includes robust tools for data analysis, filtering, and pivot tables.Free to download with a highly familiar user interface, requiring zero learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my scheduled Power Query data refresh fail when using two-factor authentication?

Scheduled or unattended data refreshes fail because 2FA inherently requires interactive user input (such as entering a code or tapping an app notification). Since an automated background process cannot physically perform this step, the connection gets blocked.

Can I bypass two-factor authentication for automated Excel refreshes?

You cannot bypass standard 2FA if your organization mandates it. However, you can ask your IT administrator if they can provide an 'App Password', a Service Principal, or a dedicated API token that is authorized for unattended data extraction without triggering a 2FA prompt.

Does Power Query support Organizational account logins?

Yes. When connecting to supported Microsoft services, Business Central, or SharePoint, you can select 'Organizational account' in the authentication dialog. This natively supports modern authentication flows, including Azure Active Directory 2FA.