Authentication with ASP.NET and IdentityServer4

I Solved it.
My asp.net login screen lacked a consent form, which in turn resulted in the unauthorized exception.