Skip to content
UdemyJava Spring FrameworkPaid courseIntermediate levelCertificate

Secure .Net Microservices with IdentityServer4 OAuth2,OpenID (Udemy.com)

Securing .Net Microservices with IdentityServer4 using OAuth2, OpenID Connect and Ocelot API Gateway

Created by: Mehmet Ozkaya

Last updated May 2026

icon
What you will learn

  • Building IdentityServer4 Authentication Microservice
  • Get Token from Identity Server with client_credentials grant_type
  • Protecting API with Using IdentityServer4 OAuth 2.0 and JWT Token
  • OpenID Connect with IdentityServer4 For Interactive MVC Client Micorservice
  • IdentityServer4 OpenID Connect Integration For Client MVC Interactive Client Application
  • Consume Protected API with HttpClientFactory From Client Application
  • Adding the UI for OpenID Connect Login, logout, consent and error
  • Hybrid Flow of IdentityServer4 Secure Interactive Mvc Client (OpenID) and Api Resources (OAuth2)
  • Claim Based Authorization in IdentityServer4 Secure Interactive MVC Client (OpenID) and API Resources (OAuth2)
  • Ocelot API Gateway Implementation for MVC Client to Interact w/ IdentityServer4 and Carry Token
  • Secure Existing Microservices Reference Application w/ Adding IS4 Integration onto Ocelot and APIs

How it compares

Against the other 101 rated Udemy courses in Java Spring Framework on CourseDuck:

  • Rating4.3 out of 5higher than 23% of them
  • Reviews1,259#56 of 102 by number of reviews
  • Length5.5 hoursshorter than 77% of them
  • Last updatedMay 2026more recently than 60% of them

icon
Course Description

You will learn how to secure microservices with using standalone Identity Server 4 and backing with Ocelot API Gateway. We’re going to protect our ASP.NET Web MVC and API applications with using OAuth 2 and OpenID Connect in IdentityServer4. Securing your web application and API with tokens, working with claims, authentication and authorization middlewares and applying policies, and so on.

This course will led you get started securing your ASP.NET based microservices applications with IdentityServer4 using OAuth 2 and OpenID Connect on distributed microservices architecture. And Also you’ll learn how to secure protected APIs backing with Ocelot API Gateway in a microservices architecture.

Check the overall picture

You can see that we will have 4 Aspnet core microservices project which we are going to develop one by one and together.

Movies.API

First of all, we are going to develop Movies.API project and protect this API resources with IdentityServer4 OAuth 2.0 implementation. Generate JWT Token with client_credentials from IdentityServer4 and will use this token for securing Movies.API protected resources.

Movies.MVC

After that, we are going to develop Movies.MVC Asp.Net project for Interactive Client of our application. This Interactive Movies.MVC Client application will be secured with OpenID Connect in IdentityServer4. Our client application pass credentials with logging to an Identity Server and receive back a JSON Web Token (JWT).

Identity Server

Also, we are going to develop centralized standalone Authentication Server and Identity Provider with implementing IdentityServer4 package and the name of microservice is Identity Server.
Identity Server4 is an open source framework which implements OpenId Connect and OAuth2 protocols for .Net Core.
With Identity Server, we can provide authentication and access control for our web applications or Web APIs from a single point between applications or on a user basis.

Ocelot API Gateway

Lastly, we are going to develop Ocelot API Gateway and make secure protected API resources over the Ocelot API Gateway with transferring JWT web tokens. Once the client has a bearer token it will call the API endpoint which is fronted by Ocelot. Ocelot is working as a reverse proxy.

After Ocelot re-routes the request to the internal API, it will present the token to Identity Server in the authorization pipeline. If the client is authorized the request will be processed and a list of movies will be sent back to the client.

Also over these overall picture, we have also apply the Claim based authentications.

By the end of this course, you will have a practical understanding of how to secure .Net Microservices with IdentityServer4 using OAuth2, OpenID Connect and Ocelot Api Gateway.

Secure Existing Microservices Architecture

In the last section, we will give an assignment for security operations with identity server integration for an existing microservices reference application. We had developed run-aspnetcore-microservices reference application before this course.  We will extend this application with IdentityServer OAuth 2.0 and OpenId Connect features with adding new Identity Server Microservice.


Is this course for you?

This course is very practical, about 90%+ of the lessons will involve you coding along with me on this project. If you are the type of person who gets the most out of learning by doing, then this course is definitely for you.

Tools you need for this course

In this course all the lessons are demonstrated using Visual Studio 2019 as a code editor. You can of course use any code editor you like and any Operating system you like as long as it's Windows or Mac.

