SharePoint Online cross-origin framing, changing page in autohosted MVC app

Hi
I have created SharePoint Autohosted app on MVC5 template. I have created a controller and the Index view associated with it. The view is responsible for showing the user a list of announcements, taken from database and passed to the view through the model.
In the layout page for this view I have the link for Create Announcement view which is in the same Announcements folder, and the same controller is responsible for showing it. When I include the app in the page using Client Web Part the Index view is showing
correctly, and I can see the hyperlinks to Create Announcement page. When I click the link I am presented with blank page within the webpart container and in Firebug I can see:
Load denied by X-Frame-Options: https://GUID.o365apps.net/Announcements/Create?SPHostUrl=site_collection_address does not permit cross-origin framing.
Why? This is the same domain, right?
I have already tried <webpartpages:allowframing runat="server" /> and httpmodules. Those do not work. BTW Why?
I am really frustrated, please give me some advice what to do.
Thanks in advance

Alright, this is freaking riddiculous. I have found the issue after 8 hours of digging in this mud. This little jebaka was in the Create view markup:
@Html.AntiForgeryToken()
And this also has to be thrown out as far as possible:
[ValidateAntiForgeryToken]
from every method which is decorated with it (ie. all POST methods)
I know, I know, security blah blah blah.
If the app is not working at all, there is no need for security.
I still hope for a word of explanation from someone from M$. I would really be pleased to know how should it be done in the right way.

