<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content

.Net Core Authentication Continuously Redirects to Authorize Request as an Infinite Loop

API Access Management
Okta Classic Engine
Okta Identity Engine

Overview

.Net core authentication continuously redirects to the /authorize request as an infinite loop. The /authorize request will be followed by a 'Malformed Response Cookies' showing information about the cookie in the dev console.

Applies To

  • .Net
  • Authorize request
  • Infinite authorize request loop
  • Okta self-hosted sign-in Widget
  • Okta hosted sign-in widget
  • Sign-in widget
  • Authorization code flow

Cause

This may happen because of the cookie size that is stored in the web browser, and according to RFC 6265, the maximum size should be 4069. Since the cookie carries information/data, this may be happen if there were lots of groups set up in the org and there was a group claim added that returns all the groups like 'Matches regex .*' or of claim that returns a lot of information in the ID/Access token.

Solution

Add precise group claims that returns the groups / claim information required.



Using a custom authorization server

In the Okta Dashboard Console, in Security > API > Choose the authorization server > Claims tab, in case of using a custom authorization server.


Using an org authorization server

Under Applications > Applications > Choose the app > Signon tab > OpenID Connect ID Token.

If the cookie size is required to be large, then ChunkingCookieManager.Chunk size is a potential solution, as mentioned in this Microsoft Documentation.

Loading
.Net Core Authentication Continuously Redirects to Authorize Request as an Infinite Loop | Okta Support