I have created a Custom Web API using .net C# that will be called in my sharepoint online and i was wondering if is there is anything i could use from sharepoint and use it in my WebApi to verify that this request comes from an authorized user?

Thank you!


You could use ADAL to authenticate using OAuth2.

You have to register an app on Azure Active Directory to create an endpoint for authentication, then you can use ADAL.js to get a valid token and send it on header of http calls to your Web API.

  • How would i verify the token that i get from ADAL from my web api? – Beenee Apr 16 '19 at 8:32
  • Here one possible implementation: blogs.msmvps.com/windsor/2017/03/12/… (look for GetSharePointAccessToken method) – RiccardoGDev Apr 16 '19 at 16:11
  • ive manage to do this but since there was an update im stuck at the issue regarding "AADSTS240002" same as everyone and Rob hasn't found any workaround for this yet – Beenee Apr 22 '19 at 5:01

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.