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