Hello Suresh,
Thanks for reaching out.
You can leverage Microsoft identity platform and OAuth 2.0 Resource Owner Password Credentials flow to authenticate and get access_token
for respective resource by using User credential.
To know more about ROPC (Resource Owner Password Credentials ) : https://video2.skills-academy.com/en-us/azure/active-directory/develop/v2-oauth-ropc
Scenarios and supported authentication flows: https://video2.skills-academy.com/en-us/azure/active-directory/develop/authentication-flows-app-scenarios#scenarios-and-supported-authentication-flows
I would recommend you to use Microsoft Authentication Libraries (MSAL) instead ADAL library which is in deprecation cycle. Please take a look at the sample apps that use MSAL.
Hope this helps.
Adding SharePoint Dev tags into this thread to get suggestion and expertise from SharePoint perspective.
------
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.