19.11.2022 Views

NET-Microservices-Architecture-for-Containerized-NET-Applications

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Issues with the original HttpClient class available in .NET............................................................................. 298

Benefits of using IHttpClientFactory ....................................................................................................................... 299

Multiple ways to use IHttpClientFactory ............................................................................................................... 300

How to use Typed Clients with IHttpClientFactory ........................................................................................... 300

Additional resources ..................................................................................................................................................... 303

Implement HTTP call retries with exponential backoff with IHttpClientFactory and Polly policies ... 304

Add a jitter strategy to the retry policy ................................................................................................................. 305

Additional resources ..................................................................................................................................................... 305

Implement the Circuit Breaker pattern ....................................................................................................................... 305

Implement Circuit Breaker pattern with IHttpClientFactory and Polly ..................................................... 306

Test Http retries and circuit breakers in eShopOnContainers ...................................................................... 307

Additional resources ..................................................................................................................................................... 309

Health monitoring .............................................................................................................................................................. 309

Implement health checks in ASP.NET Core services ........................................................................................ 310

Use watchdogs ................................................................................................................................................................ 314

Health checks when using orchestrators .............................................................................................................. 316

Advanced monitoring: visualization, analysis, and alerts ............................................................................... 316

Additional resources ..................................................................................................................................................... 317

Make secure .NET Microservices and Web Applications ................................................. 318

Implement authentication in .NET microservices and web applications ...................................................... 318

Authenticate with ASP.NET Core Identity ............................................................................................................. 319

Authenticate with external providers ..................................................................................................................... 321

Authenticate with bearer tokens .............................................................................................................................. 322

Authenticate with an OpenID Connect or OAuth 2.0 Identity provider ................................................... 323

Issue security tokens from an ASP.NET Core service ....................................................................................... 324

Consume security tokens ............................................................................................................................................ 325

Additional resources .......................................................................................................................................................... 326

About authorization in .NET microservices and web applications .................................................................. 327

Implement role-based authorization ..................................................................................................................... 327

Implement policy-based authorization ................................................................................................................. 328

Additional resources ..................................................................................................................................................... 329

Store application secrets safely during development .......................................................................................... 329

viii

Contents

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!