Provider hosted app installed on SharePoint 2013 on premises is returning internal 500 error !

Hello,
I have deployed the basic provider hosted app on sharepoint 2013 on premises.
However when I try to run the app, its throwing an error on following as mentioned in screen:
It seems an authentication issue, would you please tell me how can I resolve it ?
Thank you in advance.
Kind Regards,
Dipti Chhatrapati

Hi,
According to your description, my understanding is that when you run provider hosted app in SharePoint 2013 on premise, the app occurs internal 500 error.
For using Managed .NET Client Object Model in Provider hosted app, it will need
TokenHelper.cs to get the ClientContext object like below:
private void RetrieveWithCSOM(string accessToken)
if (IsPostBack)
sharepointUrl = new Uri(Request.QueryString["SPHostUrl"]);
ClientContext clientContext =
TokenHelper.GetClientContextWithAccessToken(
sharepointUrl.ToString(), accessToken);
//Load the properties for the web object.
Web web = clientContext.Web;
clientContext.Load(web);
clientContext.ExecuteQuery();
//Get the site name.
siteName = web.Title;
//Get the current user.
clientContext.Load(web.CurrentUser);
clientContext.ExecuteQuery();
currentUser = clientContext.Web.CurrentUser.LoginName;
//Load the lists from the Web object.
ListCollection lists = web.Lists;
clientContext.Load<ListCollection>(lists);
clientContext.ExecuteQuery();
//Load the current users from the Web object.
UserCollection users = web.SiteUsers;
clientContext.Load<UserCollection>(users);
clientContext.ExecuteQuery();
foreach (User siteUser in users)
listOfUsers.Add(siteUser.LoginName);
foreach (List list in lists)
listOfLists.Add(list.Title);
More information:
https://msdn.microsoft.com/en-us/library/office/fp142381.aspx
Thanks
Best Regards,
Jerry Guo
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected]

