Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

    Advertisements
  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand
  • Advertisements

Posts Tagged ‘pha’

Sign the Certificate

Posted by Paul on May 8, 2015

In this article we can see how to sign a certificate. This step is essential for doing a Provider Hosted Application in SharePoint 2013.

Pre-Requisites

You have to create an IIS Certificate. I hope you have gone through this step already.

http://www.jeanpaulva.com/index.php/2014/12/01/create-export-certificate/

Steps

Following are the steps involved:

1. Copy the Certificate

2. Sign the Certificate

Copy the Certificate

Now we have to copy the certificate and sign it.

Open the IIS > Certificates.

image

Double click on our certificate.

image

From the Details tab click on the Copy to File.. Option.

image

Select the default options and click the Next button.

image

Please note that the extension is cer.

image

Click the Finish button to complete the copy operation.

Sign the Certificate

Now we need to sign the certificate. We can do this using PowerShell ISE editor.

Open ISE Editor in Administrator mode.

image

Run the following code. (You need to change the certificate path & GUID)

Add-PSSnapin Microsoft.SharePoint.PowerShell

$certPath = “C:tempSP2013Certificate.cer”
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($certPath)
New-SPTrustedRootAuthority -Name “PHASelfSignedCertificate” -Certificate $cert

$realm = Get-SPAuthenticationRealm

$issuerId = “586bb34f-83b9-4dbe-b293-8981441bd7a8”
$issuerIdentifier = $issuerId + ‘@’ + $realm

New-SPTrustedSecurityTokenIssuer -Name “Provider hosted Self Signed Certificate” -Certificate $cert -RegisteredIssuerName $issuerIdentifier
iisreset

$config = Get-SPSecurityTokenServiceConfig
$config.AllowOAuthOverHttp = $true
$config.Update()

image

Signing process is required so that the SharePoint server can trust the second IIS Server which will host the PHA application. In real-world scenarios the certificate exporting & signing should be done with third-party vendors.

References

http://bit.ly/10uiVpB

Summary

In this article we have explored how to sign a certificate for using in PHA application.

Advertisements

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »

SHA vs. PHA

Posted by Paul on January 6, 2015

In this article we can explore when we have to choose SHA & PHA.

1. SHA – SharePoint Hosted App

2. PHA – Provider Hosted App

image

Apps Overview

As we all know, Apps are the preferred programming model for SharePoint 2013. Microsoft introduced App Model in SharePoint 2013.

Apps provide the following advantages:

1. Code outside Server

2. Discoverability

3. App Store Eco System

4. Easy Installation

5. Easy Uninstallation

Advantages of SHA

SharePoint Hosted Apps are those in which code is hosted in the SharePoint server. Since the App is containing JSOM (JavaScript Object Model) the execution happens in the client side.

Pure HTML/JavaScript based application can be built using this approach.

Advantages of PHA

Provider Hosted Apps are those in which code is hosted outside the SharePoint server. Since the App can contain both JSOM & CSOM the execution is happens in another server or in the client side.

Remote Event Receivers, Custom WCF Services, Protected Business Logic can be achieved using this approach.

Since PHA is hosted in an external server, there requires a server-to-server trust through certificates. The trust can be Low Trust or High Trust depending on your requirement. This certificate configuration would be an additional configuration overhead going with PHA.

When to choose SHA?

Following are the reasons to go with SHA:

1. If you wanted to publish in Office App Store, then go with SHA

2. If you have just HTML/JavaScript code, then go with SHA

When to choose PHA?

Following are the reasons to go with PHA:

1. If you have proprietary business logic, then go with PHA

2. If you have custom services to be created, then go with PHA

3. If you have custom event receivers, then go with PHA

4. If you wanted to integrate existing ASP.NET application, then go with PHA

5. If you have difficulty in finding JSOM resources, then go with PHA

We are not discussing CHA (Cloud Hosted App) here as it has been deprecated.

References

http://msdn.microsoft.com/library/office/dn268593.aspx

Summary

In this article we have explored SHA vs. PHA.

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »

Provider Hosted Apps

Posted by Paul on November 20, 2014

Provider Hosted App is hosted outside the SharePoint environment.  This means you will be having a SharePoint environment and an App Environment.

The App Environment can be hosted in IIS using ASP.NET.

Advantages

Following are the advantages of Provider Hosted Apps:

  1. SharePoint Server is freed from app-execution resources
  2. SharePoint Server is protected from app-crash

App Web & Remote Web

App Web is the SharePoint site created while installing an App.

Remote Web is the Provider Hosted site created to host the App.

image

C#.Net

The good thing is that we can use C#.Net as the development language.

Server Object Model

As the code is executed in a remote web where the SharePoint binaries are not available we cannot use Server Object Model.

Client Side Object Model

We can use the CSOM using C#.Net. 

Posted in SharePoint, SharePoint 2013 | Tagged: , , | Leave a Comment »