How to fix Provider Hosted App Error – Invalid issuer or signature?

[Fixed]: Provider Hosted App Error – Invalid issuer or signature

No comments

 1,886 total views,  8 views today

Sometimes, we get the error “[SecurityTokenException: Invalid issuer or signature.]” in SharePoint online provider hosted app. In this troubleshooting technique, we will see how to fix the “SecurityTokenException: Invalid issuer or signature.” error in the SharePoint Online office 365.

Scenario

Let’s say we have a provider-hosted app running in Share Point Online which connects to Azure WebApp Service. The app might work fine for the time being and later on, it might start to fail after some time with the following error.

[SecurityTokenException: Invalid issuer or signature.]

Possible Reason for being the above error

If you deploy the app from the development environment to the production but forget to correct the Client Id and Client Secret to the values that had previously been generated for production. This means that when the user is redirected to the production azure website the client details in SharePoint Online, in this case from the development environment, will not match with the already configured keys in the associated Azure web site and the end result might be the above error.

Solution

Go to the visual studio solution and correct the Client Id/Secret in the web.config file and the publishing profile and finally deploy a new version of the app component – the issue should be resolved.

See Also

You may also like the below SharePoint troubleshooting articles: