03/06/2024
Download Example zip (1.7mb)

The attached example is a .net core 8 web api which uses the usual good stuff as we'd expect in an API. (swagger documentation, basic auth, AES string encryption/ decryption, docker, log4net logging, )

Note that the authentication credentials/keys are stored the appsettings.json .. we should always store sensitive data such as auth keys, usernames, passwords etc in a key vault external to the api... But as this is just a demo system (and to keep the code small), i stuck them in config .. please remove them if you intend to use this project.

This example shows how to can take your own string values and combine them into an encrypted token you can send to users, which you can read again later when they submit it back. e.g. for user IDs, maybe data they submitted to you on the first request, etc. Stateless APIs.