A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
search
AI OnAI Off
Hi,
I'm running into an issue with Okta authentication in my ASP.NET Core application. Here's the scenario:
When a user accesses a direct URL (e.g., an image, PDF, or a specific page), the authentication flow correctly redirects them to Okta for login.
After successful authentication, Okta redirects back to the /signin-oidc endpoint.
However, at this point, the ASP.NET Core authentication cookies that are normally created during a standard login flow are not being properly created or persisted.
This issue only occurs when accessing direct URLs. The normal login flow works fine and sets the cookies correctly.
Interestingly, this works perfectly in my development environment—even unauthenticated users can access the files and the cookies are set as expected. But in the deployed environment, the cookies are missing after the callback.
Here’s a snippet of my Okta extension class that I’m calling from Startup.cs:
Questions:
1- Is there something missing in the Okta authentication setup that would prevent cookies from being created on the callback?
2- Could this be related to SameSite cookie settings, HTTPS enforcement, or something environment-specific?
3- Any suggestions on how to debug or log the cookie creation process during the callback?
Would appreciate any inputs on this.
Regards.