Hi @Animesh Hajra ,
Thanks for reaching out.
Are you trying to run the application you mentioned to get the access token. I tried to run the application as it is mentioned and able to get the access token successfully.
You are trying to access username-password application using authorization flow which require additional parameters to get the token.
For username-password flow, Micrsoft Identity platform supports ROPC flow which allows an application to sign in the user by directly handling their password. However, for security reasons, ROPC flow is not recommended.
The error you are getting is there might be trustStore is present in your JVM arguments, Java will use the truststore configured instead of the default (cacerts) to connect over SSL.
Hope this will help.
Thanks,
Shweta