The ROPC flow is an available option that allows applications to log in by directly handling the user's password without browser interaction. However, the ROPC flow does not support MFA, and hardcoding the user's password may pose certain risks. Therefore, we generally do not recommend using the ROPC flow. It should only be used when more secure flows are not feasible.
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.