Hello,<br><br>With Twisted and Nevow I&#39;m building an XML-RPC server that does HTTP authentication. So a basic XML-RPC client can login using <a href="https://user:passwd@host">https://user:passwd@host</a>. I can get the credentials with HTTP authentication, but how can I check the credentials. I&#39;d tried calling 
guard.SessionWrapper.login(....), but I get the error: &quot;<a name="tracebackEnd">exceptions.TypeError: unbound method login()
must be called with SessionWrapper instance as first argument (got
NevowRequest instance instead)&quot;.<br><br>So I&#39;m guessing that request.getSession() is wrong and I must get the session of the guard (or something similar). Or I&#39;m calling the wrong function to check the creds. In the guarded.py example from Nevow the credentials get checked thru a html form, but that is not what I want. 
<br><br>Below is an example part of my code:</a><br><br>class RootPage(rend.Page):<br>&nbsp;&nbsp;&nbsp; ## We are a directory-like resource because we are at the root<br>&nbsp;&nbsp;&nbsp; addSlash = True<br>&nbsp;&nbsp;&nbsp; ## Doesn&#39;t work<br>&nbsp;&nbsp;&nbsp; def tryLogin(self, ctx, request):
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session =&nbsp; request.getSession() <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; segments = inevow.ICurrentSegments(ctx)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; httpAuthCredentials = (self.data_username,self.data_password)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return guard.SessionWrapper.login(request, session, httpAuthCredentials, segments).addCallback(self._loginSucceeded).addErrback(
self.loginFailed)<br><br>&nbsp;&nbsp;&nbsp; def renderHTTP(self, ctx):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; request = inevow.IRequest(ctx)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; username, password = request.getUser(), request.getPassword()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ## No REAL authentication yet, must implement it.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (username, password) == (&#39;&#39;, &#39;&#39;):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; request.setHeader(&#39;WWW-Authenticate&#39;, &#39;Basic realm=&#39;+cfg.app_name)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; request.setResponseCode(http.UNAUTHORIZED)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return &quot;Authentication required.&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ## They provided a username and password, so let&#39;s let them in! horray<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.data_username, self.data_password = username, password<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
self.tryLogin(ctx, request)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return rend.Page.renderHTTP(self, ctx)<br><br>&nbsp;&nbsp;&nbsp; docFactory = loaders.stan(tags.html[<br>&nbsp;&nbsp;&nbsp; tags.body[<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tags.h1[&quot;Welcome user!&quot;],<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tags.div[&quot;You said: &quot;,
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tags.span(data=tags.directive(&#39;username&#39;), render=str),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot; &quot;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tags.span(data=tags.directive(&#39;password&#39;), render=str),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tags.a(href=guard.LOGOUT_AVATAR
)[&quot;Logout&quot;]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]]])<br><br>Regards,<br><br>Kim Chee Leong<br><br>