oidcproxydotnet / OidcProxy.Net

An extendible framework for .NET to implement the BFF Security Pattern (a.k.a. Token Handler Pattern) in Single Page Applications
GNU Lesser General Public License v3.0
101 stars 19 forks source link

Add documentation / templates for cloud deployment #20

Closed yuriburger closed 11 months ago

yuriburger commented 1 year ago

It would be nice to have templates (Bicep, Terraform, CloudFormation) + documentation for Kubernetes on Azure or AWS deployment. Maybe initially just a "kickstarter" for the simplest architecture and expand on this with more advanced scenarios.

oidcproxydotnet commented 1 year ago

I agree! On the documentation page (https://gocloudnative-bff.pages.dev/table-of-content/) I've listed two types of such templates:

Integration Manuals ...

  • Infrastructure
    • Distributed apps
      • Applying a BFF in an Azure Container Apps environment
      • Applying a BFF in Kubernetes ...

And also, I think, it would be helpful if these templates demonstrate how to deploy the BFF in a distributed way. It's been built with standard aspnetcore http sessions, and out-of-the-box you can use redis as session storage.

This would mean we need to add the redis package to the Host app dotnet add package Microsoft.Extensions.Caching.Redis, and add the following line to the program.cs:

// Add Distributed Redis Cache for Session
builder.Services.AddDistributedRedisCache(options =>
{
    options.Configuration = "localhost";
    options.InstanceName = "Session_";
});

(I must admit I haven't tested it yet. So if you run into something, let me know!)

Any idea what the template will look like exactly?

yuriburger commented 1 year ago

My first thoughts: Bicep for deployment in Azure Kubernetes Service. Both single and distributed scenario (so including Redis) and based on a private container registry. Let me work on an initial version so I can show you ;)

oidcproxydotnet commented 1 year ago

By the way: Did you see the samples in the demo projects? https://github.com/thecloudnativewebapp/GoCloudNative.Bff/tree/main/docs/demos/IdentityServer4/src

You can find a working SPA and a working API here.

appie2go commented 1 year ago

Any updates on this?