problem with clientcontext excuting anonymous
-
Friday, January 29, 2010 9:55 PM
Hi everybody i have a example which i use to create a bing map.
What happens is when i try to execute the query it returns security error.
The site that it is connecting to is anonymous i think this is why the problem exists.
It seems that the clientcontext may not read items of a list if the current user is anonymous.
does anybody have a workaround for it?
context = new ClientContext(@httP://kbworks.nl/portfolios);
if (context == null)
throw new Exception("Connection failed!");
Web web = context.Web;
String listName = "Customers";
ListCollection lists = web.Lists;
IEnumerable<List> resultLists = context.LoadQuery(lists.Where(list => list.RootFolder.Name == listName));
context.executequery();
thanks in advance,
Paul Keijzers
Check my website http://www.kbworks.nl or follow me on @KbWorks be sure to Check my KbWorks blog
All Replies
-
Monday, February 01, 2010 9:08 PM
you can try this: (I haven't tested it yet)
context.AuthenticationMode = ClientAuthenticationMode.Anonymous;
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.clientruntimecontext.authenticationmode%28office.14%29.aspx
Hope this helps
Serge
Serge Luca; blog: http://sergeluca.spaces.live.com Devoteam Belgium- Proposed As Answer by Aviw_ Monday, March 05, 2012 10:46 AM
- Marked As Answer by Margriet Bruggeman Friday, March 30, 2012 9:29 AM

