Sharepoint Idle timeout on page with Provider hosted app
We have a Sharepoint idle timeout implemented using javascript which triggers on every page load initializes and timer counts to say 60sec as configured when idle .On reaching the time the script triggers a window.href to the ADFS logout page.This is fine.
Issue comes when user is working on a provider hosted app in a sharepoint page.Since any postback inside the app(iframe) does not reload sharepoint page the js timer reaches the value and logs
out.
How can this be achieved.any inputs.
https://social.technet.microsoft.com/Forums/lync/en-US/85f52c85-f2e3-4930-894e-2d7a198a39de/redirecting-user-from-app-part-to-a-list-in-host-web?forum=sharepointdevelopment
Please mark as answer if you find it useful else vote for it if it is close to answer..happy sharepointing
Similar Messages
-
Error with Provider Hosted App on Edit Form of a list item
We have an error on the Edit Form of one of our pages.
We have developed a SharePoint Online Provider Hosted app which replaces the standard edit form of a list item and has some further events behind the save button. Since this is rather new territory for us, we're using a roundabout way of achieving this by
using a script editor web part to display an iFrame of our app. That way we can pass the Url through to our app and retrieve query strings from them.
Our issue comes quite intermittently in that we sometimes get a "web page cannot be found" error or sometimes a "resource cannot be found" error, however, when we load another app on the site (from the same app project, but using an app
part), then go back to the Edit Form, the information in the iFrame suddenly renders.
Any ideas on what might be causing this issue at all? Ideally, we should be rendering the app to the Edit Form is the proper manner, rather than scripting an iFrame that points to out app in Azure. Would this be the cause of the problem?
Thanks
TomHi thumper, if you have access to InfoPath, you can add the form to a page using the InfoPath web part. Otherwise, use SP Designer with instructions below:
http://sharepoint.stackexchange.com/questions/70287/display-new-form-of-a-list-in-a-web-part-page
cameron rautmann -
Hello all,
Could you possibly help me with provider-hosted app development/deployment process.
We developed SharePoint provider-hosted app that works just fine in development environment. Now we need to automate it's installation in test environment via powershell.
In AppManifest.xml that we are deploying we have key instead of explicit URL:
<App xmlns="http://schemas.microsoft.com/sharepoint/2012/app/manifest" Name="ShowAllRoomsApp" ProductID="{922a18aa-5592-b59a-4da9-4791baef02e7}" Version="1.0.0.0"
SharePointMinVersion="15.0.0.0">
<Properties>
<Title>SomeTitle</Title>
<StartPage>~remoteAppUrl/Pages/Default.aspx?{StandardTokens}</StartPage>
If we use as
https://technet.microsoft.com/en-us/library/jj655398.aspx recommends, we cannot specify Redirect Url as we can do this on
/_layouts/appinv.aspx
So now it seems like the only way to deploy this kind of solution is using appinv.aspx page.Or must we apply this URL in AppManifest on developing stage in Visual Studio?
What did I miss?
P. S. Even if I use /_layouts/appinv.aspx after powershell commandlets, I get error.hi,
to deploy provider hosted app you need 2 things
1. Client ID
2. Redirect URL.
What you can do you can generate app from visual studio using clientID and URL from developer enviornment.
Now a app file is just a simple compressed zip file if you rename it as .zip and extract you will find AppManifest
inside it. So to create an app for Testing enviornment what you have to to Get the CLient ID (from AppRegNew.aspx) in testing enviornment. Unzip .App file change the AppManifest with testing client ID and URL than again zip file and rename as .app.
Now if you upload this file it will work.
To automate this scenerio i have created a simple windows Application in which i Pass the Client ID and StartURl and an App File it unzips the app file make changes to app and again zip it.
public static class AppPackageHelper
public const string StartUrlExpression = "{0}?{1}";
public const string StandardToken = "{StandardTokens}";
public static string Publish(string appPath, string ClientId,string StartUrl)
string tempDir = string.Empty;
string outPutFile = string.Empty;
try
string parentDir = System.IO.Path.GetDirectoryName(appPath);
outPutFile = System.IO.Path.Combine(parentDir, ClientId + "-Winshuttle.app");
tempDir = System.IO.Path.Combine(parentDir, ClientId.ToString());
Directory.CreateDirectory(tempDir);
int lastInd = appPath.LastIndexOf('.');
string tempPath = string.Empty;
string targetFilePath = string.Empty;
string cabPath = System.IO.Path.Combine(tempDir, System.IO.Path.GetFileNameWithoutExtension(appPath) + ".cab");
FileInfo fInfo = new FileInfo(appPath) { IsReadOnly = false };
File.Copy(appPath, cabPath);
XDocument doc = null;
string appManifest = string.Empty;
using (ZipArchive zipArch = ZipFile.Open(cabPath, ZipArchiveMode.Update))
appManifest = string.Format(@"{0}\AppManifest.xml", Directory.GetParent(cabPath).FullName);
ZipArchiveEntry manifestEntry = zipArch.Entries.LastOrDefault(e => e.Name.ToLower() == "appmanifest.xml");
manifestEntry.ExtractToFile(appManifest);
doc = XDocument.Load(appManifest);
XNamespace ns = doc.Root.GetDefaultNamespace();
string defaultUrl = string.Format(StartUrlExpression, StartUrl.TrimEnd('/'), StandardToken);
doc.Descendants(XName.Get("StartPage", ns.NamespaceName)).First().Value = defaultUrl;
doc.Descendants(XName.Get("RemoteWebApplication", ns.NamespaceName)).First().Attribute(XName.Get("ClientId")).Value = setupInfo.ClientId.ToString();
doc.Save(appManifest);
if (manifestEntry != null)
manifestEntry.Delete();
zipArch.CreateEntryFromFile(appManifest, "AppManifest.xml");
int totEnt = zipArch.Entries.Count;
for (int e = 0; e < totEnt; e++)
if (zipArch.Entries[e].Open().Length == 0)
//if (zipArch.Entries.Count > totEnt && e >= totEnt) break;
//zipArch.CreateEntry(zipArch.Entries[e].FullName);
File.Delete(appManifest);
if (File.Exists(outPutFile))
File.Delete(outPutFile);
File.Move(cabPath, outPutFile);
return outPutFile;
catch
throw;
finally
if (System.IO.Directory.Exists(tempDir))
System.IO.Directory.Delete(tempDir, true);
return outPutFile;
using System.IO.Compression.FileSystem.dll.
Also if you want to do it using powershell You need to do the same thing unzip-> changes values-> zip
So basic thing is You need to ahve only valid AppManifest file which contains 2 valid values Client Id and StartUrl
if you changes it inside appmanifest manuall than it will also work. Using above code you can create a console Application to do it. You can use powershell it just that i dont know how to zip unzip in powershell but i am pretty sure you can easily find it
on searching.
Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer -
Unable to deploy the provider hosted app on sharepoint server !!!
Hello,
I have simply created the provider hosted app by assigning the issuer ID !
Now, the SharePoint version of the app project is set as SharePoint Online.
However, when I deploy this project to SharePoint site, it shows following error :
Unknown SharePoint version: 16.0
In order to resolve this I changed the SharePoint version as SharePoint 2013
of the app project.
Though , I am getting following error on deployment:
The target version of the SharePoint site is 15.0.4569.1000, which is lower than the minimum supported SharePoint version of the app. To fix this, go to the SharePoint tab on the app for SharePoint project’s properties page, and change the Target
SharePoint Version property to the version of the SharePoint site or lower.
Would you please let me know how can I resolve this deployment error ?
Note : I am using MVC web Application template for web project
Thank you in advance.
Kind Regards,
Dipti ChhatrapatiNot sure, but this is straight.
Project type - apps for sharepoint --> Enter URL --> select type as provider hosted app --> MVC --> Authentication Option.
Now when publishing the project - SP App to SharePoint/Office Store and web portion to any web server ( i generally do it in Azure).
Thanks, Ashish | Please mark a post helpful/answer if it is helpful or answer your query. -
Hi Team,
I am using the sharepoint office 365 to build the provider hosted app.
Please find the below code to access the data from sharepoint
var siteUri1 = new Uri("https://site.sharepoint.com/sites/site1/");
var realm = TokenHelper.GetRealmFromTargetUrl(siteUri1);
var accessToken1 = TokenHelper.GetAppOnlyAccessToken(TokenHelper.SharePointPrincipal, siteUri1.Authority, realm).AccessToken;
using (var clientContext = TokenHelper.GetClientContextWithAccessToken(siteUri1.ToString(), accessToken1))
Web web = clientContext.Web;
clientContext.Load(web.Webs);
clientContext.ExecuteQuery();
var webdetails = web;
clientContext.ExecuteQuery(); this line gives the below error
An exception of type 'Microsoft.SharePoint.Client.ServerUnauthorizedAccessException' occurred in Microsoft.SharePoint.Client.Runtime.dll but was not handled in user code
Additional information: Access denied. You do not have permission to perform this action or access this resource.
Please help me on this.Thanks for your reply
I already included AllowAppOnlyPolicy="true" in the
AppManifest.xml file.
Below line always gives the null value.
string contextTokenString = TokenHelper.GetContextTokenFromRequest(Request);Please help me on this. I am new the the apps. -
Provider hosted App Error: You do not have permission...
Hi everyone,
i'm using SharePoint online. I opened a provider hosted app and when I run this I get this error:
"Access denied. You do not have permission to perform this action or access this resource."
when I did debug I notice that it fall in this line:
webRequestEventArgs.WebRequestExecutor.RequestHeaders["Authorization"]
and "webRequestEventArgs.WebRequestExecutor.RequestHeaders"
is empty.
what can I do?
thank you!i'm trying to add an item ti my list:
protected void Page_Load(object sender, EventArgs e)
//constant string SharePoint principal
string SharePointPrincipal = "00000003-0000-0ff1-ce00-000000000000";
var contextToken = TokenHelper.GetContextTokenFromRequest(Page.Request);
Uri hostWeb = new Uri(Page.Request["SPHostUrl"]);
string realm = TokenHelper.GetRealmFromTargetUrl(hostWeb);
string appOnlyAccessToken = TokenHelper.GetAppOnlyAccessToken(SharePointPrincipal, hostWeb.Authority, realm).AccessToken;
using (ClientContext clientContext = TokenHelper.GetClientContextWithAccessToken(hostWeb.ToString(), appOnlyAccessToken))
if (clientContext != null)
//ShariqTest is a custom List in my SharePoint site
var myList = clientContext.Web.Lists.GetByTitle("ListName");
ListItemCreationInformation listItemCreate = new ListItemCreationInformation();
Microsoft.SharePoint.Client.ListItem newItem = myList.AddItem(listItemCreate);
newItem["ColumnName"] = "Testing ";
newItem.Update();
clientContext.ExecuteQuery();
"[and the webRequestEventArgs.WebRequestExecutor.RequestHeaders["Authorization
is in TokenHelper.cs.
what do you think my problem is? -
Provider Hosted App - Client Secret Expired
We are using SharePoint Online with Provider Hosted app creates in ASP.NET. This portal gone live in December last year and was working fine till yesterday until we started facing the issues exactly after one year of portal going live. With this we have
realized this has something to do with the ClientSecret token expiration issue because we have been getting the "JWT token invalid" issue. Further to this we have started following the below article and was able to generate the new ClientSecret and
the same has been updated in Web.config file as well but still getting the same "JWT Token Invalid" error along with "Invalid Issuer or Signature" issue.
http://msdn.microsoft.com/en-us/library/office/dn726681(v=office.15).aspx
While above document suggest a method before ClientSecret being expired, but in our case we are trying to fight with the issue where our secret has been already expired. We have also waited for 12 hours after generating the fresh secret but nothing helps.
Has anyone else experienced such situation, could someone please help me with this ?Thanks for replying John,
This is SharePoint Online (E3 Plan) and the I issue has been resolved already. I have shared the resolution and finding for the same in "Apps for Office and SharePoint" forum at the URL below.
https://social.msdn.microsoft.com/Forums/en-US/e5e5213a-68b3-4a1f-8809-7555a66b5782/provider-hosted-app-clientsecret-expired?forum=appsforsharepoint
Thanks Again
Ajay Sawant -
We have SharePoint 2013 site configured with SSL and we have developed a provider hosted app which interacts with SharePoint list.
If we try accessing the Provider hosted app from the SharePoint site with HTTP [http://mysharepointsite.com/] there are no any errors thrown.
But whenever the same Provider hosted app is tried accessing from the same SharePoint site using https address
[https://mysharepointsite.com/] we are getting below error:
The remote certificate is invalid according to the validation procedure.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[AuthenticationException: The remote certificate is invalid according to the validation procedure.]
System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception) +2983172
System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) +473
System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) +86
System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) +262
System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) +473
System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) +86
System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) +262
System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) +473
System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) +86
System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) +262
System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) +473
System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest) +8530566
System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult) +230
System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) +645
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) +9
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) +87
System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result) +1467
System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size) +84
System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size) +22
System.Net.ConnectStream.WriteHeaders(Boolean async) +761
[WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.]
System.Net.HttpWebRequest.GetResponse() +8534156
Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute() +58
Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb) +975
ProviderHostedHTTPSWeb.Default.Page_Load(Object sender, EventArgs e) +348
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178
We have already added the certificate used for the SharePoint site and the provider hosted app in the SharePoint central admin trusts.
Any idea's how can I resolve this issue?Hi,
According to your post, my understanding is that you failed to access provider host app using https.
The reason for this is that SharePoint implements its own certificate validation policy to override .NET certificate validation.
Fix is to setup a trust between SharePoint and the server requiring certificate validation.
For more information, you can refer to:
http://blogs.technet.com/b/sharepointdevelopersupport/archive/2013/06/13/could-not-establish-trust-relationship-for-ssl-tls-secure-channel.aspx
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
SharePoint Provider Hosted App that can update existing SharePoint Task List
Note: I am unable to take advantage of the Microsoft.SharePoint library directly. Adding a reference results in a 32bit/64bit library mismatch error.
I have to find a solution that uses only the Microsoft.SharePoint.Client extension.
I am looking for example code where provider-hosted SharePoint App loads a SharePoint Task List View that allows users to interact with the tasks.
So far I have only been able to programmatically create and then load the SharePoint tasks list, create and populate a DataTable object and set the datasource of a GridView object to that DataTable.
I am unable to trigger my method linked to my checkbox within the gridview.
Ideally I would like to just customize a Task View that already has this functionality.
Here is my default.aspx.cs code-behind file:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using SP = Microsoft.SharePoint.Client;
namespace SPAppBasicWeb
public partial class Default : System.Web.UI.Page
protected void Page_PreInit(object sender, EventArgs e)
Uri redirectUrl;
switch (SharePointContextProvider.CheckRedirectionStatus(Context, out redirectUrl))
case RedirectionStatus.Ok:
return;
case RedirectionStatus.ShouldRedirect:
Response.Redirect(redirectUrl.AbsoluteUri, endResponse: true);
break;
case RedirectionStatus.CanNotRedirect:
Response.Write("An error occurred while processing your request.");
Response.End();
break;
protected void Page_Load(object sender, EventArgs e)
// The following code gets the client context and Title property by using TokenHelper.
// To access other properties, the app may need to request permissions on the host web.
var spContext = SharePointContextProvider.Current.GetSharePointContext(Context);
using (var clientContext = spContext.CreateUserClientContextForSPHost())
//clientContext.Load(clientContext.Web, web => web.Title);
//clientContext.ExecuteQuery();
//Response.Write(clientContext.Web.Title);
SP.ClientContext cc = new SP.ClientContext("http://server/sites/devapps");
SP.Web web = cc.Web;
SP.List list = web.Lists.GetByTitle("General Tasks");
SP.CamlQuery caml = new SP.CamlQuery();
Microsoft.SharePoint.Client.ListItemCollection items = list.GetItems(caml);
cc.Load<Microsoft.SharePoint.Client.List>(list);
cc.Load<Microsoft.SharePoint.Client.ListItemCollection>(items);
//try
//const int ColWidth = 40;
cc.ExecuteQuery();
DataTable dt = new DataTable();
dt.Columns.Add("Task Name", typeof(string));
dt.Columns.Add("ID", typeof(int));
foreach (Microsoft.SharePoint.Client.ListItem liTask in items)
DataRow dr = dt.NewRow();
dr["Task Name"] = liTask["Title"];
dr["ID"] = liTask["ID"];
//dr["chkTask"] = liTask["Checkmark"];
dt.Rows.Add(dr);
GridView1.DataSource = dt;
GridView1.DataBind();
protected void chkTask_CheckedChanged(object sender, EventArgs e)
//add code here to update Task Item by ID
Response.Write("checkbox event triggered");
Here is my simple default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SPAppBasicWeb.Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="chkTask" runat="server" OnCheckedChanged="chkTask_CheckedChanged" AutoPostBack="true" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>
http://www.net4geeks.com Who said I was a geek?Hi,
Please try to modify your code as below:
using (var clientContext = spContext.CreateUserClientContextForSPHost())
SP.Web web = clientContext.Web;
SP.List list = web.Lists.GetByTitle("General Tasks");
SP.CamlQuery caml = new SP.CamlQuery();
Microsoft.SharePoint.Client.ListItemCollection items = list.GetItems(caml);
clientContext.Load(items);
clientContext.ExecuteQuery();
If the code still not works, I suggest you debug the code or following the blog below to create a Provider-Hosted App for SharePoint and read list items from SharePoint list.
http://blogs.msdn.com/b/steve_fox/archive/2013/02/22/building-your-first-provider-hosted-app-for-sharepoint-part-2.aspx
Best Regards
Dennis Guo
TechNet Community Support -
Report Viewer control in sharepoint 2013 provider hosted app
sharepointSite/_vti_bin/ReportServer
We are migrating sp 2010 site to SP 2013 provider hosted app. we are using Report viewer control (version 10.0.0) in .net application app server, And the reporting service is configured in sharepoint site and report is uploaded in the document
library. We are using claims based authentication
ReportViewer1.ServerReport.ReportServerUrl =
newUri("sharepointSite/_vti_bin/ReportServer");
ReportViewer1.ServerReport.ReportPath = @"sharepointSite/_vti_bin/ReportServer?sharepointSite/Reports/Report1.rdl";
and am getting an error
ReportServerException: For more information about this error navigate to the report server on the local server machine, or enable remote errors]
[ReportServerException: The user does not exist or is not unique.]
[ReportServerException: Report Server has encountered a SharePoint error. (rsSharePointError)]
Microsoft.Reporting.WebForms.ServerReportSoapProxy.OnSoapException(SoapException e) +82
Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.ProxyMethodInvocation.Execute(RSExecutionConnection connection, ProxyMethod`1 initialMethod,
ProxyMethod`1 retryMethod) +770
Microsoft.Reporting.WebForms.ServerReport.EnsureExecutionSession() +105
Microsoft.Reporting.WebForms.ServerReport.SetParameters(IEnumerable`1 parameters) +163
BP.SDC.eXPP.UIAppsWeb.UserControls.Baseline.ProgressDashboard.RefreshDashboardReport(Int32 userRoadMapDisciplineId, String roadmapSection)
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804
Can you please help me to solve this issueHi,
According to your post, my understanding is that you had issues about the provider hosted app.
Per the error, the issue may be related to the permission issue.
For a better troubleshooting, we can check with the following steps.
To norrow down the issue, please create a new and clean app to test whether it has the same issue.
You can check the ULS log to see if anything unexpected occurred when you deploy the app and open the site page.
For SharePoint 2013, by default, ULS log is at
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\LOGS
You can check the ULS log by the methods here:
http://blogs.msdn.com/b/opal/archive/2009/12/22/uls-viewer-for-sharepoint-2010-troubleshooting.aspx
http://msdn.microsoft.com/en-us/library/gg193966(v=office.14).aspx
Thanks,
Jason
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Jason Guo
TechNet Community Support -
SharePoint remote provider hosted apps - confusion around key questions
For some time, I have been trying to get a provider hosted app setup to work, and I am afraid that I - as a relative novice - must have missed some key points despite hours of googling and reading. Here's my questions:
A remote, provider hosted app, would have its AppWeb in a domain that is different from the host SharePoint Farm in which it is gets installed and used. In other words, the AppWeb may be located at remote.contoso-apps.com, where as the SharePoint farm uses
for instance spslocal.mycorp.com. However, when you - in the SharePoint host farm - set up your App Domain/App isolation - you can only provide one value - which in this case would then need to be remote.contoso-apps.com??? Does that mean that each SharePoint
Farm can only contain Apps from one vendor delivering remote apps? Or is the key in hard coding the app web in the manifest? (However, even if I've tried this it seems like the token SPAppWebUrl still translates into the pattern defined in the App Isolation
Settings in the host farm???).
Back to the AppWeb: Many bloggers have mentioned that you have to add some kind of SharePoint element to your App project (not the Web Project part) to get the AppWeb provisioned from Visual Studio 2013. But at what stage are these SharePoint elements actually
provisioned - during some kind of publish operation of the Web Project part (the Pages, Scripts etc.) or when you install the app package (hardly the latter, since the first installation may be when a customer installs the app???). The reason I ask is (of
course) that my SharePoint Elements do not seem to get provisioned. And just to test my very basic understanding: the AppWeb can be any pure IIS web site from the start - i.e., not a SharePoint Web App?
Thanks for any help on these challenging issues!Paul,
thanks for your effort, but unfortunately the answers do not get me much further.
Question 1: You write "You can only use one domain, because cross-domain IFrame requests are blocked in SharePoint 2013". This is contrary to numerous other articles that explain how the SharePoint cross-domain library (SP.RequestExecutor.js) can be
used to communicate across domains. From the outset, the whole idea about an AppWeb is - according to Microsoft documentation - that the AppWeb should be isolated from the HostWeb and therefore in a separate domain.
This article,
http://msdn.microsoft.com/en-us/library/office/jj612823(v=office.15).aspx, even talks about scenarios where the SharePoint Host Web and App Web are in different security zones!
So according to a load of other documentation it is indeeed a valid scenario I am addressing, but I still miss the key answers to the questions above. I suspect that the key is to hardcode certain URIs in your app that points to the cloud AppWeb
(so the single App Domain specified in the Host Farm is not used at all), but I have failed to find the necessary documentation on this.
Question 2: The article mentioned does not talk about the issues that I have asked about, specifically when the SharePoint elements in the App are created.
Anyone with experience in this area? Thanks! -
SharePoint Provider Hosted App: mixed content issue
We have a provider hosted app that needs the SharePoint javascript and CSS files, so in our MVC view we added the following code:
<script src="@Request.QueryString["SPHostUrl"]/_layouts/15/SP.RequestExecutor.js" type="text/javascript"></script><script src="@Request.QueryString["SPHostUrl"]/_layouts/15/sp.js" type="text/javascript"></script>
The provider hosted app runs in HTTPS, our SharePoint environment in HTTP.
The app wants to get those SharePoint javascript and CSS files, but blocked because you try to access files from HTTPS to HTTP.
Example of the error in IE:
SEC7111: HTTPS security is compromised by http://ap/project/blabla/_layouts/15/sp.ui.controls.js
Example of an error in Chrome:
[blocked] The page at 'https://ap:2281/Appname/?SPHostUrl=…' was loaded over HTTPS, but ran insecure content from 'http://ap/project/blabla/_layouts/15/sp.ui.controls.js': this content should also be loaded over HTTPS.
How can we solve this issue without setting our SharePoint environment also to HTTPS?Hi,
We can use the following method to solve this issue.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StyleConsumer.aspx.cs" Inherits="StylesheetAppWeb.StyleConsumer" %>
<!DOCTYPE html>
<html>
<head>
<title>App using stylesheet</title>
</head>
<body>
<!-- The main page title -->
<h1 class="ms-core-pageTitle">Stylesheet app</h1>
<!-- Some subtitle -->
<h1 class="ms-accentText">For people</h1>
<!-- Subtitle comments -->
<h2 class="ms-accentText">who care about the style in their apps</h2>
<p></p>
<div>
<h2 class="ms-webpart-titleText">Get started with style in your app... </h2>
<a class="ms-commandLink" href="#">some command</a>
<br />
This sample shows you how to use some of the classes defined in the SharePoint website's style sheet.
</div>
<!-- Script to load SharePoint resources
and load the blank.html page in
the invisible iframe
-->
<script type="text/javascript">
"use strict";
var appweburl;
(function () {
var ctag;
// Get the URI decoded app web URL.
appweburl =
decodeURIComponent(
getQueryStringParameter("SPAppWebUrl")
// Get the ctag from the SPClientTag token.
ctag =
decodeURIComponent(
getQueryStringParameter("SPClientTag")
// The resource files are in a URL in the form:
// web_url/_layouts/15/Resource.ashx
var scriptbase = appweburl + "/_layouts/15/";
// Dynamically create the invisible iframe.
var blankiframe;
var blankurl;
var body;
blankurl = appweburl + "/Pages/blank.html";
blankiframe = document.createElement("iframe");
blankiframe.setAttribute("src", blankurl);
blankiframe.setAttribute("style", "display: none");
body = document.getElementsByTagName("body");
body[0].appendChild(blankiframe);
// Dynamically create the link element.
var dclink;
var head;
dclink = document.createElement("link");
dclink.setAttribute("rel", "stylesheet");
dclink.setAttribute("href", scriptbase + "defaultcss.ashx?ctag=" + ctag);
head = document.getElementsByTagName("head");
head[0].appendChild(dclink);
// Function to retrieve a query string value.
// For production purposes you may want to use
// a library to handle the query string.
function getQueryStringParameter(paramToRetrieve) {
var params;
var strParams;
params = document.URL.split("?")[1].split("&");
strParams = "";
for (var i = 0; i < params.length; i = i + 1) {
var singleParam = params[i].split("=");
if (singleParam[0] == paramToRetrieve)
return singleParam[1];
</script>
</body>
</html>
More information is here:
http://msdn.microsoft.com/en-us/library/office/fp179898(v=office.15).aspx
Other materials:
http://sharepoint.stackexchange.com/questions/58731/how-do-i-inherit-the-css-theme-color-in-my-sharepoint-2013-app
http://social.msdn.microsoft.com/Forums/en-US/7d1028fe-e8c6-4d48-8e69-30eef3757522/auto-hosted-app-client-webpart-server-side-code-is-not-working?forum=appsforsharepoint
Best Regards
Dennis Guo
TechNet Community Support -
How to get sharepoint online (office 365) data in cloud/windows azure (provider) hosted app using Javascript?
I wish to retrieve sharepoint online data in html page (hosted in windows azure) using javascript and then need to play with AngularJSHi,
According to your description, you might want to get data from Office 365 SharePoint Online(also known as host web) and pass to the Provider Hosted App which is hosted
in Windows Azure site.
I would suggest you take a look at the links below about accessing data from the host web
for a quick start:
https://msdn.microsoft.com/en-us/library/office/fp179927(v=office.15).aspx#SP15Accessdatafromremoteapp_Codeexample
http://dannyjessee.com/blog/index.php/2014/07/accessing-sharepoint-data-from-provider-hosted-apps-use-the-right-context/
Aother sample solution for your reference:
https://code.msdn.microsoft.com/SharePoint-2013-Get-the-0ec36bb6
Best regards
Patrick Liang
TechNet Community Support -
Error occurred in deployment step 'Install app for SharePoint, ULS log as below:
0x0BA8 SharePoint Foundation App Deployment acjjg Medium The current user has System.Threading.Thread.CurrentPrincipal.Identity.Name
= 0#.w|perf\abraham.lincoln, System.Security.Principal.WindowsIdentity.GetCurrent().Name = NT AUTHORITY\IUSR, System.Web.HttpContext.Current.User.Identity.Name = 0#.w|perf\abraham.lincoln. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.39 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ag8d6 Medium SPApp: CreateAppUsingPackageMetadata: isCabStream is false. Treating the stream as a ZIP. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.39 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ahkn9 High Deleting App with fingerprint TJQrYuD5N+kEe38LZtl6wSs3Ak3yYvWcmwuNLTqtpdFzb4qSMopN3SWCRdWvntrKoM7qIS2S2llpA5omi8iHqQ==
on site 264dc389-d394-4985-a43c-ad91a383c0df dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.39 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ahkob High The App with fingerprint TJQrYuD5N+kEe38LZtl6wSs3Ak3yYvWcmwuNLTqtpdFzb4qSMopN3SWCRdWvntrKoM7qIS2S2llpA5omi8iHqQ==
on site 264dc389-d394-4985-a43c-ad91a383c0df was to be deleted, but it did not exist dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment abnqa Medium App Packaging: CreatePackage: There are 10 parts in the package. There are 1 package-part relationships
in the package. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment afyz6 Medium SPAppResources: ParseResources: No default resource file was found. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment afyzx Medium SPAppResources: ParseResources: no resource file relationships were found. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment aebgs Medium SPPackageUtility: ExtractPart: Creating directory 'C:\Users\abraham.lincoln.PERF\AppData\Local\Temp\71345ca6-3565-43d8-9017-2d3336965d8f\extract' dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment aebgt Medium SPPackageUtility: ExtractPart: Creating file 'C:\Users\abraham.lincoln.PERF\AppData\Local\Temp\71345ca6-3565-43d8-9017-2d3336965d8f\extract\AppManifest.xml' dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ajddw Medium SPPackageUtility: ExtractPart: Part stream length is '1072'. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ajddz Medium SPPackageUtility: ExtractPart: Length is '1072', not locking before copying the stream. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment aebgt Medium SPPackageUtility: ExtractPart: Creating file 'C:\Users\abraham.lincoln.PERF\AppData\Local\Temp\71345ca6-3565-43d8-9017-2d3336965d8f\extract\AppIcon.png' dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ajddw Medium SPPackageUtility: ExtractPart: Part stream length is '3540'. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ajddz Medium SPPackageUtility: ExtractPart: Length is '3540', not locking before copying the stream. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.41 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment aidi7 Medium SPIconAppPartValidator: IsSupportedFormat: image raw format is 'b96b3caf-0728-11d3-9d7b-0000f81ef32e'. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment afyz6 Medium SPAppResources: ParseResources: No default resource file was found. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment afyzx Medium SPAppResources: ParseResources: no resource file relationships were found. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment aebgt Medium SPPackageUtility: ExtractPart: Creating file 'C:\Users\abraham.lincoln.PERF\AppData\Local\Temp\71345ca6-3565-43d8-9017-2d3336965d8f\extract\featurecc1deab7-efdf-4cc2-80ae-60e073577d64.xml' dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ajddw Medium SPPackageUtility: ExtractPart: Part stream length is '321'. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ajddz Medium SPPackageUtility: ExtractPart: Length is '321', not locking before copying the stream. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment aebgt Medium SPPackageUtility: ExtractPart: Creating file 'C:\Users\abraham.lincoln.PERF\AppData\Local\Temp\71345ca6-3565-43d8-9017-2d3336965d8f\extract\elements4d87f314-4b0a-4b89-8a7e-9cb73c99f25f.xml' dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ajddw Medium SPPackageUtility: ExtractPart: Part stream length is '849'. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ajddz Medium SPPackageUtility: ExtractPart: Length is '849', not locking before copying the stream. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment aerhy Medium App Packaging - List of App Parts (count ='2'): Name='SPIconAppPart',Name='SPFeatureAppPart', dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment aerhz Medium App Packaging - List of Deployment Groups (count ='3'): Name='SPIconDeploymentGroup',Name='SPTargetWebDeploymentGroup',Name='SPQuickLaunchDeploymentGroup', dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.42 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment mq71 Medium Creating App with fingerprint TJQrYuD5N+kEe38LZtl6wSs3Ak3yYvWcmwuNLTqtpdFzb4qSMopN3SWCRdWvntrKoM7qIS2S2llpA5omi8iHqQ==
to site 264dc389-d394-4985-a43c-ad91a383c0df. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.44 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment afpd2 Medium Committing package with fingerprint TJQrYuD5N+kEe38LZtl6wSs3Ak3yYvWcmwuNLTqtpdFzb4qSMopN3SWCRdWvntrKoM7qIS2S2llpA5omi8iHqQ==
and data length 8010 to site 264dc389-d394-4985-a43c-ad91a383c0df. dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.46 w3wp.exe (0x2170) 0x0BA8 SharePoint Foundation
App Deployment ajk9e Medium Writing 8010 bytes to database for app with fingerprint TJQrYuD5N+kEe38LZtl6wSs3Ak3yYvWcmwuNLTqtpdFzb4qSMopN3SWCRdWvntrKoM7qIS2S2llpA5omi8iHqQ== dcf1d59c-94c5-5071-47bf-07cd3f2ead95
12/14/2014 23:54:27.50 w3wp.exe (0x2170)Hi Jerry,
I agree with Nikhil, I think you have posted partial ULS log, we could not find effective errors for the issue.
For Provider Hosted app in SharePoint server on-premise,
the TokenHelper class will try to access your Azure Security Principle by default.
Did you have a valid Azure account?
If not, the issue may be caused that you don't have a valid account, to resolve this issue, you can use
a valid Azure account or not going to use Azure Platform for hosting the app as the article
below.
http://pratapreddypilaka.blogspot.jp/2012/12/sharepoint-2013-avoiding-azure-on-dev.html
Thanks,
Jason
Jason Guo
TechNet Community Support -
Hi,
I am creating provider hosted app in visual studio 2012 using app scoped external content type having OData with Northwind url
App manifest start page url :
ODataNewAppWeb/Pages/Default.aspx
In XML it is:
<StartPage>~remoteAppUrl/Pages/Default.aspx</StartPage>
When i am deploying app pressing F5 the app gets deployed successfully....
Now i am changing my start page url in Appmanifest like this:
ODataNewApp/Lists/Employees
In XML it looks like:
StartPage>~appWebUrl/Lists/Employees</StartPage>
When i am deploying app pressing F5 the app..
Getting register SOD error.....
I have followed all the steps like:
1)Creating app domain
2)Starting all the required services
3)Creating root site collection
But still no success.. Please help me on this.... I am struggling with this from two weeks...Have you set up a wildcard DNS entry for the spapps.com domain?
Also if you're trying to connect from the server you might be hitting loop back check issues.
Maybe you are looking for
-
HP Envy 4504 won't scan.
My HP Envy 4504 won't scan. Windows Vista Home Basic 32-bit. Has worked well in the past. Print-scan doctor says it's all set up, but "test scan" gets an error message. Wireless printing works. Tried re-installing, rebooting and turning firewall
-
Archiving file in application server
Hi Can anybody of you please let me know how to archive a file from one directory to other in the application server? I dont want to read one file into an internal table and then loop on that to create a new file. Looking for some FM or command that
-
Slow apps due to several calendar applications
Morning. I use several applications they are using calendar data: iCal, MenuCalendarClock, iBiz, MailTags, iSync (Nokia E65), several subscribed calendars, several published calendars (on .mac and on private servers). Some of them are very slow at st
-
About NLS_DATE_FORMAT and NLS_LANG.
Hi According to Oracle9 i Recovery Manager Userâs Guide Before invoking RMAN, set the NLS_DATE_FORMAT and NLS_LANG environment variables. These variables determine the format used for the time parameters in RMAN commands such as RESTORE, RECOVER, a
-
SmartForms002 Error when activating uploaded form
When I create a smartform with an address element in our pre-dev env, download it and then upload it into our Dev environments, it syntax checks fine but I get a SmartForms002 Error ... Internal Error (Illegal structure of data storage). It is fine