If this is possible, how should the TokenHelper.cs be modified to accomplish this?

Background: I have a provider-hosted SharePoint add-in that uses the TokenHelper to validate client id/secrets. Client id/secrets are generated/managed in Partner Center since I deploy to the SharePoint Store. Client id/secrets are stored in my web.config, which is how TokenHelper accesses them.

I'd like to start using Azure AD instead because it allows me to map multiple redirect urls, and its client secrets work more reliably. There have been times when client secrets generated by Partner Center just don't work, causing Production outages. I have not seen this with secrets generated with Azure AD.

1 Answer 1


I did an initial examination of this a while ago. I think it can be done but it would not be a simple process. You not only have to replace the functionality in TokenHelper.cs but you have to replace the functionality in SharePointContext.cs and in the custom attributes like SharePointContextFilterAttribute.cs and SharePointRedirectOrValidateAttribute.cs.

I didn't get far enough to do a cost benefit analysis, but it's quite possible you'd be better off doing a rewrite of the app rather than trying update it to work with Azure AD.

One important note, I did not look at how updating the app may affect deployment through the SharePoint Store. I cannot provide any guidance on this.

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.