See this question/answer first: When calling a process from another process, Is sending stdin password more secure than sending an ENV variable?
I am a Java developer that is building an app where it needs to call a C# process from within. In my situation, the Java app is calling this C# program https://github.com/nddipiazza/SharepointOnlineCookieFetcher.
We have established that this is not secure to send the password via environment variables nor with stdin.
What is the best practice for providing the password to this app?