Authentication broken on ASP.Net Core and Safari on iOS 12 / Mojave (take 2)

UPDATE: While I haven’t tested it, Brock Allen provided a much cleaner solution here: Same-site cookies, ASP.NET Core, and external authentication providers | brockallen (specifically, the code under " The fix specifically for ASP.NET Core"). If using that code, remember to switch signin-oidc to signin-auth0 in the path check. I.e.:

public void Configure(IApplicationBuilder app)
{
   app.Use(async (ctx, next) =>
   {
      await next();

      if (ctx.Request.Path == "/signin-auth0" && 
          ctx.Response.StatusCode == 302)
      {
          var location = ctx.Response.Headers["location"];
          ctx.Response.StatusCode = 200;
          var html = $@"
             <html><head>
                <meta http-equiv='refresh' content='0;url={location}' />
             </head></html>";
          await ctx.Response.WriteAsync(html);
      }
   }
   
   [...]
}
1 Like