icon
Udemy Discount

The discount is applied through our link. Open the course from here and Udemy's current promotional price is applied at checkout on most courses, no code to type.

Some courses are excluded from Udemy's promotions. If the price does not drop, clear your browser cookies and use the button again.

icon
Instructor Details

Mehmet Ozkaya

Software Architect with 15+ years of experience designing enterprise systems at global companies. More than 225,000 learners have taken my courses, many of them through Udemy Business in the IT departments of large companies.

Focused on AI Agents, GenAI and Microservices Architectures on .NET, AWS  and Azure ecosystems.

Developed agentic systems, genai and microservices repositories on GitHub and create Udemy courses from real-world applications.

Also create courses about Designing Agentic AI Software Architectures for Cloud-Native and Serverless Event-driven Microservices.

I have regularly develop on GitHub, blog on Medium.


GitHub : mehmetozkaya

icon
More courses by Mehmet Ozkaya

$69.99

$11.99

$12.99

$10.99

$13.99

$79.99

icon
More Java Spring Framework courses

$84.99

$84.99

$12.99

$11.99

$10.99

$94.99

icon
Reviews

4.3

1,259 ratings on Udemy

Select a bar to show only those reviews.Select the bar again to show every rating.

By Biraj Dhakal on 3/9/2025

Content-wise, it is okay, but the content needs to be upgraded. Identity Server 4 does not work anymore; I had to use Duende Identity Server. The instructor made a great effort; however, the communication could have been better. The length of the course is small, it should have more stuff. Overall, learned a lot from the course.

By Özgür Aşık on 2/29/2024

Tutor explains about securing the modern web applications via OAuth 2.0 in the most clean and efficient way in this course. Gateway implementation and its authentication management is also a nice bonus. One minor setback is assignment solutions are not included within the course content. Tutor gives something like 3 or 4 assignments throughout the course, but only saying what to do. Solutions are shared under the public GitHub repo. In my opinion solutions should be also documented and explained under the course content.

By Salami Waris olaniyi on 1/6/2023

This course have been so incredible, valuable and very informative. Thank you for making these resources available. Also I would love to have the link to download the microservice documents as promised in your bonus video. Kindly avail the link via my Email Address "olawareez96@gmail.com". Thank you.

By Gabriel Mamani on 10/11/2022

Really well done; made a dry subject really interesting. Good to be updated on the changes that have taken place with IdentityServer4. Real life examples; Very good course and top marks for the instructor.

By Cristián Ulloa on 9/23/2022

I learned a lot. I didn't know how to implement authorization/authentication with Identity Server, so a coworker recommended me this course because I need to implement this in my job (in fact, I did this course using the new version of Duende Identity Server with .NET 6, and it worked like a charm). Thanks!

By Yunus Emre GÖL on 11/25/2021

He is one of the best trainers I have followed in udemy. He has very good knowledge in each topic he touched. Also clear language to explain what he talks on. I am highly suggested to take this course if you need to understand authentication and authorization for microservies via OpenId and OAuth2 standarts.

By Panos Anastasiadis on 6/20/2021

Very good course. A few recomendations: 1) Provide video solutions for assignments 2) Deal with more complex issues like token expiration, refresh tokens, aggregator services, cloud native message brokers. 4) Use a real identity Store Use a more popular front end famework to build a client. Vue/React/Angular and the different complexities of that follow a spa app.

By Pw Cloete on 6/15/2021

Did learn the basics on using Identity service 4 w.r.t APIs and VMC applications. The presenter's English accent was however difficult to follow at some stages. Was also presented with 'assignments' without follow-up walk through videos, whereas other courses on udemy typically provide that additional context.

By Alireza Moghadamzadeh on 5/14/2021

This is a third course I took from Mehmet and like other previous courses (Grpc and Architecture), I learned a lot from this course. fantastic demo and presentation. Going for fourth one :) Thank you Mehmet

By Wong Ting Sen on 12/22/2020

Coming here expecting to find how to utilize IdentityServer4 and OcelotAPIGateway for my Microservices project in university. This course is pretty informative, and so far have been really helpful in my academic project!

Showing all 10 reviews on CourseDuck

Read all 1,259 reviews on Udemy

icon
Quality Score

No CourseDuck member has rated this course yet. Taken it? Give each part a thumbs up or down.

Content Quality
/
Video Quality
/
Qualified Instructor
/
Course Pace
/
Course Depth & Coverage
/

Overall Score : 86 / 100