According to your code, it seems that you are using a web application / API that uses a username and password for authentication.
we can only use the resource ownerβs stream from our own client. A confidential client, such as a website, cannot use the user's direct credentials.
( ), (- /API). , , , ADAL.NET /. Constraints & Limitations.
- , OAuth2, , . - . , - .