Auth0 Web Login on a Mobile Application Fails With "Safari cannot open the page because too many redirects occurred"

Overview

A Safari redirect error occurs during web login on a mobile application using the Auth0 Software Development Kit (SDK). A redirect loop, outdated browser cache and cookies, or the Safari cross-site tracking prevention setting causes this issue. Resolve this error by correcting the redirect loop, clearing the Safari website data, or disabling the cross-site tracking prevention feature.

 

When performing a web login for a mobile app, the browser sometimes shows the following error:

 

too many redirects

 

Safari displays the following message:

 

Safari cannot open the page because too many redirects occurred.

 

Applies To

  • Auth0
  • Safari Browser
  • Redirect Loop Error
  • Cross-Site Tracking Prevention

Cause

This is a Safari-specific error that occurs for multiple reasons. A webpage redirecting too many times indicates a configuration causing a redirect loop. Outdated redirect information in the browser cache or cookies also causes this issue. Additionally, enabling the Safari cross-site tracking prevention setting triggers this error.

Solution

How is a redirect loop resolved?

If a redirect loop is causing the issue, the page owner must correct the configuration that causes it.

 

The Safari Browser Cache and Cookies Require Clearing to Remove Outdated Redirect Information

If the issue is related to outdated redirect information in the browser cache or cookies, this can be reviewed using the following steps.

  1. From the menu bar in Safari, choose Safari > Preferences, then click Privacy.
  2. Click Manage Website Data.
  3. Use the Search field to find the redirecting website's name, then select the website and click Remove. Safari then removes all stored data for the website, including caches and cookies. This might cause the sign out of the website or change its behavior.
  4. Click Done, then close Safari preferences.

 

If the issue persists, repeat these steps, but instead of clicking Remove for the redirecting website, click Remove All to remove stored data for all websites visited in Safari.

 

How is the cross-site tracking prevention setting disabled?

This error may also occur when the Prevent Cross-site tracking setting is enabled. To disable this setting:

  1. Navigate to Settings, select Safari, and scroll down to Privacy & Security.
  2. Disable Prevent Cross-site tracking.
  3. Scroll down to Advanced, select Website Data, and delete the page from the website data.

Recommended content

No recommended content found...