This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice This article is not considered official documentation for K2 software and is provided “as is” with no warranties.

Issue

An error occurs when attempting to deploy the K2 for SharePoint App.

Symptoms

The following error is displayed in the web browser:

"The specified application identifier 3308eaff-d056-4a32-9b1d-563f81bf06f9 is invalid or does not exist."

Image

Resolution

To resolve this, please open the SharePoint Management Shell and run the commands below:

$publicCertPath = "C:\certificates\K2 Oauth High Trust.cer"
$appId = "3308eaff-d056-4a32-9b1d-563f81bf06f9"
$spurl ="https://YourSharePointSiteURL.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

You will need to export the “K2 OAuth High Trust” certificate from the K2 server, and import it into "c:\certificates\" folder in the SharePoint server.

Edit the script values as follows:

  • publicCertPath = your exported cert path & name
  • SPURL = your site url
  • AppId = id from an error message

Please see another solution here.