Duende IdentityServer Quickstart With Container Orchestration
This repo takes the quickstart examples from https://github.com/DuendeSoftware/Samples and configures them to work with Docker Container Orchestration on a local machine (Docker Desktop).
Some changes were required to the original quickstart files, but I have tried to keep these to a minimum. These were done using Visual Studion Community Edition 2022.
Please note: These changes made are the minimum effort to get the quickstarts working in docker desktop for local development and are not suitable for production. I have decorated changes with if(Environment.IdDevelopment()) where possible.
The high level overview of these changes are as follows:
- Add Contaner Orchestration Support in each project
- Replace the hard coded urls in code with values defined in appsettings configuration
- Override appsettings configuration from docker-compose.override with docker targeted values
- Set cookie options required for local development
Gotchas:
- I have created a env.js file for the JavaScriptClient to get its variables from, which I then override in docker-compose by mounting a docker target variable file (env.docker.js) in its place. However, because VS uses "FastMode" it serves files mounted directly from the filesystem to enable debugging, which means the docker variable file does not get served in the browser. To get around this run docker-compose in VS in Release mode, rather than Debug. This disabled FastMode. Alternatively just run docker compose from the command line ;-)
- The Duende quickstart examples do not seem to have Single Signon (SSO) and Single Logout (SLO) working between the WebClient and JavaScriptClient. I have not attempted to fix this as it beyond the scope of this POC. One for another day!