The specified application identifier cbd25585-947e-4b9d-8686-ed695101ed9a is invalid or does not exist.
Resolution1: Run all of the below commands in SharePoint 2013 management shell:-
$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
Note: Before running the above commands,replace the $appId with the ID reported in the error message. Also modify other variables like $spurl etc. as per your environment.
Resolution2 (Recommended): To get away with the above error message. Create a ClientID and ClientSecret using "_layouts/15/appregnew.aspx" page. Basically, you need to register your app on the target SharePoint farm where you intend to deploy your app. And then use those generated ClientID and ClientSecret while packaging your app in your dev environment.
Good one Srinivas. Thanks for sharing.
ReplyDelete