Fully functioning finished sample code for my Securing ASP.NET Core 2 with OAuth2 and OpenID Connect course. Make sure you start up / deploy the IDP, Client & API project when running the finished solution.
The course can be found at https://app.pluralsight.com/library/courses/securing-aspdotnet-core2-oauth2-openid-connect/table-of-contents
Happy coding! :)