8-Week Microsoft Teams AppDev Accelerator Program
Limited seats available! - Start date: Wednesday, April 16, 2025
Join Today & Save $1,000
articles

Register SharePoint 2013 High-Trust Apps Using S2S Easily

I successfully set up a provider-hosted app for SharePoint 2013 on-premises with the help of an informative MSDN article.

Register SharePoint 2013 High-Trust Apps Using S2S Easily
by Andrew Connell

Last updated August 7, 2012
2 minutes read

Share this

Focus Mode

  • Feedback & questions

If you’ve tried creating a provider hosted app for SharePoint 2013 onprem (not in Office 365) you know you likely need to go through some gyrations to set it up for high trust using the server-to-server (S2S) protocol. There’s a great article on MSDN that walks you through the details of this (linked below), but it’s a pain to have to type all that. Hopefully Visual Studio 2012’s SharePoint 2013 & Office 2013 Developer Tools will make our lives easier when we get to RTM, but for now in Beta 2 / Preview, I find it to be a pain.

PrepareS2SApp.ps1 Usage

This assumes you’ve already set up your developer environment for creating apps. If not, check this MSDN article: HOWTO Set up an On-Premises Development Environment for Apps for SharePoint.

You’d ideally run this script before building your provider app. You first need a certificate… you can follow the instructions on the MSDN article linked below, specifically just the section Create a Public & Private Test Certificate. Then pick a name for your app… this must be unique to your site. Next, run the script. It will do everything in the MSDN article linked at the bottom of this post, except for the public & private certs, for you. It accepts the following arguments:

Required Parameters:

  • $AppDisplayName: Display name of the application. This must be unique.
  • $TargetSiteUrl: URL of the site collection where the app will be installed.
  • $CertPath: Fully qualified path to the *.cer certificate created prior to running this script.

Optional Parameters:

  • $AppGuid: Unique GUID for the app. This must be all lowercase. If not provided, one is automatically generated & displayed at the end of the script.
  • $AllowOAuthOverHttp: Configures the STS to allow HTTP OAuth. Default = TRUE
  • $SupressTrustedSecurityTokenIssuerDisplay: Suppress displaying the output of the New-SPTrustedSecurityTokenIssuer cmdlet.Default = TRUE
  • $SupressAppPrincipalDisplay: Suppress displaying the output of the Register-SPAppPrincipal cmdlet.Default = TRUE

If you run the script, here’s what you should see:

Running the script

Running the script

If you don’t provide a unique name for your app, you’ll get a warning message and the script will stop proceeding:

Warning message when running without unique name

Warning message when running without unique name

Andrew Connell, Microsoft MVP, Full-Stack Developer & Chief Course Artisan - Voitanos LLC.
author
Andrew Connell

Microsoft MVP, Full-Stack Developer & Chief Course Artisan - Voitanos LLC.

Andrew Connell is a full stack developer who focuses on Microsoft Azure & Microsoft 365. He’s a 20+ year recipient of Microsoft’s MVP award and has helped thousands of developers through the various courses he’s authored & taught. Whether it’s an introduction to the entire ecosystem, or a deep dive into a specific software, his resources, tools, and support help web developers become experts in the Microsoft 365 ecosystem, so they can become irreplaceable in their organization.

Feedback & Questions

newsletter

Join 10,000+ developers for news & insights

No clickbait · 100% free · Unsubscribe anytime.

Subscribe to Andrew's newsletter for insights & stay on top of the latest news in the Microsoft 365 Space!
blurry dot in brand primary color
found this article helpful?

You'll love these!

MSDN Published More of my SharePoint 2013 Code Samples

MSDN Published More of my SharePoint 2013 Code Samples

August 2, 2012

Read now

Install Windows Azure Workflow Beta 1 for SharePoint 2013

Install Windows Azure Workflow Beta 1 for SharePoint 2013

July 27, 2012

Read now

SharePoint 2013 Workflow - advanced workflow debugging with Fiddler

SharePoint 2013 Workflow - advanced workflow debugging with Fiddler

July 18, 2012

Read now

bi-weekly newsletter

Join 10,000+ Microsoft 365 full-stack web developers for news, insights & resources. 100% free.

Subscribe to Andrew's newsletter for insights & stay on top of the latest news in the Microsoft 365 ecosystem!

No clickbait · 100% free · Unsubscribe anytime.

Subscribe to Andrew's newsletter for insights & stay on top of the latest news in the Microsoft 365 Space!