svick/LINQ-to-Wiki

Can't connect to private wiki

magol opened this issue · 0 comments

magol commented

I have a private wiki where the users must log in to access the content.
When I try to do

var wiki=new Wiki("foo","http://mywiki.com");

I get following exception:

LinqToWiki.ApiErrorException was unhandled
  Code=readapidenied
  HResult=-2146233088
  Message=You need read permission to use this module
  Source=LinqToWiki.Core
  StackTrace:
       at LinqToWiki.Internals.QueryProcessor.Download(WikiInfo wiki, IEnumerable`1 processedParameters, IEnumerable`1 queryContinues) in c:\code\LinqToWiki\LinqToWiki.Core\Internals\QueryProcessor.cs:line 179
       at LinqToWiki.Internals.QueryProcessor.Download(WikiInfo wiki, IEnumerable`1 processedParameters, HttpQueryParameter queryContinue) in c:\code\LinqToWiki\LinqToWiki.Core\Internals\QueryProcessor.cs:line 144
       at LinqToWiki.Internals.QueryProcessor`1.Download(IEnumerable`1 processedParameters, HttpQueryParameter queryContinue) in c:\code\LinqToWiki\LinqToWiki.Core\Internals\QueryProcessor.cs:line 103
       at LinqToWiki.Internals.QueryProcessor`1.ExecuteSingle[TResult](QueryParameters`2 parameters) in c:\code\LinqToWiki\LinqToWiki.Core\Internals\QueryProcessor.cs:line 76
       at LinqToWiki.Internals.NamespaceInfo.GetNamespaces(WikiInfo wiki) in c:\code\LinqToWiki\LinqToWiki.Core\Internals\NamespaceInfo.cs:line 46
       at LinqToWiki.Internals.NamespaceInfo..ctor(WikiInfo wiki) in c:\code\LinqToWiki\LinqToWiki.Core\Internals\NamespaceInfo.cs:line 29
       at LinqToWiki.Internals.WikiInfo..ctor(String userAgent, String baseUrl, String apiPath, IEnumerable`1 namespaces) in c:\code\LinqToWiki\LinqToWiki.Core\Internals\WikiInfo.cs:line 70
       at LinqToWiki.Generated.Wiki..ctor(String userAgent, String baseUri, String apiPath) in c:\Users\Svick\AppData\Local\Temp\LinqToWiki\Wiki.cs:line 32

I allow get this exception if I try to use linqtowiki-codege

It must be a way to give username and password in the constructor, or it must not try to access the wiki before login if it do not have access.