-
Notifications
You must be signed in to change notification settings - Fork 4
SPAddinOwin.Sample.ADFS High trust
Sergei Sergeev edited this page Dec 7, 2016
·
1 revision
High trust scenario works if you are developing against SharePoint on-premise.
This wiki page describes configuration required in order to run SPAddinOwin.Sample.ADFS in high trust. This configuration steps assume you are fully configured your on-premise environment for apps and have .pfx certificate and password for apps.
- Open SharePoint app registration page,
https://sharepoint/sites/dev/_layouts/15/appregnew.aspx - Click on 'Generate' for Client id and Client Secret.
For Title enterSPAddinOwin.Sample.ADFS.
For App Domain enterlocalhost:44399if you are going to deploy using IIS Express (F5 from visual studio). If you want to deploy it on full IIS, enter domain from IIS web site you are created (or going to create).
For Redirect URI enter any url, for examplehttps://some.url
Click on "Create". - Save generated Client Id and Client Secret.
- In Visual Studio open
SPAddinOwin.SharePoint.ADFS/AppManifest.xmland set<RemoteWebApplication ClientId="<Client Id from step #3>" /> - If you are going to deploy using IIS Express with Visual Studio, leave
StartPageinsideAppManifest.xmlunchaged. If you are using full IIS and another url, updateStartPageaccordingly. - In Visual Studio, left click on
SPAddinOwin.SharePoint.ADFSproject, then in the top menu View -> Properties Window. UpdateSite URLto point to your SharePoint developer site, i.e.https://sharepoint/sites/dev - Right click on
SPAddinOwin.Sample.ADFS-> Deploy. Wait for the add-in to be deployed. After deployment your browser will be launch with the add-in trust page. Click on "Trust it" and you will be redirected to your app. For now it doesn't work, because we didn't configured web application yet, so it's ok. Now we need to update properties for corresponding web application and run it. - Inside
Web.configupdateClientIdfrom step#3,ClientSigningCertificatePath,ClientSigningCertificatePassword,IssuerIdfrom your app configuration. - You also need to specify
WtrealmandMetadataAddressaddress parameters.MetadataAddressis your ADFS server metadata url, for examplehttps://adfs3/federationmetadata/2007-06/federationmetadata.xml.Wtrealmis you authentication realm for SharePoint. You can get it by opening relying party on ADFS server or runningGet-SPTrustedIdentityTokenIssuercmdlet on SharePoint server and copyDefaultProviderRealmvalue. - Right click on
Web/SPAddinOwin.Sample.ADFS-> Set as Start up project. - Inside Visual Studio Press F5 (or deploy to IIS and run from there)
- You will get an exception
Unable to determine host url. That's ok, since we are not in SharePoint context. For you project you can add more meaningful exception UI. - On SharePoint site,
https://sharepoint/sites/devgo to All site contents and click on your app. - Your app should be loaded.
- SPAddinOwin.Sample.QueryString
- SPAddinOwin.Sample.UrlPath
- SPAddinOwin.Sample.ADFS
- SPAddin.Core.UrlPath