- Have an old Mac Laptop with an old MacOS version that you need Microsoft Office installed on (works with Intel-based Mac running High Sierra)
- Have an Office 365 License
- You attempted to install Office and, when prompted to input your account details to authenticate in each Office App, the authentication window turns blank (in my case, it occurs right after inputting the account email)
- Although it presents similiar issues when authenticating, I can't tell for sure if it works with Office 2016 (which I also installed, but moved on from before trying out this approach). This method was tested with Office 2019 alone.
- This method works for most of the apps bundled in Office 2019 (tested with Excel, Word, PowerPoint and OneNote - I think Outlook doesn't require it, although I haven't set it up). However, I couldn't get it to work for Microsoft Teams, as it seems to follow an alternate authentication approach that I haven't investigated too deeply as I wasn't invested in getting that App specifically to work.
- In its current state, this method will require you to move quickly to manually select, alter and submit the intercepted request. It may take a few attempts to do it quickly enough (from what I tested, it seems like you need to do it in under 30s). Maybe this method could be replaced by a small mitmproxy add-on to overcome this
The method involves intercepting the App request made from the authentication window (i.e. the embedded browser window that pops up when the Microsoft Office App attempts to authenticate to your Microsoft Account) that leads to the blank page, using that request URL in a browser to complete the login, capturing the result code and then forcing the authentication page window to redirect to that same code URL. In other words, we will run part of the authentication process from a separate browser in order to see it completed and then simply return the auth code to the authentication window via a specially-crafted redirect response.
Intercepting and modifying the authentication window requests may take some time to learn and to execute quickly enough. Take some time to understand how it works in order to do that, as the authentication page times out after a certain period of time without a response. I highly recommend learning the tool shortcuts to avoid wasting any time in that process.
- Have a working browser available in the machine (in my case I had to install the latest available Firefox for MacOS High Sierra)
- Download and install Office 2019 for Mac
- Here you should be able to find a version that works in your case: https://learn.microsoft.com/en-us/officeupdates/update-history-office-for-mac
- Install this proxy tool for intercepting and modifying the authentication requests: https://mitmproxy.org/
- You need to install an older version that is compatible with your macOS version: https://mitmproxy.org/downloads/
- Start up the proxy tool (in my case, it opened a Terminal window with a text-based UI)
- Enable proxy in the computer network settings (I've set it to proxy both http and https traffic via 127.0.0.1:8080)
- The tool should be showing flows in the Terminal UI
- Install the tool certificates and have the machine trust them in order to intercept and manipulate https traffic: https://docs.mitmproxy.org/stable/concepts-certificates/
- This should lead you to the following local URL, which the proxy will intercept:
mitm.it
- Remember to set this certificate to "Always Trust"
- This should lead you to the following local URL, which the proxy will intercept:
-
Select one Office App that you wish to authenticate under and start the App
- After providing your email, the authentication page should go blank when requesting the password
- Look for the last request made by the authentication window in the mitmproxy tool before it went blank. Focus on that URL with the arrow keys and hit enter to highlight the request details. Copy that URL
- In my case, the URL looked like this:
https://login.live.com/oauth20_authorize.srf?client_id=...
- After copying it from the Terminal, I also had to remove some spaces that got copied from the terminal window
- In my case, the URL looked like this:
- Disable the computer proxy setting (otherwise the next step won't work)
- Open the captured URL in a browser (I've done it with Firefox) and finish the authentication process:
-
Let's now authenticate the Office App
-
Go back to the authentication window, click back
-
In the mitm proxy UI, configure an intercept command. We'll use it to intercept and modify the response to the request that leads to the blank page this time: https://docs.mitmproxy.org/stable/mitmproxytutorial-modifyrequests/. This is the setting I used:
- Intercept, to hold back from responding to authentication requests (shortcut
i
):/oauth20_authorize.srf
- (RECOMMENDED) Filter, to ensure that only relevant flows will show up (shortcut
f
):login.live.com
- Intercept, to hold back from responding to authentication requests (shortcut
-
Run through the authentication steps for the Office App once more. Right after that, go to the mitm proxy tool UI and look for the intercepted request flow and hit enter. Intercepted request flows will appear in red
-
Within the intercepted request, modify the following response properties:
-
Once both response code and headers are altered, go back to the flow list and hit
a
to allow response through -
Take a look at the Office App authentication window - it should have been able to move forward with the authentication process. You should now have your App authenticated with your Microsoft Account.
-
You can re-use the same code URL for all Office apps you wish to authenticate to (earlier in the document I listed the Apps it worked with)
-
-
Once you're done, remove the proxy setting from your network settings and feel free to uninstall mitmproxy
-
I also recommend removing the mitmproxy certificates from your local keychain as you'll no longer need them (or, at least, set them as not trusted).
This alternate method is a slight variation of the method above that involves the aid of a mitmproxy addon to automate some of the steps. Executing this method requires some level of familiarity with the Mac Terminal application.
- Copy the
office-auth-redirect.py
addon file to the same folder where the mitmproxy application is present - To launch the proxy, open the Terminal application and head over to the folder where the mitmproxy app and proxy addon are located. Here is an example where the mitmproxy application is located in the Downloads folder:
$ cd ~/Downloads
# Assuming that mitmproxy and the pyhton addon script are here:
$ ./mitmproxy.app/Contents/MacOS/mitmproxy -s office-auth-redirect.py
- This should start the proxy with the addon script. Now, attempt to log into the Office App.
- If you have Firefox installed, this should open a Window in it where it says that you are attempting to access a page via unsafe means. Disable the proxy from the network settings and reload the page. It should get you through the steps required to authenticate to your Office 365 account (beware: it won't need to happen if you are logged into Office 365 already). You should end up in the URL with the Auth code at the end of the flow (it's a blank page, like the one shown in the steps from the regular method above). Copy that Auth code URL
- If you don't have Firefox installed, while in the mitmproxy UI, hit
E
and look for a line that starts withHead over to this URL in your browser if you haven't yet:
. Copy the URL from that line and head over to a browser with it, after disabling the proxy in the networking settings. Copy the Auth URL at the end of the authentication process.
- Re-enable the proxy in the Network settings
- Close the mitmproxy tool in the Terminal (hit
q
to quit andy
to confirm) - Open the
office-auth-redirect.py
file with a text editor (e.g. you could usevim
from the Terminal) - Add the Auth URL you acquired to the AUTH_URL variable (don't forget to retain the quotes) and save the file.
- With this done, the script will behave differently: instead of opening a browser window, it will immediately redirect authentication attempts to the appropriate Auth code URL instead.
- Restart mitmproxy with the same command line once again
- Try to authenticate into Office from the Office App once again. This time, you should see the App successfully authenticating into Office 365
Hello Rafael
My name is Jean-Luc based in Sydney Australia, long time Mac user but very poor knowledge on using terminal interface, getting older does not help as well.
Thank you so much for your tutorial on: How Install Office 2019 on old Mac OS when you're stuck on a blank authentication page
Wonder if you can assist me, I am doing something wrong at the end of the process? ( I did go a few time through the mitmproxy tutorial about intercept and modification but I am doing something wrong?)
I am able to go through to step 9 iv of your tutorial:
Within the intercepted request, modify the following response properties:
Once I select the intercept with the arrow, I press enter
then using the arrow>> I move to the Response field
a. Response code (shortcut e c ): 302
I type e then c then 302 then enter
a quick confirmation message is shown in red for a few seconds Alert: [00:17:47:128] Set status_code on 1 flows
So up to here I guess I might be correct?
b. Response headers (shortcut e 9 , then a to add row):
I type e then 9 then a
a. Key: Location
b. Value: Full URL with the access token you copied earlier >
From here I am lost at what to do
now my window shows in a darken background
Edit Response headers
Key Value
below on a white Background
content-length 0
My cursor in then placed a line below the word content-length what should I do?
Should I type Key: Location and enter or else?
Should I then type value ?
After I paste the Full URL with the access token you copied earlier without the <> symbol
do I press enter or ESC to validate or else?
How do I go back to the flow ( pressing q ?)
Then a to allow the response through but I guess it has to happen quickly so the process does time out. Thanking you for your assistance if possible