Similar Messages

  • SharePoint 2013 On premises provider hosted app - Logged in user info

    As per my understanding, following scenario is not possible in a provided hosted app deployed for SharePoint 2013 on-premises.
    1) User clicks the button of app on a SharePoint Site. Remote Web app page opens
    2) Remote app page shows the message "Welcome [User Name]" (without authenticating user again)
    3) If that user has contributor permissions in originating SharePoint site, the app should display "Welcome Contributor" otherwise it should display "Welcome Visitor"
    Please let me know if above functionality could be achieved?
    Hammad Arif EPM Advice Blog

    Hi,
    According to your description,my understanding is that you want to show user information when clicking  the app without asking credentials .
    By default, SharePoint Provider hosted app is hosted outside SharePoint web application, so it needs credentials to get OAuth. 
    I suggest you can use SharePoint hosted app, it hosted at the same web application as SharePoint, then when you click the app, it will get the current logged in user without  without asking credentials.
    Here are some detailed articles for your reference:
    Choose patterns for developing and hosting your app for SharePoint
    How to: Create a basic SharePoint-hosted app
    How to Check User permission for the web, list or SharePoint Item in SharePoint JavaScript Object Model
    Thanks
    Best Regards,
    Jerry Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Provider hosted app error message: The remote server returned an error: (429) Too Many Requests.

    Hi,
    I have a customer running a provider hosted app and in Sharepoint 2013. Things have been working fine but recently they keep experiencing an issue where the all the app parts on the page show the following error message. Does anyone have an idea what
    could be causing this problem and how I can fix it? The Sharepoint site and provider hosted app site are running on a Server 2008 R2 box with IIS 7.5.
    Server Error in '/Test.Sharepoint.App' Application.
    The remote server returned an error: (429) Too Many Requests.
    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.Net.WebException: The remote server returned an error: (429) Too Many Requests.
    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:
    [WebException: The remote server returned an error: (429) Too Many Requests.]
    System.Net.HttpWebRequest.GetResponse() +8527180
    Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute() +58
    Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb) +975
    Test.Sharepoint.AppWeb.Pages.LatestAnnouncement.GetLatestAnnouncement(Boolean showFullText) +610
    Test.Sharepoint.AppWeb.Pages.LatestAnnouncement.Page_Load(Object sender, EventArgs e) +764
    System.Web.UI.Control.LoadRecursive() +71
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18034
    Impreza Software Development

    Hi GuYumming,
    I have checked the Sharepoint site using Fiddler and my X-SharePointHealthScore stays consistently on 1, I have even refreshed the site and had the "(429) Too Many Requests" error happen right in front of me whilst Fiddler is running and when I look at the
    200 response for the Sharepoint site it is still showing "X-SharePointHealthScore: 1".
    I assume because of this I do not need to make any of the changes suggested in your article above?
    I have also been through the ULS logs and found the following 3 log entries that appear to relate to the issue but they do not really mean much to me so I am hoping that you can help:
    Begin CSOM Request ManagedThreadId=59, NativeThreadId=12476
    SPResourceTally(ClientServiceRequestDuration) value 1 + 150425 > 150000
    ResourceBudgetExceeded, sending throttled status code. Exception=Microsoft.SharePoint.SPResourceBudgetExceededException: ResourceBudgetExceeded     at Microsoft.SharePoint.SPResourceTally.Check(Int32 value)    
    at Microsoft.SharePoint.SPAggregateResourceTally.Check(SPResourceKind kind, Int32 value)     at Microsoft.SharePoint.Client.SPClientServiceHost.OnBeginRequest()
    Impreza Software Development

  • Provider hosted App certificates (.cer & .pfx)

    I have a implemented a provider hosted App inside the SharePoint 2013 server (the certificates .cer & .pfx  taken from the IIS of same server) and able to get the result. However I am not clear about taking the certificates in the multi server
    environment (SharePoint Server & IIS server for remote web app).
    can anyone please suggest from which server (Sharepoint Server or IIS server)  do I need to take the .cer & .pfx files to configure multi server environment ?
    Thanks

    Hi,
    According to your post, my understanding is that you want to create a provider hosted app and use NLB in premise environment.
    You need to use a different certificate on this ‘Listener’ web application.
    Configuring SharePoint 2013 Apps and Multiple Web Applications on SSL with a
    Single IP Address
    For more information, you can refer to:
    Aspiring Architect: Sharepoint 2013 - Avoiding Azure on Dev Box
    More TroubleShooting Tips for High Trust Apps on SharePoint 2013
    You need to ensure that all connections to the SharePoint servers are secure and encrypted
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • HTTPS SharePoint site with HTTPS Provider hosted app - The remote certificate is invalid according to the validation procedure

    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

  • Why do we need UPA for rehydrating users in Sharepoint provider hosted app scenario?

    Our on prem. SPS 2013 environment is configged to authenticate through ADFS against a third party IDP. We know nothing about these users, the returned SAML contains a role and based on this role we authorize user in SPS. This works great.
    No we are investigating high-trust provider hosted apps (on prem, no azure acs). We have created a simple MVC, and configged it to use ADFS. Now if users are authenticated from SPS they can call the MVC and the ADFS token is reused. Works perfect. Only thing
    is that whenever we need to call Sharepoint code through the client objectmodel, we get a 401 and the ULS shows that SPS is not able to map the incoming user to a user in User Profile DB. Off course it can't because the user is not in UPA and cannot be in
    UPA beacuse the users are stored outside our domain and there is no way to sync these to our SPS environment. I read a couple of blogs about this issue and the all say that we ned to sync with the user repository to fill upa; but again that cannot be (suppose
    on of our IDP's was facebook...?)
    The construction works if we use apponly security, but now we lose our SPS security. So my real question is, can we some how workaround User Profile service in the scenario, or at least without needing to sync these users.
    Any help/guidance is much appreciated!
    Sander

    Hi John,
    No we were not able to find a solution. The provider hosted app-model of SPS 2013 just does not take into account that in some cases useraccounts are not available. We could not find a way around user rehydration. Off course you can all ways use another
    security model like app-only policies, but that was not sufficient for us. It was also kind of disappointing there was no way to handle this; th emost problematic for me personal is that I cannot think of a reason why the rehydration can not be skipped in
    some way. If you configure it to run within SPS itself, rehydration is not necessary, so why it seams mandatory in provider hosted app beats me ;-)
    We went back to good old farm-solutions with webparts. 
    Sorry 
    Sander

  • 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

  • Security certificate issue for Provider Hosted App (SP Online)

    Hi all,
    I am having a hard time with SP Online debugging a basic provider hosted app.
    Steps I have taken to create the app:
     created a new provider hosted app in Visual Studio 2013 and setting my SP Online debugging site (wich works perfectly for SP hosted apps).
    Chose Azure ACS option, although I do not have an Azure account
    When I deploy the app I get to the page on my debugging site where I must choose "Trust It", but when I do I get the message that the Connection is Unsecure/unsafe:
     How can I fix this? Do I need to create an Azure account for debugging purposes already? Or is there another way to solve the problem?

    Hi,
    I understand that you get Security certificate issue for Provider Hosted App (SP Online).
    Per my knowledge, you need to create an Azure account for debugging purposes.
    To create a SharePoint 2013 app for Office 365 and publish it to an Azure web site, you can refer to:
    http://blogs.msdn.com/b/kaevans/archive/2014/02/24/creating-a-sharepoint-2013-app-with-azure-web-sites.aspx
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Error occurred in deployment step 'Install app for SharePoint': Failed to install app for SharePoint. provider-hosted app sharepoint on premise

    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

  • SharePoint 2013 Provider-Hosted App Installs, throws File Exists error.

    I have a SP2013 Provider-hosted app with DevExpress controls that was working fine until just recently. I am getting the following error when I try to F5 DEBUG:
    "Error occurred in deployment step 'Install app for SharePoint': The file exists."
    The app actually installs and executes but the debugger detaches very quickly plus it is prompting with the nagging aforementioned message. There are no AppUninstall / AppInstall / AppUpgraded events being handled.
    Thanks in advance.

    I tried retraction, cleaning, reinstalling - nothing worked. I tried a new app in the site collection and a new app in a new site collection - still no luck. In the end the problem was more simple, but the "File exists" error was not helpful in determining
    the root cause. Perhaps others will hit this thread and find the solution helpful. Visual Studio will typically switch automatically to "Run as Administrator" mode whenever debugging a SP App for 2013. In my case, it wasn't. I had one or two existing Apps
    that never prompted me but ran fine and in this case, new apps weren't automatically running as the Administrator. After changing this behavior the app (and new apps) work as expected.

  • SharePoint 2013 Provider hosted App installation error

    Hi All,
    I am trying to install a provider hosted app in SharePoint 2013. Installation goes for about 15mins and get "Sorry, something went wrong
    with adding the app. Click to retry."
    Please find belw ULS details for Correlation ID:
    Error when try to get access token when deploy AppInstanceId 7bcf1d9d-897a-48a1-b4f4-cd3120fd98a5 with AppPrincipalId i:0i.t|ms.sp.ext|[email protected]01b993b6. Exception=System.InvalidOperationException:
    An unexpected error was returned from the delegation service.  Error Code: 'invalid_client' Error Description: 'ACS65003: The clientId 'd12de581-316c-4224-b58b-e91ac2042150/www.SERVERNAME.DOMAIN.com@0d85160c-5899-44ca-acc8-db1501b993b6' is not a valid
    service identity.  Trace ID: 4a0c4974-94f4-4077-9a22-2ba5f0abb444  Correlation ID: 674d9839-686b-45f3-be46-31db4dc2a9d0  Timestamp: 2014-07-23 09:34:49Z'    
     at Microsoft.SharePoint.Administration.SPAzureAccessControlDelegationServiceClient.HandleUnexpectedError(SPAzureAccessControlDelegationServiceResponse delegationServiceResponse)    
     at Microsoft.SharePoint.ApplicationServices.SPApplicationContextAccessToken.GetResponseOrThrow[T](SPAzureAccessControlDelegationServiceClient delegationServiceClient, SPAzureAccessControlDelegationServiceResponse delegationServiceResponse)    
     at Microsoft.SharePoint.ApplicationServices.SPApplicationContextAccessToken.IssueApplicationContextAccessToken(SPServiceContext serviceContext, SPApplicationContextAccessTokenCreationParameters creationParameters)    
     at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForApplicationContext(SPIdentityContext userIdentityContext, String applicationId, Uri applicationRealm, SPApplicationContextAccessTokenType applicationTokenType, SPApplicationDelegationConsentType
    consentValue)    
     at Microsoft.SharePoint.SPServerToAppServerAccessTokenManager.GetAccessTokenForDeploymentTask(Guid siteId, SPUserToken userToken, String appPrincipalId)    
     at Microsoft.SharePoint.Lifecycle.SPAppPrincipalAccessTokenTask.<>c__DisplayClass1.<Deploy>b__0()
    sudesh withanage

    Hi  sudesh,
    According to your description, my understanding is that you encountered the error “An unexpected error was returned from the delegation service" when you try to add a SharePoint 2013 Provider hosted App.
    As the error message says, the clientId 'd12de581-316c-4224-b58b-e91ac2042150/www.SERVERNAME.DOMAIN.com@0d85160c-5899-44ca-acc8-db1501b993b6' is not a valid service identity when your SharePoint  try
    to get access token via ACS. Is there any plans to develop a low trust mechanism for non-connected scenarios? i.e. low trust provider hosted apps with no external connection, like say for a Bank who lock down external access.  Please  follow the
    steps as the blog  to set development environment for  SharePoint Low-Trust Apps:
    http://blogs.msdn.com/b/besidethepoint/archive/2012/12/10/sharepoint-low-trust-apps-for-on-premises-deployments.aspx?PageIndex=1#comments
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Retrieve data from a list in SharePoint 2013 provider hosted App using CSOM

    I have developed a provider hosted app in SharePoint 2013. As you already know, Visual Studio creates web application and SharePoint app. The web application gets hosted inside IIS and the SharePoint App in SharePoint site collection. I'm trying to get
    data from a list hosted in SharePoint using CSOM. But I get ran insecure content error. 
    here is my code in Default.aspx
        <script type="text/javascript" src="../Scripts/jquery-1.8.2.js"></script>
        <script type="text/javascript" src="../Scripts/MicrosoftAjax.js"></script>
        <script type="text/javascript" src="../Scripts/SP.Core.js"></script>
        <script type="text/javascript" src="../Scripts/INIT.JS"></script>
        <script type="text/javascript" src="../Scripts/SP.Runtime.js"></script>
        <script type="text/javascript" src="../Scripts/SP.js"></script>
        <script type="text/javascript" src="../Scripts/SP.RequestExecutor.js"></script>
        <script type="text/javascript" src="../Scripts/App.js"></script>
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head runat="server">
            <title></title>
        </head>
        <body>
            <form id="form1" runat="server">
            <div>
                <input id="Button1" type="button" value="Get title via CSOM" onclick="execCSOMTitleRequest()" /> <br />
                <input id="Button2" type="button" value="Get Lists via CSOM" onclick="execCSOMListRequest()" />
            </div>
                <p ID="lblResultTitle"></p><br />
                <p ID="lblResultLists"></p>
            </form>
        </body>
        </html>
    and App.js is:
        var hostwebUrl;
        var appwebUrl;
        // Load the required SharePoint libraries
        $(document).ready(function () {
            //Get the URI decoded URLs.
            hostwebUrl =
                decodeURIComponent(
                    getQueryStringParameter("SPHostUrl")
            appwebUrl =
                decodeURIComponent(
                    getQueryStringParameter("SPAppWebUrl")
            // resources are in URLs in the form:
            // web_url/_layouts/15/resource
            var scriptbase = hostwebUrl + "/_layouts/15/";
            // Load the js files and continue to the successHandler
            //$.getScript(scriptbase + "/MicrosoftAjax.js",
            //   function () {
            //       $.getScript(scriptbase + "SP.Core.js",
            //           function () {
            //               $.getScript(scriptbase + "INIT.JS",
            //                   function () {
            //                       $.getScript(scriptbase + "SP.Runtime.js",
            //                           function () {
            //                               $.getScript(scriptbase + "SP.js",
            //                                   function () { $.getScript(scriptbase + "SP.RequestExecutor.js", execCrossDomainRequest); }
        function execCrossDomainRequest() {
            alert("scripts loaded");
        function getQueryStringParameter(paramToRetrieve) {
            var params = document.URL.split("?")[1].split("&");
            var strParams = "";
            for (var i = 0; i < params.length; i = i + 1) {
                var singleParam = params[i].split("=");
                if (singleParam[0] == paramToRetrieve)
                    return singleParam[1];
        function execCSOMTitleRequest() {
            var context;
            var factory;
            var appContextSite;
            var collList;
            //Get the client context of the AppWebUrl
            context = new SP.ClientContext(appwebUrl);
            //Get the ProxyWebRequestExecutorFactory
            factory = new SP.ProxyWebRequestExecutorFactory(appwebUrl);
            //Assign the factory to the client context.
            context.set_webRequestExecutorFactory(factory);
            //Get the app context of the Host Web using the client context of the Application.
            appContextSite = new SP.AppContextSite(context, hostwebUrl);
            //Get the Web
            this.web = context.get_web();
            //Load Web.
            context.load(this.web);
            context.executeQueryAsync(
                Function.createDelegate(this, successTitleHandlerCSOM),
                Function.createDelegate(this, errorTitleHandlerCSOM)
            //success Title
            function successTitleHandlerCSOM(data) {
                $('#lblResultTitle').html("<b>Via CSOM the title is:</b> " + this.web.get_title());
            //Error Title
            function errorTitleHandlerCSOM(data, errorCode, errorMessage) {
                $('#lblResultLists').html("Could not complete CSOM call: " + errorMessage);
        function execCSOMListRequest() {
            var context;
            var factory;
            var appContextSite;
            var collList;
            //Get the client context of the AppWebUrl
            context = new SP.ClientContext(appwebUrl);
            //Get the ProxyWebRequestExecutorFactory
            factory = new SP.ProxyWebRequestExecutorFactory(appwebUrl);
            //Assign the factory to the client context.
            context.set_webRequestExecutorFactory(factory);
            //Get the app context of the Host Web using the client context of the Application.
            appContextSite = new SP.AppContextSite(context, hostwebUrl);
            //Get the Web
            this.web = context.get_web();
            // Get the Web lists.
            collList = this.web.get_lists();
            //Load Lists.
            context.load(collList);
            context.executeQueryAsync(
                Function.createDelegate(this, successListHandlerCSOM),
                Function.createDelegate(this, errorListHandlerCSOM)
            //Success Lists
            function successListHandlerCSOM() {
                var listEnumerator = collList.getEnumerator();
                $('#lblResultLists').html("<b>Via CSOM the lists are:</b><br/>");
                while (listEnumerator.moveNext()) {
                    var oList = listEnumerator.get_current();
                    $('#lblResultLists').append(oList.get_title() + " (" + oList.get_itemCount() + ")<br/>");
            //Error Lists
            function errorListHandlerCSOM(data, errorCode, errorMessage) {
                $('#lblResultLists').html("Could not complete CSOM Call: " + errorMessage);
    Any solution is appreciated.

    Hi,
    To retrieve data from list in your provider-hosted app using SharePoint Client Object Model(CSOM), you can follow the links below for a quick start:
    http://msdn.microsoft.com/en-us/library/office/fp142381(v=office.15).aspx
    http://blogs.msdn.com/b/steve_fox/archive/2013/02/22/building-your-first-provider-hosted-app-for-sharepoint-part-2.aspx
    Best regards
    Patrick Liang
    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 issue

    Hi,
    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

  • App Parts (I Frame) is possible in Provider hosted app in SharePoint 2013

    Hi In SharePoint 2013 provider hosted app, is it possible to add App parts
    <WebPartPages:AllowFraming ID="AllowFraming" runat="server" />
    (is I frame) is allowed.
    If possible how to approach, if not what is the solution. Any help will be appreciated

    Hi Ashok,
    Thanks for posting your query, Kindly browse the below mentioned URLs to get the solution for your requirement.
    http://www.codeproject.com/Articles/524232/StepplusbyplusStepplusguideplustopluscreateplusapl
    http://www.sharepointnutsandbolts.com/2012/08/sharepoint-2013-appsarchitecture.html
    http://www.slideshare.net/roykimtoronto/share-point-2013-hosted-app-presentation-roy-kim
    http://blogs.msdn.com/b/richard_dizeregas_blog/archive/2012/08/02/optimizing-user-experience-for-sharepoint-2013-apps.aspx
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • How to debug sharepoint 2013 provider hosted app?

    We developed SharePoint 2013 provider hosted app using MVC 5 Entity Framework of Database first and publish in Windows Azure site as well as deployed that project to our SharePoint app Catalog. We need to change Windows azure site so we
    changed to publish in  another Windows Azure site and deployed again to our SharePoint app Catalog. No problem the app is working after we changed Windows Azure site. I am new of this technology I faced so hard of changed
    existing Windows Azure site to New Windows Azure site. Please tell me how to debug the SharePoint Provider hosted app? Please tell me step by step process.
     Thanks in Advance.

    Hi,
    According to your description, you might want to know how to debug provider hosted app.
    To get a quick start, I would suggest you take a look at the link below about
    Debugging SharePoint Apps That Are Hosted In Windows Azure Web Sites:
    http://blogs.technet.com/b/speschka/archive/2013/11/25/debugging-sharepoint-apps-that-are-hosted-in-windows-azure-web-sites.aspx
    Another two similar articles for your reference:
    http://sharepointfieldnotes.blogspot.jp/2013/03/making-it-easy-to-develop-and-debug.html
    http://blogs.msdn.com/b/officeapps/archive/2013/01/03/debugging-remote-event-receivers-with-visual-studio.aspx
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

Maybe you are looking for