While searching I found this link which uses ADAL.js for authentication. I followed each and every step given in this link and it worked also. It gives me the SharePoint Online list data.
But the only problem is it redirect me to the Login screen first and then after login is successful I am able to fetch the data from SharePoint Online list.
My question is:
Is it possible to fetch the SharePoint Online data using ADAL.js where I can pass username and password as plain text? I don't want to redirect to login screen. I need that authentication should done in background.