Project Structure

What are OAuth2 andOpenID ?

What is IdentityServer4 ?

IdentityServer

app.UseRouting();
app.UseIdentityServer();
Discovery Document of our empty IdentityServer Project

Secret Api

app.UseAuthentication();
app.UseAuthorization();
[Authorize]
[HttpGet(Name = "GetWeatherForecast")]
public IEnumerable<WeatherForecast> Get()
{
...

Use Token button automatically sets incoming token at Headers as a Bearer token

Ocelot Api Gateway

User Management With EfCore

Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.InMemory
Microsoft.AspNetCore.Identity.EntityFrameworkCore
IdentityServer4.AspNetIdentity

Note: Here we used localhost:5001 but it could also be set as localhost:5000/identity in order to use Api Gateway.

Angular Client

ng new AngularClient 
//Specific version(14) --> npx @angular/cli@14 new AngularClient
npm i angular-auth-oidc-client

Not: I would like to thank Mehmet Ozkaya and Raw Coding , whose resources helped me a lot in writing this article. I leave the links of the resources I have used below.

GitHub - aspnetrun/run-aspnet-identityserver4: Secure microservices with using standalone Identity…

Secure microservices with using standalone Identity Server 4 and backing with Ocelot API Gateway. Protect our ASP.NET…

github.com

GitHub - dotnet-architecture/eShopOnContainers: Cross-platform .NET sample microservices and…

Cross-platform .NET sample microservices and container based application that runs on Linux Windows and macOS. Powered…

github.com

GitHub - T0shik/aspnetcore3-authentication

You can't perform that action at this time. You signed in with another tab or window. You signed out in another tab or…

github.com

GitHub - damienbod/angular-auth-oidc-client: npm package for OpenID Connect, OAuth Code Flow with…

Secure your Angular app using the latest standards for OpenID Connect & OAuth2. Provides support for token refresh, all…

github.com

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