How to resolve NSURLErrorDomain:-1 error with Microsoft 365 accounts and OneDrive on Safari?

I'm getting this error. I think it may have something to do with Microsoft 365 accounts. I have two accounts. When I use OneDrive it may be triggering the problem. It stops me from using Safari and prevents me from accessing my OneDrive documents.

I deleted all of the Microsoft software and reinstalled it. It worked a bit better for two days. But the problems are back again.

I was wondering if anyone could advise?


[Re-Titled by Moderator]

Posted on Mar 4, 2025 12:30 PM

Reply
Question marked as Top-ranking reply

Posted on Mar 4, 2025 2:03 PM

Ok, thanks.


I have some suggestions for you to try.


Since OneDrive and Microsoft 365 rely on authentication cookies, clearing old or conflicting cookies can help, so yes, doing so would be a good first step.


The next suggestion would be disable any Safari extensions, especially ad blockers (or privacy-focused ones) as they can interfere with Microsoft 365 logins.


Next look for corrupt or duplicated credentials in Keychain Access:

  • Open Keychain Access (Note: On my Mac, running macOS Sequoia, Keychain Access did not appear as an icon in the /Applications/Utilities folder. In order for me to access it I had to enter Keychain Access into Spotlight).
  • In the Login keychain, search for Microsoft and OneDrive.
  • Delete any saved passwords or tokens related to Microsoft 365.
  • Try logging in to OneDrive again in Safari.


Next, test in Private Browsing Mode

  • Open Safari > File > New Private Window.
  • Try accessing OneDrive and Microsoft 365. If it works, the issue is likely related to cookies or cached data.


Next, since you have multiple Microsoft 365 accounts, Safari might be struggling with authentication:


Next, try flushing the DNS cache on your Mac.

  • Open Terminal and run:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  • Restart your Mac.


Finally, check if the issue is with Apple’s Safari Tracking Prevention

Safari’s Intelligent Tracking Prevention (ITP) might be causing conflicts with Microsoft authentication.

  • Go to Safari > Settings > Privacy.
  • Uncheck Prevent cross-site tracking.
  • Restart Safari and test OneDrive again.
5 replies
Question marked as Top-ranking reply

Mar 4, 2025 2:03 PM in response to peterfrombeaumont

Ok, thanks.


I have some suggestions for you to try.


Since OneDrive and Microsoft 365 rely on authentication cookies, clearing old or conflicting cookies can help, so yes, doing so would be a good first step.


The next suggestion would be disable any Safari extensions, especially ad blockers (or privacy-focused ones) as they can interfere with Microsoft 365 logins.


Next look for corrupt or duplicated credentials in Keychain Access:

  • Open Keychain Access (Note: On my Mac, running macOS Sequoia, Keychain Access did not appear as an icon in the /Applications/Utilities folder. In order for me to access it I had to enter Keychain Access into Spotlight).
  • In the Login keychain, search for Microsoft and OneDrive.
  • Delete any saved passwords or tokens related to Microsoft 365.
  • Try logging in to OneDrive again in Safari.


Next, test in Private Browsing Mode

  • Open Safari > File > New Private Window.
  • Try accessing OneDrive and Microsoft 365. If it works, the issue is likely related to cookies or cached data.


Next, since you have multiple Microsoft 365 accounts, Safari might be struggling with authentication:


Next, try flushing the DNS cache on your Mac.

  • Open Terminal and run:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  • Restart your Mac.


Finally, check if the issue is with Apple’s Safari Tracking Prevention

Safari’s Intelligent Tracking Prevention (ITP) might be causing conflicts with Microsoft authentication.

  • Go to Safari > Settings > Privacy.
  • Uncheck Prevent cross-site tracking.
  • Restart Safari and test OneDrive again.

Mar 4, 2025 12:43 PM in response to peterfrombeaumont

Let's start with: Is this issue only with the Safari web browser? Does this issue still occur with another web browser? What device are you using when you see this error: Mac, iPhone/iPad, Windows PC, etc.?


The NSURLErrorDomain:-1 error in Safari when using Microsoft 365 and OneDrive is often related to authentication issues, cookies, or conflicts between multiple Microsoft accounts.


If this issue is only with Safari, have you tried clearing its cache & cookies (specific to Microsoft)?

Mar 4, 2025 1:36 PM in response to Tesserax

This only occurs with Safari. It doesn't affect my Brave browser. I'm doing this on a MacBook Air M3.

I haven't tried clearing the cache and cookies. I'll try that. It's affecting other apps on the device too. When I start getting this error on Safari I am also unable to open any files in my OneDrive and none of the Microsoft Office apps work either. Thanks for your help Tesserax.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to resolve NSURLErrorDomain:-1 error with Microsoft 365 accounts and OneDrive on Safari?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.