Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have used Javascript and sharepoint client object model to add a list item to a list. I am working with a sharepoint 2013 online public site. I have a content editor with the following javascript code.

  var clientContext = new SP.ClientContext.get_current();

  var web = clientContext.get_web();

  var list = web.get_lists().getByTitle('Subscriptions');

  var email = document.getElementById('email').value;   

  // Create a new list item 
  var itemCreateInfo = new SP.ListItemCreationInformation(); 
  var listItem = list.addItem(itemCreateInfo);           

  listItem.set_item('Title',email );

  listItem.update(); 

This code works fine for the user who has permission. it will add a element to the subscription list. But it fails when we use this for a Anonymous user. After searching I found that that there is a tool : http://anonymous365.codeplex.com/.

But it did not work from the code though i gave anonymous access to the list.

Please suggest me a way to overcome this.

Thanks,

share|improve this question
add comment

1 Answer

Access to SharePoint Online requires an authenticated session of some variety. The only site that is available for public (anonymous) access is the pre-provisioned "public site" that is available with certain subscriptions which is meant to host a standard corporate website. A sample project that shows how to support claims authentication with SPO can be found here: http://code.msdn.microsoft.com/office/Remote-Authentication-in-b7b6f43c/

share|improve this answer
    
Thanks for the Answer. Seems like I cannot achive this only by Javacript. We need to have Managed client object model with c#. –  PleaseHelp Nov 25 '13 at 14:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.