Hello @ABHISHEK KUMAR , to authenticate to Azure AD without using the login UI you need to implement the OAuth 2.0 Resource Owner Password Credentials flow. Microsoft recommends you do not use the ROPC flow. In most scenarios, more secure alternatives are available and recommended. This flow requires a very high degree of trust in the application, and carries risks that are not present in other flows. You should only use this flow when other more secure flows aren't viable.
Let us know if you need additional assistance. If the answer was helpful, please accept it and rate it so that others facing a similar issue can easily find a solution.