
Learn to set up and secure web apps and web APIs with a centralized identity server, test the web API with Postman, and issue tokens for secure clients and resources.
Identity Server 4, built on OpenID Connect and OAuth 2.0, enables open source centralized authentication as a service, single sign-on, and API access control across web, mobile, and native apps.
Explore how users, clients, and resources interact through identity server 4, OpenID Connect, and OAuth 2.0, issuing access tokens to protect APIs and centralize authentication.
Install the dotnet core sdk, verify the version, and set up Visual Studio; install Jason formatter and Postman to build and test a Web API secured with Identity Server 4.
Create a web api for a banking customer service from an empty Visual Studio solution, then add the api project and outline future identity server and client app integration.
Create an ASP.NET Core web API project, using an in-memory database and dependency injection to configure the DB context in startup, for a customer API.
Create a customer model class in a new models folder, with an id of type long, a first name of type string, and a last name of type string.
Create a bank context that extends DbContext, wire in Entity Framework Core, and implement a constructor with options. Expose a public set of type Customer for an in-memory database.
Configure services to inject the bank context, using an in-memory database via options.use in-memory database, and reference the bank context from the models to resolve the setup.
Create a customers API controller wired to the bank context, inject the DbContext via startup, and expose endpoints to get all customers, get by id, update, create, and delete.
Update the launch settings to point to the customers controller, run the api with IIS Express, and verify localhost port loads the /customers endpoint with an empty json.
Launch Postman, create a banking API collection, define get, post, put, and delete endpoints for customers, and add sample requests and payloads to consume the web API.
Launch the api, fetch all customers with a get request in postman, and note the empty in-memory database. Debug with breakpoints and save requests to the banking application collection.
Execute a get specific customer call using the id-based endpoint, observe a 404 not found with no customers, and save this request alongside the get all customers call.
Create new customers via a post request with a JSON body containing id, first name, and last name, and use Postman to fetch all or individual customers through the API.
Explore .NET Core Identity Server 4 rest endpoints, including get all customers, get a specific customer, post create customer, and update a customer with a put for id three.
Create and test a delete endpoint for customers, deleting customer three and returning 200 OK; verify the list excludes the deleted customer.
Export your Postman collection from the Web API testing setup to share with colleagues or import later. Use version 2.1 by default and save as XML on your desktop.
Set up and run a new identity server project to secure your existing dotnet web api, using a console-based development launch on localhost:5000.
Install identity server 4 packages and wire up the middleware in startup using the NuGet package manager. Explore identity model, cryptography, and JWT tokens built atop OpenID Connect 2.0.
Configure IdentityServer in startup using dependency injection, add developer signing credentials, and define in-memory API resources and clients, then wire the IdentityServer into the request pipeline.
Set up a config class to define API resources and clients for identity server, enabling resource access and client credentials with hashed secrets and scoped APIs.
Launch the identity server and explore its discovery document at /.well-known/openid-configuration to learn available endpoints, grant types, scopes, and how to obtain a token to call the API.
Learn how to obtain an access token from an identity server using Postman, with client credentials and scope for the bank API, and verify token-based access to secure endpoints.
Configured the Web API and identity server, launched both, tested API calls and token retrieval, and set up the client and API resources.
Install the access token validation package from NuGet and wire it as middleware to validate incoming tokens against our identity server issuer. Verify installation via the dependencies list.
Configure dependency injection and update startup to enable access token validation with identity server authentication. Set the authority, https metadata, and API name to secure the API.
Secure the web api controller by adding an authorization attribute at the top of the customers controller, reference the ASP.NET authorization resource, and save the changes.
Launch the identity server first, then the API, and finally the clients. Secure the API with tokens via the identity server token generator and test via Postman.
Open postman and test the banking API endpoints to verify the controller enforces authorities and restricts access to registered clients only.
Learn to secure an API with jwt tokens by obtaining a token from the identity server and calling protected customer endpoints using a bearer token in Postman.
Create a net core console client that calls the local identity server to obtain a token using a new get package, then call the Bank of net API.
Install the identity model NuGet package version 3.9.0 using the NuGet package manager to provide a client library for securing web apps, web APIs, and server apps.
Learn how to consume identity server in a .net core client by discovering endpoints, creating a token client, and requesting a client credentials token for bank of dot net api.
Demonstrates a console client securely consuming an api by acquiring a bearer token, posting a new customer as json, then retrieving and parsing the customer list.
Demonstrates debugging identity server workflow: launch identity server, API, and client; inspect the discovery document, fetch a token via client credentials, and create and list customers with a bearer token.
Explore the BankOfDotNet solution file contents as part of getting started with identity server; access the full solution zip in lecture resources and look out for bonus lectures.
Discover how grant types govern how clients obtain access tokens from the Identity Server to access resources. Focus on the client credentials flow used in the example.
Explain client credentials for machine-to-machine access, why browser apps should not expose secrets, and describe the resource owner password grant and end-user authentication with IdentityServer4 and ASP.NET Core Identity.
Explain when to use the resource owner password grant versus client credentials, highlighting trusted first party apps, no user involved, and machine-to-machine server-to-server scenarios.
Explore the authorization code grant type in server-side and third-party native apps, plus identity server 4's implicit and hybrid flows with identity tokens and OpenID Connect.
The implicit flow targets browser-based apps, redirecting the user to Identity Server 4 for login, consent, and then returning tokens to access resources.
Explore the hybrid grant type in identity server, a blend of implicit and authorization code flows, enabling Google or Facebook logins and secure tokens.
Update the configuration to include in-memory test users for the resource owner, following the existing resources and clients, using the config file to get users and ensure Flo has users.
Configure a new resource owner password grant client with a unique client id, a secret, and the bank of dot net api scope, creating two clients with different flows.
Use a console client and token client to perform resource owner password grant against identity server, retrieving an access token via discovery and inspecting the JWT for sub and scope.
Install built-in templates to quickly set up a UI-based identity server for the implicit flow. Create an MVC-based client configured for identity server authentication, including login and redirect.
Install the IdentityServer 4 templates with dotnet new and add the UI via QuickStart assets. Explore the login, consent page, and account views to see the IdentityServer workflow.
Configure identity server ui assets by setting up the startup file, register static files and html and javascript through the dependency injection pipeline, and enable MVC with the default route.
Create a new mvc client as a .NET core web app, set port 5003, designate startup project, and launch to a landing page while preparing for identity with implicit flow.
Configure the mvc client to use OpenID Connect with identity server as the authority, enabling login and consent, cookie-based authentication, and token saving for API access.
Add a secure action in the home controller and protect it with the authorize attribute, then create a secure view that lists the user’s claims by looping through them.
Configure OpenID Connect identity scope resources in a .NET Core IdentityServer4 project by adding in-memory identity resources such as OpenID and profile and wiring them in startup.
Add an implicit flow client to identity server 4, using the mvc client id. Configure redirect URIs and post logout redirects to localhost:5003, and include openid and profile scopes.
Test the mvc client by starting identity server first, launching the client, and completing login and consent to access the secure home page via implicit flow.
Implement the logout action by adding an async logout method that signs out the cookies-based authentication and the OpenID Connect session, demonstrating the login/logout flow with Identity Server 4.
Configure a SQL Server 2017 database to store identity server resources using the identity server entity framework package, moving from in memory resources to a live database.
Upgrade IdentityServer4 to version 2.3.2, install the IdentityServer4.EntityFramework NuGet package for your project, verify dependencies, and build to ensure SQL Server 2017 persistence.
Add appsettings.json with a connection string for the identity server database, read it via a configuration builder using Microsoft.Extensions.Configuration, and configure entity framework migrations to use SQL Server.
Configure SQL Server stores for identity server by replacing in-memory resources with configuration and operational stores, using a SQL Server context and a connection string from app settings (no hardcoding).
Run migrations to set up identity server 4 database objects via the package manager console. Create persisted grant and configuration contexts for SQL Server.
Initialize the identity server database by applying migrations, seed clients, identity resources, and API resources from the config file, using configuration and db contexts and saving changes.
Launch Identity Server 4 and generate a SQL server database using code-first migrations, persisting operational and configuration data, including clients, API resources, scopes, and identity resources.
Get Started with .NET Core Identity Server and Securing your Applications!
Are you a student or professional in the field of software engineering using .NET Core and need to integrate security middleware within your Web Application and Web API's? Have you been looking for a quick and easy way to get up and running with the new Cross Platform .NET Core and Identity Server 4 technology and don't want to go through an overwhelming amount of material just to get your environment configured? Don't worry as THIS IS THE COURSE FOR YOU!
In my course, I will teach you how to get your .NET Core Apps integrated with Identity Server 4 and help you to build and secure your Web API's through a step-by-step guided approach. I will be showing you all the necessary installation and setup needed for .NET Core, Identity Server 4, and Postman!
Take this course and feel proud of the fact that you will be one step closer towards mastering .NET Core, Web API's, and Identity Server 4!