On-premise High-trust App and 401 (appredirect.aspx) for anomyous user

Hello,
I've developed a provider hosted App. The App can be used by authenticated and anonymous users. On my development platform the App is working in both cases as expected. Then I configured a new test Server (I did all the steps for high trusted Apps) and installed
the new App (Register app, created a new package in Visual Studio, did the changes for the TokenHelper class and so on). Now, the App ist working for authenticated users only. For anonymous users the appredirect page is asking for credentials. The SharePoint
log contains only a few Information about the problem:
client_id: i:0i.t|ms.sp.ext|..... and instance_id:
https://xxx/Pages/AppPartPage.aspx?SPHostUrl=http%3A%2F%2FXXXXXXX%2FDE%2FSP2013Standard&SPHostTitle=SP2013%20Standard%20Layout&SPAppWebUrl=""&SPLanguage=de%2DCH&SPClientTag=1&SPProductNumber=15%2E0%2E4420%2E1017&wpId=g%5F5b8feaca%5F038f%5F473d%5F8001%5F0a91849f9a05&editmode=0&SenderId=1DD84F040
from query string
redirectLaunUrl after getting it from query string, web or app instance:
https://remote-domain-app/Pages/AppPartPage.aspx?SPHostUrl=http%3A%2F%2FXXXXXXX%2FDE%2FSP2013Standard&SPHostTitle=SP2013%20Standard%20Layout&SPAppWebUrl=""&SPLanguage=de%2DCH&SPClientTag=1&SPProductNumber=15%2E0%2E4420%2E1017&wpId=g%5F5b8feaca%5F038f%5F473d%5F8001%5F0a91849f9a05&editmode=0&SenderId=1DD84F040
redirectLaunUrl after getting token replacement:
https://remote-domain-app/Pages/AppPartPage.aspx?SPHostUrl=http%3A%2F%2FXXXXXXX%2FDE%2FSP2013Standard&SPHostTitle=SP2013%20Standard%20Layout&SPAppWebUrl=""&SPLanguage=de%2DCH&SPClientTag=1&SPProductNumber=15%2E0%2E4420%2E1017&wpId=g%5F5b8feaca%5F038f%5F473d%5F8001%5F0a91849f9a05&editmode=0&SenderId=1DD84F040
m_oauthAppId after NormalizeAppIdentifier() i:0i.t|ms.sp.ext|548......  Now getting app principal info.
decided that we need to do a POST to the app.
NOTHING MORE
The remote IIS web allows anonymous access and I can open the remote web site as anonymous user. Tried to set the the App Principal permission again, but without luck.  When the remote web is stopped the 401 error still exist - no other error.
I've no idea what I can check next.

