This is a demonstration app that accompanies this blog post on the NewOrbit Blog. It is used to demonstrate how a mock OIDC service can be used to mock authentication in local development and testing.
The demo is written in C# and Typescript. To run the system:
- Open the repo in VSCode
- Ensure that pre-requisite software is installed which can be done either by installing them locally or using DevContainers in VsCode
- Dotnet SDK v9
- Node 18
- Install recommended VSCode extensions
- Install the dotnet development certificate by running the following command
dotnet dev-certs https --trust
- Run the solution:
- Via VSCode by opening the MockOidcApp.AppHost/Program.cs file and using the Play button that appears in the top left corner
- You may need to use the ".NET: Close Solution" and ".NET: Open Solution" commands in VSCode to enable this to work
- Via Command line from the MockOidcApp.AppHost directory:
dotnet run
- Via VSCode by opening the MockOidcApp.AppHost/Program.cs file and using the Play button that appears in the top left corner
- Navigate to http://localhost:5100
- Use the Login and Logout button to observe how the demo application interacts with a Mock identity service and displays weather forecasts when logged in.
- The demo is setup to have the following credentials:
- Username:
[email protected] - Password:
Password123
- Username:
- The demo is setup to have the following credentials:
As described in the blog post there are integration tests provided, to run these:
- Open a terminal in the MockOidcApp.SpaIntegrationTests directory
- Run
npx playwright test
A sample Github action workflow is provided to run the integration tests in Github actions. Sadly you cannot test these locally using act due to an issue relating to the dev container bind mount. It may work when you try it though, you can attempt to run them using these instructions:
- Open a Terminal in the root of the Repository
- Run
act