开发者

Mono webservice and basic authentication

I'm trying to add basic au开发者_运维知识库thenthication to my webservice. I followed steps from this article and ended up with this in my web.config file:

<configuration>
<httpModules>
    <add name="BasicAuthenticationModule" 
     type="Mono.Http.Modules.BasicAuthenticationModule, Mono.Http, Version=2.0.0.0, PublicKeyToken=0738eb9f132ed756"/>
  </httpModules>
  <appSettings>
    <add key="Authentication" value="Basic" />
    <add key="Basic.Users" value="/home/vadmin/Projects/TestService/TestService/users.xml" />
    <add key="Basic.Realm" value="My Realm" />
  </appSettings>
</configuration>

My users.xml looks like this:

<?xml version="1.0" encoding="utf-8"?>
<users>
<user name="adrian" password="adrian">
    <role name="user" />
</user>
</users>

When I run xsp2 and then go to

http://localhost:8080/TestService.asmx

user and password prompt appears. But after I enter correct user and password it asks me again and again. I'm pretty sure that path to users.xml file is correct, tried running xsp2 with --verbose options hoping for some error messages with no luck.

Can anyone help me debug this situation?


If you specify a path starting with / in config file, this will be interpreted not as a root directory of your filesystem, but as a root directory of your website - i.e. /home/vadmin/Projects/TestService/TestService.

So the path starting with / should be relative to website root folder - in your case this will be "/users.xml" if users.xml file is in project folder.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