Hi,
You can use PowerShell to get the AppPrincipal.
$targetWeb = Get-SPSite "http://dev.my.com"
$clientID = "82ea34fc-31ba-4e93-b89a-aa41b023fa7e"
$authRealm = Get-SPAuthenticationRealm -ServiceContext $targetWeb
$AppIdentifier = $clientID + "@" + $authRealm
$appPrincipal = Get-SPAppPrincipal -Site $targetWeb.RootWeb -NameIdentifier $AppIdentifier
I suggest you try to delete the app and use the following PowerShell script to install the APP.
param
[string]$Web = $(throw '- Need a SharePoint web site URL (e.g. "http://portal.contoso.com/")'),
[string]$Source = "ObjectModel"
Write-Host -ForegroundColor White "-------------------"
Write-Host -ForegroundColor White "| App Installer |"
Write-Host -ForegroundColor White "-------------------"
Write-Host -ForegroundColor White "- "
#Global vars
$AppPackageName = "App.app";
#Loads powershell settings
Write-Host -ForegroundColor White "- Load Powershell context.."
$0 = $myInvocation.MyCommand.Definition
$dp0 = [System.IO.Path]::GetDirectoryName($0)
#Loads the SharePoint snapin
Write-Host -ForegroundColor White "- Load SharePoint context.."
$ver = $host | select version
if ($ver.Version.Major -gt 1) {$host.Runspace.ThreadOptions = "ReuseThread"}
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {
Add-PSSnapin "Microsoft.SharePoint.PowerShell";
[void][System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c")
#Imports the App package
Write-Host -ForegroundColor White "- Import app package '$AppPackageName'..."
$appPath = "C:\Projects\App\App\bin\Debug\app.publish\1.0.0.0" + "\" + $AppPackageName;
if ($Source.Equals("ObjectModel", [System.StringComparison]::InvariantCultureIgnoreCase)) {
$sourceApp = ([microsoft.sharepoint.administration.spappsource]::ObjectModel);
elseif ($Source.Equals("Marketplace", [System.StringComparison]::InvariantCultureIgnoreCase)) {
$sourceApp = ([microsoft.sharepoint.administration.spappsource]::Marketplace);
elseif ($Source.Equals("CorporateCatalog", [System.StringComparison]::InvariantCultureIgnoreCase)) {
$sourceApp = ([microsoft.sharepoint.administration.spappsource]::CorporateCatalog);
elseif ($Source.Equals("DeveloperSite", [System.StringComparison]::InvariantCultureIgnoreCase)) {
$sourceApp = ([microsoft.sharepoint.administration.spappsource]::DeveloperSite);
elseif ($Source.Equals("RemoteObjectModel", [System.StringComparison]::InvariantCultureIgnoreCase)) {
$sourceApp = ([microsoft.sharepoint.administration.spappsource]::RemoteObjectModel);
$spapp = Import-SPAppPackage -Path "$appPath" -Site $Web -Source $sourceApp -Confirm:$false -ErrorAction SilentlyContinue -ErrorVariable err;
if ($err -or ($spapp -eq $null))
Write-Host -ForegroundColor Yellow "- An error occured during app import !"
throw $err;
Write-Host -ForegroundColor White "- Package imported with success."
#Installs the App
Write-Host -ForegroundColor White "- Install the APP in web site..."
$app = Install-SPApp -Web $Web -Identity $spapp -Confirm:$false -ErrorAction SilentlyContinue -ErrorVariable err;
if ($err -or ($app -eq $null)) {
Write-Host -ForegroundColor Yellow "- An error occured during app installation !"
throw $err;
$AppName = $app.Title;
Write-Host -ForegroundColor White "- App '$AppName' registered, please wait during installation..."
$appInstance = Get-SPAppInstance -Web $Web | where-object {$_.Title -eq $AppName};
$counter = 1;
$maximum = 150;
$sleeptime = 2;
Write-Host -ForegroundColor White "- Please wait..." -NoNewline;
$url = "$($Web)_layouts/15/appinv.aspx?AppInstanceId={$($appInstance.Id)}"
$ie = New-Object -com internetexplorer.application
try
$ie.visible=$true
$ie.navigate2($url)
while ($ie.busy)
sleep -milliseconds 60
$trustButton = $ie.Document.getElementById("ctl00_PlaceHolderMain_BtnAllow")
$trustButton.click()
sleep -Seconds 1
Write-Host "App was trusted successfully!"
catch
throw ("Error Trusting App");
while (($appInstance.Status -eq ([Microsoft.SharePoint.Administration.SPAppInstanceStatus]::Installing)) -and ($counter -lt $maximum))
Write-Host -ForegroundColor White "." -NoNewline;
sleep $sleeptime;
$counter++;
$appInstance = Get-SPAppInstance -Web $Web | where-object {$_.Title -eq $AppName}
Write-Host -ForegroundColor White ".";
if ($appInstance.Status -eq [Microsoft.SharePoint.Administration.SPAppInstanceStatus]::Installed) {
Write-Host -ForegroundColor White "- The App was successfully installed.";
$appUrl = $appInstance.AppWebFullUrl;
Write-Host -ForegroundColor White "- The App is now available at '$appUrl'.";
Write-Host -ForegroundColor White "- (Don't forget to add app host name in your host file if necessary...).";
Write-Host -ForegroundColor White "- "
else {
Write-Host -ForegroundColor Yellow "- An unknown error has occured during app installation. Read SharePoint log for more information.";
More TroubleShooting Tips for High Trust Apps on SharePoint 2013
http://blogs.technet.com/b/speschka/archive/2012/11/01/more-troubleshooting-tips-for-high-trust-apps-on-sharepoint-2013.aspx
Thanks,
Dennis 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].
Dennis Guo
TechNet Community Support

Similar Messages

  • Iframe auto height based on content in high trust apps on premise

    Hi, 
    how to adjust the app part height based on the content, in high trust apps. 
    Thanks
    Ram

    Hi Ram,
    We can use JavaScript to adjust the iframe height, the following code for your reference:
    <script type="text/javascript">
    function iframeLoaded() {
    var iFrameID = document.getElementById('idIframe');
    if(iFrameID) {
    // here you can make the height, I delete it first, then I make it again
    iFrameID.height = "";
    iFrameID.height = iFrameID.contentWindow.document.body.scrollHeight + "px";
    </script>
    More information:
    How To Adjust IFrame Height on Its Content
    http://www.codeproject.com/Articles/19499/How-To-Adjust-IFrame-Height-on-Its-Content
    Best Regards
    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]

  • I tried to buy an app and itunes keeps asking for a security code.  What is a security code?  I do not have one.  I have a password.

    I tried to buy an app and itunes keeps asking for a security code.  What is a security code?  I only have a password! And ID

    Are you using a credit card?
    http://store.apple.com/au/help/payments#creditus
    Security codes
    The credit card security code is a unique three or four digit number printed on the front (American Express) or back (Visa/MasterCard) of your card.

  • Can I have 1 Apple ID for apps and 1 Apple ID for iCloud

    I would like to have 1 Apple ID for purchasing apps and 1 Apple ID for iCloud. Is that possible? If I need to use the iCloud ID for apps, will it get rid of my old apps?

    Yes you can.  Changing your ID won't get rid of any of your previous purchases.  You just won't be able to redownload them from iCloud.  (They are permanently tied to the ID you used to purchase them and you can't switch IDs and redownload under the new ID for 90 days - see http://support.apple.com/kb/HT4627).  So be sure to transfer them to your iTunes library by connecting your phone to your computer, opening iTunes and going to File>Devices>Transfer Purchases.  That way you can sync them back at any time without worrying about having to redownload them.

  • On several of my apps my iPad 2 w/ IOS 4.3.3 said I needed to update the apps and the updates were for ios4.3.3 but now the apps don't work at all after updating.  They just flash on the screen but don't stay displayed.  What is going on?

    On several of my apps my iPad 2 w/ IOS 4.3.3 said I needed to update the apps and the updates were for IOS4.3.3 but when the update was complete the apps would no longer work.  They would just flash when I tapped the screen to bring them up but will stay displayed.  What is the problem?

    I Also have this problem!!
    In my situation, the screen simply started exhibiting the same symptoms a few weeks ago (early February) for no apparent reason.  At first I thought the screen was dead, but discovered the heat solution by accident.  Now I turn it on and keep it from going to sleep until I go to bed.  Thank goodness the battery is still awesome on this thing.
    I bought it new and still has the original screen, I keep it at home (never below 62 degrees).  Coincidentally, this happened a day or two after the expiration of the warranty!!  Any help figuring this one out would be eternally appreciated.
    iPad mini retina Wi-Fi, iOS 8.1.3

  • Trying to upload an app and it is asking for my developers ID i registered but dont know where to find that Id number I have used my apple ID but it seems to be different

    trying to upload an app and it is asking for my developers ID i registered but dont know where to find that Id number I have used my apple ID but it seems to be different.

    Ended up calling apple and got this fixed. Had to change id since it was made years ago with the old style of IDs.

  • How to fetch APPROVER NAME  and approval date dynamically for an user

    Hi all..
    How to fetch approver name and approval date dynamicall for an user in an email template..
    can any help me to sort out this pbm,i am new to IDM..
    Thanks in advance..

    Access policies get a static value.  You can't populate a field with an adapter.  If you must do this, leave the field blank, and put an adapter on the process form for your field that must be populated using code or logic.
    -Kevin

  • I am trying to re-download some songs I deleted by mistake.  I go to purchases and it only shows me options for Apps and Books, no list for Music.  How can I get the music list to show up or alternatively how can I re-download the songs?

    I messed up and deleted a few songs by mistake.  When I go to the "purchases" option it only lists apps and books that have been downloaded, but music is not an option to see what was downloaded previously.  Anyone know how I can re-download the songs ?
    Thanks for any help!  I am using the most recent version of iTunes.

    I have been having the same problem.. and yes, I am in the US.  I have tried reinsatllin gitunes several time and that doesn't work either

  • I dont know what wrong with my Apple ID , when i tried to updated my apps and the always asking for payment?

    i try to updated my apps and download free apps but my Apple id keep asking for payment, the exacly massage is " before you can make purchases you must tap OK , then verify your payment. before i used to have NONE but after i buy some Apps i put my debite card number. after that i want to change to be none again but None is not show... now i cannot update anything or even download free apps

    I have the same problem - it is maddening. I rely on this iPad for work so this is not just an annoyance! The above solutions of changing the appleid on the device or on the website do not work.
    The old email address no longer exists - I haven't used it in a year probably and I no longer have the account.  I logged into the appleid website and there is no trace of the old email address so there is nothing that can be deleted or changed there.  On the iPad there is no trace of the old email address so nothing can be deleted there either. I have updated the iPad software and the same problem comes right back.  Every 2 seconds I am asked to log in using the old non-existent email.  The device is currently useless.
    The only recent change to anything was the addition of an Apple TV device, which was set up using the correct login and password.
    Does anyone have any ideas? The iPad has been backed up to the iCloud so presumably it now won't recognize the current iCloud account? So restoring may notbe an option?

  • HT204266 I upgraded an app and it charged me for 2 of them what can i do???

    Please help I upgraded an app and got charged for 2 of them what can I do?

    To Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Is it possible to override the SecurityFilter class so that I can use it for my external app which is deployed in ToolsAndFramework and needs to validate for same user/password as is being used to log in experience manager?

    I have created a java app and deployed in ToolsAndFramework of endeca and since that app can be accessed through a directl url so want to implement an security filter which will use the same user validation as is used in experience manager.

    Sorry to hear that, but this forum is for us, users, and what you need is someone from Xperia Care to find your motherboard and send it back, I don't think it'll be possible to retrieve any data from a broken motherboard. 
    "I'd rather be hated for who I am, than loved for who I am not." Kurt Cobain (1967-1994)

  • I put my ipad into dfu mode, by mistake, and now have to restore it. Can I redownload all the paid apps (And Books) on it for free?

    This was a TOTAL mistake. I had no idea what I was doing. I put my iPad into DFU mode, and now have to restore it. (That didnt end well, knowing I had just bought a bunch of books and apps) I want to know, after I restore my iPad can I go into the app store or iBooks and redownload the books and apps I had originaly payed for? Thanks for the help

    Yes, App Store and iBooks have a "Purchased" tab, allowing you to re-download at no additional charge.
    But that may not be necessary if you restore from a backup. You might be able to get all of your content back from the restore.

  • I just downloaded the Chambers Thesaurus app and paid $7.45. Then I saw the OED app and paid $25.99 for that. Now I find, to my surprise and disgust that these two apps are identical in every way. What's going on?!

    I just downloaded the Chamber Thesaurus app and paid $7.45.
    Then I saw the suggestion for the Shorter OED app, so I downloaded that and paid $25.99.
    Now I find, to my surprise, disbelief and disgust that both apps are identical in every way.
    This is a blatant rip-off. I demand an immediate expalnation and a full refund.
    Unbelievable.

    NEITHER of those products are made by Apple. They simply make them available in the App Store ,and NO ONE here can help with billing issues.
    http://www.apple.com/support/itunes/account/
    You can contact billing about a refund there, but I've heard that ALL sales are final through the app store.

  • What's the best phone app to use on iPad for uk users to make calls with

    I know there's a few apps out there to use and make phone calls with, but which is the best one for uk users/callers.
    I would prefer not to use Skype but if that's the best on the market, that's what I will use.
    As you can probably guess I'm new to the iPad, so all the help I get is appreciated loads.

    Cheers for that, looks like I will have to use Skype then. Unless someone else comes up with an answer.

  • Novell delivered apps have to re-verify for each users

    Everytime a new user uses an app on a PC through the zenworks window it
    has to re-verify the app, even though it has been delivered (installed).
    Is there a way to stop this and only run a verify when we want to
    manually.
    Also, these app packages are located in ConsolOne and we associated them
    via PC, not user.
    Any advice would be great! Some of our sites have slow connections and
    it's frustrating making a user wait for an hour just to reverify
    Groupwise on a PC they haven't used before. Thanks again.

    To a certain extent this is how ZEN operates and the next version will
    be adding some exciting options.
    What I Have done to eliminate some of the reinstalls is to
    1) Create a "Launch App" that only launches the executable but does not
    have an associated install.
    2) Create an "Install App" that installs the Application.
    3) Set in the 1st app a "Fault Tolerance Setting" pointing to the 2nd
    application.
    The result is that the App will install if it is not yet installed.
    If it is installed, it will not reinstall.
    However, users will need to select "verify" on the 2nd app instead of
    the launch app.
    [email protected] wrote:
    > Everytime a new user uses an app on a PC through the zenworks window it
    > has to re-verify the app, even though it has been delivered (installed).
    > Is there a way to stop this and only run a verify when we want to
    > manually.
    >
    > Also, these app packages are located in ConsolOne and we associated them
    > via PC, not user.
    >
    > Any advice would be great! Some of our sites have slow connections and
    > it's frustrating making a user wait for an hour just to reverify
    > Groupwise on a PC they haven't used before. Thanks again.
    >
    >

Maybe you are looking for

  • Reg Error while Posting A/P Invoice

    Dear All , Hope everyone is doing their best. I have an issue regarding A/P Invoice with Withholding Tax Liable. When ever i am adding A/P Invoice with WT Liable yes then system will show message for withholding tax will be calculated . Open the whit

  • Bill of Exports w.r.t Special Economic Zone (SEZ's sales)

    Dear All, Issue is regarding Bill Of Exports Scenario applicable to the Customer who belongs to Special Economic Zones (SEZ’s). We have two Cases: 1.     SEZ sales With Duty Draw Back i.e., Bill of Export of goods claim for duty drawback. 2.     SEZ

  • ITunes will not open iTouch 2G on device

    iTunes will not open on my iTouch 2G and on my Dell laptop running windows & ultimate. Help!  S.O.S.

  • BIP truncating long varchar2 values?

    Okay, I readily admit I'm new to BIP, and I may well be making a stupid newbie mistake here. I have a relatively simple query defined for a report: select cio_s_num, potential_source from cio_s_format order by cio_s_numwhich is hitting an Oracle 10g

  • Lock Box Problem

    Hi I am trying to configure lockbox. I have done the following a. Got the bank to provide me with the flat file format that they are using . b. Wrote a .ctl file and saved it in AR_TOP/bin c. Cofigured the Transmission format according to the .ctl an