0

I am trying to access my SharePoint online data from simple .NET application using JavaScript. Here we will require an authentication.

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.

1 Answer 1

2

Some points:

  1. It's really bad idea to store user credentials on client side (javascript) or transfer them from backed over http(s). Storing creds on client opens different potential security vulnerabilities.
  2. It's not possible to pass username\password to adal.js,because it uses OAuth implicit flow for authentication, which requires ClientId and other params.
  3. The best thing you can do is to enable authentication pop-ups instead of full page redirect. In version 1.12 they added new configuration value popUp: true. Instead of redirect, you will be prompted for credentials in pop window.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.