Redirect with Object reference not set to an instance of an object

When using an authentication.ps1, the problem is not there. See Unable to manage admin

We did not use the authentication.ps1, because it was being configured through appsettings.json (or actually environment variables).