1

Im trying to install a provider hosted app. I have registered the app on /layouts/appregnew.aspx and inserted the generated clientid and client secret web.config of my provider web and then deployed it to the provider url.

I have also created a package and added it to our appcatalog

When I try to add my new addin on /_layouts/viewlsts.aspx->Add->addin and click on my app I get the error message

The specified application identifier is invalid or does not exist.

Im guessing that SP somehow checks on the registered provider host url for the client Id and that I have done something wrong on the provider side... any idea how to diagnos this further?

1

You need to add the ClientId to web.config & AppManifest.xml.
In Web.config,

  <appSettings>
    <add key="ClientId" value="CLIENT_ID" />
    <add key="ClientSecret" value="CLIENT_SECRET" />
  </appSettings>

In AppManifest,

<AppPrincipal>
 <RemoteWebApplication ClientId="CLIENT_ID" />
</AppPrincipal>

Check this link.

0

If you are facing this issue in a SharePoint On-Premise environment, try to register the app id to the farm with PowerShell script below:

$publicCertPath = "C:\AppCerts\HighTrustSampleCert.cer"
$appId = "cbd25585-947e-4b9d-8686-ed695101ed9a"
$spurl ="https://mycompany.com/"
$spweb = Get-SPWeb $spurl
$realm = Get-SPAuthenticationRealm -ServiceContext $spweb.Site
$certificate = Get-PfxCertificate $publicCertPath
$fullAppIdentifier = $appId + '@' + $realm
New-SPTrustedSecurityTokenIssuer -Name "TheaterCompany" -Certificate $certificate -RegisteredIssuerName $fullAppIdentifier
$appPrincipal = Register-SPAppPrincipal -NameIdentifier $fullAppIdentifier -Site $spweb -DisplayName "TheaterCompany"
Set-SPAppPrincipalPermission -Site $spweb -AppPrincipal $appPrincipal -Scope Site -Right FullControl

More information from here: SharePoint 2013 Provider-hosted Apps: The specified application identifier is invalid or does not exist

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.