I have a requirement that i want to retrieve SharePoint logged-in user Token or computer login credentials token so that i will be ensure that user is logged-in then i will not allow user to enter their credentials on my NodeJS application which is fetching data from SP. If i get the token or came to know that user is logged-in to SP then i can bypass the NodeJS application login window and directly allow user to access SP.

Actually I am building a NodeJS application where i am passing domain name,user name ,password and siteurl to WCF webservice via NodeJS api and that Service is fetching SP data based on SiteURL and User credentials.

When i access my NodeJS application from within SP then application is asking for user credentials even though user is logged-in on SP. So if User is logged-in on SP and he/she is accessing NodeJS application from within SP, then application should not ask for user name and password and domain name. User should directly able to see the data without signing-in.

How to achieve this?

I am also new to SharePoint. Even i do not know how to develop SP application. I did much R & D on the same but did not find any appropriate solution like Tokenhelper class, SP.JS library and SP.Userprofile.js library but did not achieve anything. It's very urgent as my manager keep asking.

Kindly help me on this.

Kindly post the working code as well. Like i am looking a solution in NodeJS or C# code to integrate in WCF service.

Thanks in advance.


I would suggest rather than passing user credentials use oauth mechanism to authenticate your service. Register an app in SharePoint, make app only policy to true and give specific permissions. Get the client id and client secret key and use it in your service to authenticate using TokenHelper.cs, you can get few articles how to authenticate an Web API in SharePoint. If you don’t find anything please let me know. I can help you with the code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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