Microsoft provides "public client" sample code

https://docs.microsoft.com/bs-latn-ba/azure/active-directory/develop/sample-v2-code