Is it possible to deploy multiple sharepoint provider hosted apps into one azure website??

Is it possible to deploy multiple sharepoint provider hosted apps into one azure website??
Rohit Pasrija

I am faced with a similar requirement although the hosting environment for the provider hosted apps would be an IIS web server in our own infrastructure. 
Would it be advisable to use a common IIS website to host multiple apps? The MVC web application which will provide functionality
for the apps is already in place which is why we are checking for options to use the same web project for multiple apps. 
Can the web config file's clientID be shared by multiple apps?

Similar Messages

  • SharePoint Provided host app - The client webpart suddenly got removed

    I have SharePoint provided host app and it contains one client webpart. I have added that webpart one of the pages in site after deploying the app in site.
    Issue we are facing now:
    The client webpart suddenly got removed from the page and no one has modified the page to delete the webpart.
    And it is not listing in App parts while trying to add the webpart to page.
    Is there any way to trace this issue?
    Thanks,
    Surya 
    Thanks, Surya

    Hi Surya,
    Please try to restore page history per the article below:
    http://rules.ssw.com.au/ITAndNetworking/Rules-to-Better-Sharepoint-for-End-Users/Pages/VersionHistory.aspx
    If you need to dig out who changed it, you may check ULS log or audit log if you have audit feature enabled.
    Regards,
    Rebecca Tu
    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]

  • SharePoint Provider Hosted App

    Hi all,
    I'm new in SP online development, and I want to know how can I open
    a SharePoint Provider Hosted App in visual studio?
    what are the steps?
    can I use it if I'm not using Azure?
    thank's!!

    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

  • Provider hosted app in windows Azure cloud Virtual Machine

    Hi
    thanks in advance,
    1. I am having requirement to setup a sitecollections specific to clients with same app installed for each client site collection( as app will act specific to client configuration).
    Thoughts :
    1. Create a provider hosted app or SharePoint hosted app and SharePoint site collections in the same virtual machine in Cloud.
     I am able to achieve high Trust provider hosted app on premise, it is working.
    Can any body suggest my thoughts on the approach is right or wrong. If wrong please suggest me how to achieve this.

    Hi,
    I have a sharepoint online site and Azure Virtual Machine.
    I have developed 4 SharePoint provider hosted apps and I want to deploy the same in office 0365 and App web should in Azure VM.
    So I seek help in terms with understanding the deployment.
    Because Azure comes with its own certificate cloudapp.net and what I find is this is a private certificate so I cannot use it outside.
    Please let me know if I am wrong, I need to buy a third party SSL certificate but doing so can I map it with cloudapp.net domain(which is provided by microsoft). Also Virtual machine is not in the domain. If so then do I also need a wild card certificate
    because I need to deploy 4 apps.
    just to conclude,
    I have SharePoint online site.
    Azure Virtual Machine (can I use the cloudapp.net certificate)
    SharePoint provider hosted apps(4 apps).
    Thanks and Regards Anup Kadam

  • 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 Provider Hosted App (401) Unauthorized Microsoft.SharePoint.SPException: The Azure Access Control service is unavailable

    Hello,
    I'm attempting to get a SharePoint 2013 Provider Hosted Application working in a brand new SharePoint environment.  I've created snapshots of both my dev and the sharepoint environments along the way and have meticulously documented every step of the
    way.  I've followed these instructions (among many other resources found along this journey) :
    http://msdn.microsoft.com/en-us/library/fp179923(office.15).aspx
    http://technet.microsoft.com/en-us/library/fp161236(office.15).aspx
    http://msdn.microsoft.com/library/office/fp179901%28v=office.15%29
    Upon package and publish of my application to SharePoint, I get a 401 Unauthorized error.  I use Fiddler to obtain the SPErrorCorrelationID to ultimately obtain the following ULS Viewer Output.  Please explain how to fix if you're able.
    Please Note:  I was under the impression that a Provider Hosted Application does not use the Azure Access Control service, so I'm confused as to why my system is attempting to make this connection?
    Also Note:  I've used a self signed and godday obtained certificate to successfully f5 debug my basic web.title (out of the visual studio 2012 box) sharepoint provider hosted application... so I know my certs are good.
    Here's my ULS output:
    03/24/2014 08:54:47.83    w3wp.exe (0x1448)    0x22D8    SharePoint Foundation    Logging Correlation Data    xmnv    Medium    Name=Request (GET:http://portal.cltenet.com/_layouts/15/appredirect.aspx?instance_id=22d5252f%2D392c%2D4f68%2Db820%2Da3053b9d4f24)  
     306c809c-66a1-d0d5-d8e2-89d3631ce1bf
    03/24/2014 08:54:47.83    w3wp.exe (0x1448)    0x22D8    SharePoint Foundation    Authentication Authorization    agb9s    Medium    Non-OAuth request.
    IsAuthenticated=True, UserIdentityName=0#.w|cltenet\sp.apps, ClaimsCount=25    306c809c-66a1-d0d5-d8e2-89d3631ce1bf
    03/24/2014 08:54:47.83    w3wp.exe (0x1448)    0x22D8    SharePoint Foundation    Logging Correlation Data    xmnv    Medium    Site=/    306c809c-66a1-d0d5-d8e2-89d3631ce1bf
    03/24/2014 08:54:47.84    w3wp.exe (0x1448)    0x22D8    SharePoint Foundation    App Deployment    acjjg    Medium    The current user has System.Threading.Thread.CurrentPrincipal.Identity.Name
    = 0#.w|cltenet\sp.apps, System.Security.Principal.WindowsIdentity.GetCurrent().Name = NT AUTHORITY\IUSR, System.Web.HttpContext.Current.User.Identity.Name = 0#.w|cltenet\sp.apps.    306c809c-66a1-d0d5-d8e2-89d3631ce1bf
    03/24/2014 08:54:47.84    w3wp.exe (0x1448)    0x22D8    SharePoint Foundation    App Auth    ajsrv    Medium    redirectLaunUrl after getting it from query
    string, web or app instance: https://hightrust31.cltenetapps.com/Pages/Default.aspx?{StandardTokens}    306c809c-66a1-d0d5-d8e2-89d3631ce1bf
    03/24/2014 08:54:47.85    w3wp.exe (0x1448)    0x22D8    SharePoint Foundation    General    aib0n    High    trying to get app tokens for site: 888b71f7-51ee-40f5-8344-8de4869d37d0
    Unable to load app tokens from appInstanceId: 22d5252f-392c-4f68-b820-a3053b9d4f24    306c809c-66a1-d0d5-d8e2-89d3631ce1bf
    03/24/2014 08:54:47.85    w3wp.exe (0x1448)    0x22D8    SharePoint Foundation    App Auth    ajsrw    Medium    redirectLaunUrl after getting token replacement:
    https://hightrust31.cltenetapps.com/Pages/Default.aspx?SPHostUrl=http%3A%2F%2Fportal%2Ecltenet%2Ecom&SPLanguage=en%2DUS&SPClientTag=0&SPProductNumber=15%2E0%2E4420%2E1017    306c809c-66a1-d0d5-d8e2-89d3631ce1bf
    03/24/2014 08:54:47.85    w3wp.exe (0x1448)    0x22D8    SharePoint Foundation    App Auth    ajsry    Medium    m_oauthAppId after NormalizeAppIdentifier()
    i:0i.t|ms.sp.ext|[email protected]8df36d5d.  Now getting app principal info.    306c809c-66a1-d0d5-d8e2-89d3631ce1bf
    03/24/2014 08:54:47.85    w3wp.exe (0x1448)    0x22D8    SharePoint Foundation    App Auth    ajsr0    Medium    decided that we need to do a POST to the
    app.    306c809c-66a1-d0d5-d8e2-89d3631ce1bf
    03/24/2014 08:54:47.85    w3wp.exe (0x1448)    0x22D8    SharePoint Foundation    App Auth    ajsr1    Medium    m_redirectMessage: EndpointAuthorityMatches  
     306c809c-66a1-d0d5-d8e2-89d3631ce1bf
    03/24/2014 08:54:47.85    w3wp.exe (0x1448)    0x22D8    SharePoint Foundation    App Auth    ajsr2    Medium    realm matched attempting to get app token
    using GetAccessToken()    306c809c-66a1-d0d5-d8e2-89d3631ce1bf
    03/24/2014 08:54:47.85    w3wp.exe (0x1448)    0x22D8    SharePoint Foundation    App Auth    advzm    High    Error when get token for app i:0i.t|ms.sp.ext|[email protected]8df36d5d,
    exception: Microsoft.SharePoint.SPException: The Azure Access Control service is unavailable.     at Microsoft.SharePoint.ApplicationServices.SPApplicationContext.GetApplicationSecurityTokenServicesUri(SPServiceContext serviceContext)    
    at Microsoft.SharePoint.ApplicationServices.SPApplicationContext..ctor(SPServiceContext serviceContext, SPIdentityContext userIdentity, OAuth2EndpointIdentity applicationEndPoint)     at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForApplicationContext(SPIdentityContext
    userIdentityContext, String applicationId, Uri applicationRealm, SPApplicationContextAccessTokenType applicationTokenType, SPApplicationDelegationConsentType consentValue)     at Microsoft.SharePoint.SPServerToAppServerAccessTokenManager.GetAccessTokenPrivate(SPServiceContext
    serviceContext, String appId, Uri appEndpointUrl, SPAppPrincipalInfo appPrincipal, SPApplicationContextAccessTokenType tokenType, Boolean useThreadIdentity, SPUserToken userToken)    306c809c-66a1-d0d5-d8e2-89d3631ce1bf
    03/24/2014 08:54:47.85    w3wp.exe (0x1448)    0x22D8    SharePoint Foundation    App Auth    ajsr3    High    App token requested from appredirect.aspx
    for site: 888b71f7-51ee-40f5-8344-8de4869d37d0 but there was an error in generating it.  This may be a case when we do not need a token or when the app principal was not properly set up.  LaunchUrl:https://hightrust31.cltenetapps.com/Pages/Default.aspx?SPHostUrl=http://portal.cltenet.com&SPLanguage=en-US&SPClientTag=0&SPProductNumber=15.0.4420.1017
    Exception Message:The Azure Access Control service is unavailable.  Stacktrace:    at Microsoft.SharePoint.ApplicationServices.SPApplicationContext.GetApplicationSecurityTokenServicesUri(SPServiceContext serviceContext)    
    at Microsoft.SharePoint.ApplicationServices.SPApplicationContext..ctor(SPServiceContext serviceContext, SPIdentityContext userIdentity, OAuth2EndpointIdentity applicationEndPoint)     at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForApplicationContext(SPIdentityContext
    userIdentityContext, String applicationId, Uri applicationRealm, SPApplicationContextAccessTokenType applicationTokenType, SPApplicationDelegationConsentType consentValue)     at Microsoft.SharePoint.SPServerToAppServerAccessTokenManager.GetAccessTokenPrivate(SPServiceContext
    serviceContext, String appId, Uri appEndpointUrl, SPAppPrincipalInfo appPrincipal, SPApplicationContextAccessTokenType tokenType, Boolean useThreadIdentity, SPUserToken userToken)     at Microsoft.SharePoint.SPServerToAppServerAccessTokenManager.GetAccessTokenFromThreadIdentityOrUserToken(SPServiceContext
    serviceContext, String appId, Uri appEndpointUrl, SPApplicationContextAccessTokenType tokenType, SPAppPrincipalInfo appPrincipal, Boolean useThreadIdentity, SPUserToken userToken)     at Microsoft.SharePoint.ApplicationPages.AppRedirectPage.ValidateAndProcessRequest(). 
    Since this is a nonfatal error, it will be sanitized and posted to the app as part of the app launch.    306c809c-66a1-d0d5-d8e2-89d3631ce1bf
    03/24/2014 08:54:47.85    w3wp.exe (0x1448)    0x22D8    SharePoint Foundation    General    ajlz0    High    Getting Error Message for Exception Microsoft.SharePoint.SPException:
    The Azure Access Control service is unavailable.     at Microsoft.SharePoint.ApplicationServices.SPApplicationContext.GetApplicationSecurityTokenServicesUri(SPServiceContext serviceContext)     at Microsoft.SharePoint.ApplicationServices.SPApplicationContext..ctor(SPServiceContext
    serviceContext, SPIdentityContext userIdentity, OAuth2EndpointIdentity applicationEndPoint)     at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForApplicationContext(SPIdentityContext userIdentityContext, String applicationId, Uri
    applicationRealm, SPApplicationContextAccessTokenType applicationTokenType, SPApplicationDelegationConsentType consentValue)     at Microsoft.SharePoint.SPServerToAppServerAccessTokenManager.GetAccessTokenPrivate(SPServiceContext serviceContext,
    String appId, Uri appEndpointUrl, SPAppPrincipalInfo appPrincipal, SPApplicationContextAccessTokenType tokenType, Boolean useThreadIdentity, SPUserToken userToken)     at Microsoft.SharePoint.SPServerToAppServerAccessTokenManager.GetAccessTokenFromThreadIdentityOrUserToken(SPServiceContext
    serviceContext, String appId, Uri appEndpointUrl, SPApplicationContextAccessTokenType tokenType, SPAppPrincipalInfo appPrincipal, Boolean useThreadIdentity, SPUserToken userToken)     at Microsoft.SharePoint.ApplicationPages.AppRedirectPage.ValidateAndProcessRequest()  
     306c809c-66a1-d0d5-d8e2-89d3631ce1bf
    03/24/2014 08:54:47.85    w3wp.exe (0x1448)    0x22D8    SharePoint Foundation    App Auth    aib0p    Medium    Doing appredirect from appredirect.aspx:
    in site: 888b71f7-51ee-40f5-8344-8de4869d37d0 with RedirectLaunchUrl: https://hightrust31.cltenetapps.com/Pages/Default.aspx?SPHostUrl=http%3A%2F%2Fportal%2Ecltenet%2Ecom&SPLanguage=en%2DUS&SPClientTag=0&SPProductNumber=15%2E0%2E4420%2E1017  
     306c809c-66a1-d0d5-d8e2-89d3631ce1bf
    03/24/2014 08:54:47.85    w3wp.exe (0x1448)    0x22D8    SharePoint Foundation    Monitoring    b4ly    Medium    Leaving Monitored Scope (Request (GET:http://portal.cltenet.com/_layouts/15/appredirect.aspx?instance_id=22d5252f%2D392c%2D4f68%2Db820%2Da3053b9d4f24)).
    Execution Time=26.5933938531294    306c809c-66a1-d0d5-d8e2-89d3631ce1bf
    Your help is very much appreciated.
    With Respect,
    Larry

    Yes, actually - I was able to resolve it.
    However I don't know how, unfortunately.  I suspect it was because I needed to have the names of the certificates, defined during the certificate registration (to sharepoint) process, different.
    I have a complete document that shows step by step instructions on the exact process I took to complete the provider hosted application creation, deployment and publishing.  It was a daunting task, but I finished it successfully.
    If there's a way to send private message on this forum, please do so and I'll respond with a way to obtain my document.
    NOTE:  I'm not all impressed with the way this forum works.  This is supposed to be a Microsoft resource and I'll be damned if I ever get a response to highly technical questions.  Completely lame.  Boooooo Microsoft.

  • Sharepoint provider hosted app using angularjs

    I am working on a provider hosted app and trying to access the list item through REST call using angularjs. But I am not able to access the list. Is it possible to access the sharepoint list through REST call using angularjs in a provider hosted app?
    Below is the code for angular:
    var hostWebApp = angular.module('HostWebList', []);
    Service:
    hostWebApp.service('$SharePointJSOMService', function ($q, $http) {
        this.getListItems = function ($scope, listTitle) {
            var deferred = $q.defer();
            //First we must call the EnsureSetup method
            JSRequest.EnsureSetup();
            var hostweburl = decodeURIComponent(JSRequest.QueryString["SPHostUrl"]);
            var appweburl = decodeURIComponent(JSRequest.QueryString["SPAppWebUrl"]);
            var restQueryUrl = hostweburl + "/_api/web/lists/getbytitle('ListName')/items";
            var executor = new SP.RequestExecutor(hostweburl);
            executor.executeAsync({
                url: restQueryUrl,
                method: "GET",
                headers: { "Accept": "application/json; odata=verbose" },
                success: function (data, textStatus, xhr) {
                    deferred.resolve(JSON.parse(data.body));
                error: function (xhr, textStatus, errorThrown) {
                    alert("request failed");
                    alert(textStatus);
    //getting -1003
                    alert(JSON.stringify(xhr));
    //{"responseAvailable":false,"body":,"Header":null}
                    deferred.reject(JSON.stringify(xhr));
            return deferred.promise;
    Controller:
    hostWebApp.controller('HostWebListController', function ($scope, $SharePointJSOMService) {
        $scope.listItem = null;
        var listName = "IncomingEmail";
        var promise = $SharePointJSOMService.getListItems($scope, listName);
        promise.then(function (data) {
            $scope.listItem = data.d.results;
            alert($scope.listItem);
            console.log("came inside the promise success method");
        }, function (data) {
            console.log("Error " + data);
    Following javascript files I have included:
     <script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script>
      <script type="text/javascript" src="/_layouts/15/sp.js"></script>
     <script type="text/javascript" src="/_layouts/15/SP.RequestExecutor.js"></script>
     <script type="text/javascript" src="/_layouts/15/init.debug.js"></script>
    angular.js included. 
    I don't know what is the problem. Can anybody walk me through the problem. will be great help.

    Your REST request must be authenticated. So you must send the access token in the authorization header along with your request. The following link explains how you can get the access token when you using a provider hosted app.
    http://blog.mastykarz.nl/using-sharepoint-rest-api-in-provider-hosted-apps/
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • 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

  • 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

  • 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

  • ClientContext.ExecuteQuery(); gives access denied error in sharepoint provider hosted app

    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.

  • SharePoint Provider-hosted Apps - Expired OAuth Client Secret - Token Request failed

    Hi everyone,
    in the past days, we have encountered authentication problems with our provider-hosted SharePoint apps.
    The apps are not deployed through the Office Store, but through the specific organizational app-catalog of the SharePoint tenant of our customers.
    Because the apps are provider-hosted, we had to register the OAuth client id and client secret properties of the app for accessing SharePoint resources from our app through the /_layouts/15/appregnew.aspx page.
    Now, the OAuth client secret of our app seems to be expired and this causes the app to stop working.
    The exception stacktrace is:
    "Token request failed. at Microsoft.IdentityModel.S2S.Protocols.OAuth2.OAuth2S2SClient.Issue(String securityTokenServiceUrl, OAuth2AccessTokenRequest oauth2Request) at OurProjectName.TokenHelper.GetAccessToken(String refreshToken, String targetPrincipalName,
    String targetHost, String targetRealm) at OurProjectName.TokenHelper.GetAccessToken(SharePointContextToken contextToken, String targetHost) at OurProjectName.TokenHelper.GetClientContextWithContextToken(String targetUrl, String contextTokenString, String appHostUrl)"
    We have already found this article regarding replacing expired client secret in SharePoint apps: http://msdn.microsoft.com/en-us/library/office/dn726681(v=office.15).aspx
    We have followed the provided steps, generated a new client secret and added it to the web.config file. The old client secret still stays in the file as "SecondaryClientSecret". Then, we executed the PowerShell script in order to register the new
    client secret in our SharePoint tenant. Afterwards, the authentication works as expected. 
    The question is, whether we really have to do the steps for ALL of our customers if the client secret expires again? If the client secret is expired, do we have to execute the PowerShell script on all of our customers' tenants?
    Maybe there is something we failed to notice...
    Thanks for your help. Feel free to ask for further information if something is missing.
    Best regards,
    Dustin

    Hi Utilitas,
    There is no easy way to batch updating Client Secret for each tenant. You may need to execute
    the PowerShell script to update it as the above you post.
    Best Regards,
    Zhengyu Guo
    TechNet Community 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]
    Zhengyu Guo
    TechNet Community Support

  • Sharepoint Provider hosted app installation error - There is no Workflow App Part registered

    Hello,
    I am getting below error when i run my share point app(Provider hosted) from visual studio 2013.It has a list workflow.
    Error 1
    Error occurred in deployment step 'Install app for SharePoint': There is no Workflow App Part registered.
    0 0
    SharePointApp
    Thanks
    Sobers

    Hi,
    According to the error message, your environment might not have the deployment group for the workflow registered.
    You can register the deployment group using PowerShell with the code provided by Andrew in the link below and do the test again:
    http://www.andrewconnell.com/blog/Workflow-Improvements-Changes-SP2013-March-PU-and-RTM-Developer-Tools#XgQAmUFIZm8a5cjm.99
    Feel free to reply with the test result if the issue still exists.
    Best regards
    Patrick Liang
    TechNet Community Support

  • Using powershell to deploy provider-hosted app and specify remote Url instead of using appinv.aspx page

    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

  • 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]

Maybe you are looking for

  • ISE Radius - Access-accept is returned with no autorization policy

    Hello, With ISE Radius service / PAP, the authentication passes OK, but the Network Element which send the autorization request, returns message "not enough user priviledges to execute command" and the HTTP page is blank. The reason for that is, the

  • Goods Receipts Report in MM

    How to write a Goods Receipts Report: Having A detailed report for listing goods receipts by material wise for a given period which contains detailed information like PO No, PO Date, Plant, GR ref, GR date, Material description. [Tables involved: EKK

  • Open Directory Active Directory users want to know Is there a method?

    Help Open Directory Active Directory users want to know Is there a method? Or can I make the Active Directory users to share on the Open Directory. My goal is to use our school Mac computers with SSO

  • IPhoto Cannot Show B&W

    Using iphoto 08 v 7.1.3. Seems that i cannot see any thumbnail of black and white shots that have either been taken that way or changed in photo shop or aperture. When the image is displayed in a sideshow within iphoto its dark and hardly viewable. H

  • DREAMWEAVER CS4 LAYOUT (DESIGNED IN PHOTOSHOP)..

    Hi everyone, Just wondering if anyone can help me with this... checkout this website of mine (Im a guitar teacher) http://www.jlgtuition.com (jpeg exported from photoshop used as background design) click here advice on how to lay this out again (site