Similar Messages

  • Cross Site Publishing in SharePoint Online

    I was asked to test Cross Site Publishing features in SharePoint 2013 Online. I saved the Authoring site collection's (Used Team Site's Template since Product Catalog Template not avialable in SP Online) Pages library as a Catalog. When I connected that
    catalog in my Publishing site collection, 2 pages created automatically. Category Page is showing the content, but CatelogItem page is empty. How can I configure Content Search Web Part to show the Page Content of the Authoring Sites's page?
    Can we show Authoring sites Pages libraries page content on the publishing site?
    Is this possible in SharePoint Online Cross Site Publishing?

    Hi,
    Thanks for sharing!
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Sharepoint online powershell. Change property of webpart

    In addition to my previous question:
    http://social.msdn.microsoft.com/Forums/office/en-US/fadcd297-32af-41bb-8132-60e987eccb3a/sharepoint-online-powershell-and-csom-change-listview-and-put-it-on-a-page?forum=sharepointdevelopment
    In SharePoint online I want to change the property of a webpart. In this case I have a list of which I have changed the view (using powershell) but on the page (default.aspx) the view is not changed. So I guess if I change the view property of the webpart,
    my problem will be solved. I tried to use the "GetLimitedWebPartManager
    " but I do not get that running on Office365 as it is not part of the Microsoft.sharepoint.client.clientcontext, which I use to connect to the Office365 teamsite.
    Are there any suggestions?
    Thanks, Mike

    Hi,
    According to your post, my understanding is that you want to webpart view proproty in SharePoint Online.
    As your environment is SharePoint Online, I suggest you can achieve it using Client Object Model. In Client Object Model, there is such API called LimitedWebPartManager.
    More information about LimitedWebPartManager Class:
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.webparts.limitedwebpartmanager(v=office.15).aspx
    http://msdn.microsoft.com/en-us/library/office/ee539301(v=office.14).aspx
    http://www.enjoysharepoint.com/Articles/Details/change-webpart-title-using-sharepoint-client-object-model-258.aspx
    Best regards,
    Zhengyu Guo
    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

  • Add Right Side Column and Web Parts to custom Master page in SharePoint Online

    Hello everyone, 
    I hope this is a simple question, however I was fighting the issue it presents for a while. I am in the process of customizing SharePoint Online Look-and-feel with a new layout.
    The site collection was created as a
    Team Site before I got involved with the project, and populated with numerous sub-sites and pages. I activated required
    publishing features, created html with corresponding styles and graphics, and used the Design Manager to convert the html file to the custom Master page. While SharePoint automatically assigned “ContentPlaceHolderMain” div area, I
    also used default Oslo page as example to copy sections of the code for dynamic components (left column and navigation, recent items, the ribbon, etc.) from it and placed them in my new master page, pointed all CSS references to
    my custom style sheets, etc. Everything works great, however I need to make one last addition -
    my task is to make changes to display web parts such as Calendar and Recent Documents in the right column in the Master page.
    My custom layout has a header, footer, main pan and two side columns. Most of the default master templates come with the LEFT column already embedded and populated with several placeholder
    to serve dynamic content (PlaceHolderLeftNavBarTop, PlaceHolderQuickLaunchTop, PlaceHolderLeftNavBarDataSource, PlaceHolderLeftActions, so on).
    My challenge is that I have the RIGHT side column as well, for which I don’t think the default placeholder exists. I need to add a small Calendar box and Recent Documents parts to it, so they
    display across the entire site governed by this master page.
    The issue is –
    even after activating Publishing features (enabled SharePoint Server Publishing Infrastructure under Site Collection Level, and SharePoint Server Publishing under the Site
    Level), there is no Snippet feature (usually available under the generic Publishing Site); this customization of the Team Site allows using Designer and apply custom templates, themes, so on, just like you would under the Publishing collection, but not the
    Snippet utility I could use as the solution to embed the web parts on the master page.
    Recreating the entire site under Publishing Collection is not an option due to the directions I was given, I am to use this existing one, and need to see if
    there is a workaround to either activate the Snippet feature or use another solution to display the web parts inside of the column in the Master page.
    If the only solution is to use Web Part Zone, what are the steps to add it AND populate it with the abovementioned apps?
    Can anyone suggest how to create a workaround and add this feature? The environment is role-based so both elements need to be dynamically rendered based on the user’s role and activities.
    I am more of a front end designer than developer, so if any custom coding and set up required, please kindly provide some basic steps, if possible?..
    I greatly appreciate any help and suggestions!
    Thank You!
    Jeff
    Jeff V.

    Updating your Master Page to also include a right rail should be sraight forward enough with a new div or divs in your master page and then the proper styles to make room for this column as well as position the column.
    I have not seen why you cannot find the snippet gallery link when previewing a HTML Master Page in the browser. Have you tried loading the snippet gallery by its url? As an example, for my tenant on SPO, I can load the Snippet Gallery for the olso.master
    with the following url:
    https://pixelmill.sharepoint.com/_layouts/15/ComponentConfigureControls.aspx?ComponentName=TopNavigationNoFlyoutWithStartNode&Url=%2F_catalogs%2Fmasterpage%2Foslo.master
    Change the domain to match yours as well as update the "Url" querystring var to point to your master page. See if that loads the snippet gallery.
    Eric Overfield - PixelMill -
    ericoverfield.com -
    @EricOverfield

  • Cross domain call to Azure ASPX from SharePoint Online Site Collection

    We have a ASPX page hosted on Azure that is creating a Zip of documents from a SharePoint Document Library against IDs that we are passing it through query string. Next we are flushing this ZIP as a download response to the client
    browser so that user can save it somewhere on his machine. This is working as expected.
    Next we are calling this ASPX from our SharePoint Online Site Collection. Sometime it takes time to create the ZIP & return to the client and therefore we want to implement a Progress Image showing something is happening at the server. We
    have used window.open() method to call this ASPX and at the same time we are showing up the Progress Image. But due to same origin policy we are not able to track any window specific events in Internet Explorer to close the Progress Image when the response
    returns to the client.
    Please suggest a suitable workaround for this scenario. Any help would be greatly appreciated.
    Thank you in advance!
    Jitendra

    Hi Jitendra,
    According to your description, my understanding is that you want to call a aspx page hosted on Azure from SharePoint Online site and implement a progress image to show the progress happening at the server.
    In your scenario, if you want to call the aspx page on Azure to create zip and return to the client, the better way is createing a web service and call it in clinet side. You can add the progress status in the custom code and then judge the status to
    show correponding progress image.
    Here is a detailed article for your reference:
    How to Create and Deploy a Cloud Service
    Best Regards
    Zhengyu Guo
    TechNet Community Support

  • How to redirect a sub domain to a specific page in Sharepoint Online

    Hi, 
      My Organisation has a O365 account, and hoisted the public website on it, now user requests to have a friendly url for a specific page on the public website.  I've added a sub domain on O365.  but i cant find ways to redirect this domain
    to the page.  How can i do so? 

    Hi,
    If you need to redirect the sub domain to a specific page in SharePoint Online, you need to rename the Public Website with the sub domain.
    Then configure the friendly URL for the page in the Public Website.
    http://office.microsoft.com/en-001/office365-sharepoint-online-enterprise-help/upgrade-your-public-website-HA102801184.aspx?CTT=5&origin=HA102828142#_Step_5_%E2%80%93
    Or you can use the managed metadata navigation for the Public Web site and configure the friendly URL for the page.
    http://jeffkelly.com/2014/05/office-365-public-website-what-no-managed-metadata-mms-navigation/
    In the meanwhile, you can post your question to the forum for Office 365: http://community.office365.com/en-us/f/default.aspx.
    More experts will assist you, then you will get more information relation to SharePoint Online.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • How to enable cross origin support in SharePoint

    Could someone please help me to enable cross origin (CORS) support on SharePoint 2010. I am following steps mentioned in http://www.avanadeblog.com/sharepointasg/2013/01/cors-request-to-sharepoint-with-basic-authentication.html and http://evolpin.wordpress.com/2012/10/12/the-cors/
    but getting 401 unauthorized error.
    Thanks,
    Manas

    Hi Manas,
    Did you wirte a custom HTTP Module ?
    As the above articles said, “There is a known Problem in IIS 7 with preflight requests (more information on preflight requests can be found here).
    When using CORS you have to deal with this type of Requests because they send an HTTP Options request to determine whether it is safe to process the request or not. As you are going to enable Basic Authentication IIS 7 is expecting to get some credentials
    also with the options request and that will fail with a 401 (Unauthorized). “
    The solution to this is writing a custom HTTP Module that changes the response header to any OPTIONS Request from 401(Unauthorized) to 200 (OK).
    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

  • Change document file name via workflow - SharePoint Online

    Is it possible to change the filename of document uploaded in sharepoint online/onpremises using workflow?
    We would like to have documents uploaded to sharepoint but unfortunately some have the same name and this from a folder structure :(
    When i used a workflow and use set i keep getting error.
    Thanks in Advance

    Hi,
    We can create a calculated column and use SharePoint designer workflow to achieve your requirement.
    More information is here:
    http://www.oracular.com/site/index.php/easyblog/workflows-that-rename-files-part-1
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Opening a aspx page on IFrame in SharePoint online

    Hi I m developing an app for SharePoint Online 2013. I want to open a aspx page (from my project ) on a Iframe as follows. 
    Default.aspx page as follows 
    <button type="button" id ="Button1" name="Button1">Click Me!</button> 
    <iframe name ="frame1" id ="frame1"  width="800" height="800" runat="server" ></iframe>
    App.JS File as follows 
    $(document).ready(function () {
    $("#Button1").click(function() {
        redirectPage();
    function redirectPage() {
    document.getElementById("frame1").src = "/Pages/Default1.aspx";
    This is not working can someone please help me. Thanks.
    d.n weerasinghe

    Hi,
    Thank you very much for your reply. I have managed to work it as you mentioned I had to remove the "Runat server".
    But Still I cannot display a SharePoint page on a Iframe.
    I m tryng to do this
    <li><a OnCLICK="document.getElementById('frame1').src = 'https://xxxx-my.sharepoint.com';" >Personal Address</a></li>
    Then I get the following error
    "To help protect the security of information you enter into this website, the publisher of this content does not allow it to be displayed in a frame"
    I have added the following code to mysite.master page on the saharepoint , still now working . Any help please.
    <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <WebPartPages:AllowFraming  runat="server" __WebPartId="{D6E530AE-958F-4E81-B06F-AA5AC60DFF94}" />
    d.n weerasinghe

  • Workflow to change file permission in SharePoint Online Document Library

    1.What are my options with SPD 2013 If I want to change a documents file permission in a workflow?
    2.Where does SPO host 2013 Workfows?
    3.If connecting to SPO Can I use Worklow Manager 1.0?
    4.Will I need to host my Workflow Manager workflows on server or Azure if running against o365/SPO?
    5.If I wish to create SPO 2013 workflows with Visual Studio 2012, what do I need and will I be limited to actions I see in SPD 2013?
    ============================
    Thank You
    cyberpine.com

    You can host this workflow as a SharePoint App in SharePoint Online or use SharePoint Designer to create this workflow as long as you use the app step. Managing the permissions can be done with a REST call.  The initiator of the workflow must have
    been granted the right to "Manage Permissions" and the app must have full control of the Site Collection.   We have done so for several of our clients.   I know you asked this question some time ago, but I thought the info might still be helpful.

  • SharePoint Online, Stop Workflow when Item Changed

    Hello,
    I have a workflow that sends an email to certain individuals upon creation and then sends a follow up reminder in 30 days if a specific field has not been changed.  I want to edit that workflow to only send the reminder if the list item has not been
    changed since creation (ie: modified date is after created date).  Then create a second workflow that starts once the item is changed to send a different reminder email if the list item has been updated but not completed.
    The problem I am having is that the workflow that sends the initial email is technically "changing" the list item and therefore triggering the second workflow which I don't want to happen.  I tried to use the "If any value equals value"
    condition on the "created" (date/time) and "modified" (date/time) fields but sending the initial email changes the modified field so they're never equal.
    If there were a way to define a timestamp as [created date/time + X] I could set X to be 1 miute and then use the greater than or less than functions of the "If any value equals value" condition to make this work.  Doesn't seem possible
    to do.
    Does anybody have any ideas of how to get around this?
    I'm using SharePoint Online with O365 if that makes a difference.
    Thanks,
    Jared

    add a column called 'start next workflow' which should be a Boolean with a default value of NO
    in your first workflow, only at the point it should end, make the last action to change this new field to YES
    in your second workflow, add a condition so that it only runs if this field is set to YES
    Regards
    Sergio Giusti Sergio Blogs
    Linked
    In Profile
    Whenever you see a reply you think is helpful, click Vote As Helpful.
    Whenever you see a reply you think is the answer to the question, click Mark As Answer.

  • Change default language for SharePoint Online Sub-Site

    Hi Guys,
    Am trying to create multiple sub-sites using a custom site template in SharePoint Online. The default language of the Site Template is English. But I want to create sites for difference languages.
    There is a option to setup multiple languages on the site and change the browser preferences. But we want that anyone irrespective of the language, should see the site in the language it has been configured for, For instance France site should display data
    in French irrespective of any user see it.
    To accomplish this, I was trying to find if there is a way to change the default language of the site after we create it.
    Can some one give me an idea if we can achieve this behavior or if there an alternate to do it ?
    Thanks,
    Nutan
    Nutan Sharma

    Hi,
    According to your post, my understanding is that you want to change the default site language.
    There is no supported way to change the default language of a site collection, once it has been created.
    There is a way to change it by modifying the content database using SQL Management Studio(though it is not supported), you can refer to the article below to change the default language in an existed site.
    http://sharepointchick.com/archive/2008/04/29/changing-the-language-of-an-existing-sharepoint-site.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

  • How to convert word documents to html page in sharepoint online 2013

    Hi,
    I am new SharePoint and still learning it.
    I have been tasked to do the following on office 365 E3 SharePoint 2013 Online edition.
    1) I have to create a Web page in asp.net
    2) This page needs to show document from a given SharePoint folder and bind them in a grid or dropdown on the asp .net web page
    3) On selecting the document from the drop down or gird (on asp .net webpage), I need to show the SharePoint word document as HTML on the webpage (something like word to html) Note: These SharePoint word document may contain Images, bullets, tables etc. 
    What I have been able to do till now
    1) I have been able to connect to SharePoint from ASP .net application.
    2) I have been able to retrieve document from a specific SharePoint folder.
    3) Read the document from SharePoint folder and bind them to a drop down on the asp .net page.
    What is missing?
    I am not aware about any API that SharePoint Online provides to convert Word document to HTML. Any code sample or reference on how to will be much appreciated. 
    I am not also not sure what is the best way of achieving the functionality this?
    Thanks 
    Krishna

    If this was SharePoint server then it would be easy however in O365 You need to create a app which will use the word automation service and below is  powershell which you can use for the conversion:-
    # This script will convert Docx to PDF using word automation and similarly it can be used to convert to HTML
    $wordFile="http://contoso/kick.docx"
    $pdfFile="http://contoso/kick.pdf"
    $wasp = Get-SPServiceApplicationProxy | where { $_.TypeName -eq "Word Automation Services Proxy" }
    $site = Get-SPSite "http://contoso"
    $ConvertJob = New-Object Microsoft.Office.Word.Server.Conversions.SyncConverter($wasp)
    $ConvertJob.UserToken = $site.UserToken
    $ConvertJob.Settings.UpdateFields = $false
    $ConvertJob.Settings.OutputFormat = "PDF"
    $ConvertJob.Convert($wordFile, $pdfFile)

  • Yammer recent activity in SharePoint online page

    I want to display recent yammer activity on SharePoint online page. can any body explain is it possible?
    if yes then how?
    regards
    Kapil

    Hi Kapil,
    here you are
    https://support.office.com/en-us/article/Yammer-App-for-SharePoint-Add-a-Yammer-feed-to-a-SharePoint-page-8023e402-5ca3-4ef4-a2da-37215aa75f49?CorrelationId=0f6c830a-d2bb-438a-ba1b-f0f847779a95&ui=en-US&rs=en-US&ad=US
    http://blogs.msdn.com/b/chhopkin/archive/2013/11/20/yammer-embed-and-sharepoint-2013.aspx
    http://www.alexandervanwynsberghe.be/integrate-your-yammer-feed-into-sharepoint-online/
    http://modery.net/adding-your-yammer-feed-to-sharepoint-office-365/
    Kind Regards,
    John Naguib
    Senior Consultant
    John Naguib Blog
    John Naguib Twitter
    Please remember to mark this as answered if it helped you

  • How to show property bag values of site collection in web part on landing page in sharepoint online?

    How to show property bag values of site collection in web part on landing page in sharepoint online - office 365?

    You can use JavaScript Client object model to read the property bag values. Example:
    function getWebProperty() {
    var ctx = new SP.ClientContext.get_current();
    var web = ctx.get_site().get_rootWeb();
    this.props =  web.get_allProperties();
    ctx.load(web);
    ctx.load(this.props); //need to load the properties explicitly
    ctx.executeQueryAsync(Function.createDelegate(this, gotProperty), Function.createDelegate(this, failedGettingProperty));
    function gotProperty() {
        var myPropBag = this.props;
        alert(myPropBag.get_fieldValues()["allowdesigner"]); //returns the value of the key allowdesigner
    function failedGettingProperty(args, sender)
         //handle errors here
    Source:
    http://sharepoint.stackexchange.com/questions/37198/grab-a-specific-property-bag-using-ecma-script
    Blog | SharePoint Learnings CodePlex Tools |
    Export Version History To Excel |
    Autocomplete Lookup Field

Maybe you are looking for