I have this provider hosted app/addin with STS, high trust scheme. My question is, how can I authenticate a user from my provider hosted against an on-premise SharePoint ?

I want this because my app will be hosted open in the internet and I want to make sure that my users are authorized in the SharePoint server.

I thought about making a call against the api asking for the current logged user but this only works client-side.

Is there any way I can achieve this server-side ?

  • All apps use the client object model. They cannot use server side. SharePoint apps have to be opened from SharePoint, since SP passes data to the app through the URL (Host url, app url--if there is an appweb, and several other tokens), that the token helper class uses to generate the user tokens/context. – wjervis Jul 17 '15 at 12:00
  • By server side I mean code running on my app back-end, not sharepoint full-trust code. Also, if I recall correctly, with a high-trust certificated based app, there is no token sent from sharepoint to the app, since the app already has a certificate to sign communication. Thus I can't rely on that to get the information about the user. – Miguel Jul 17 '15 at 14:31
  • I'm in SPO, so cannot test High Trust apps, but I know the Token Helper class has some methods regarding High Trust. This blog entry discusses High Trust apps, not sure if it's of any help. – wjervis Jul 17 '15 at 15:30

Your Answer

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

Browse other questions tagged or ask your own question.