【发布时间】:2013-09-22 10:55:00
【问题描述】:
我在 C#/Mono 的 Apache2 下使用 ServiceStack 运行 Rest-Service。 Apache-Server 正在使用 SSL 和带有 htpasswd 文件的 BasicAuthentication。
如果我访问我的 Rest-Service,我会得到 apache 的 auth-Request,这很好。验证我的 RestService 后访问。现在我的问题是:我如何才能获得请求服务并对其进行身份验证的用户(apache-session 用户)? 我已经尝试获取 Environment-Variables,但没有获得所需的信息。
据我所知,ServiceStack 的内置身份验证需要我自己实现身份验证。但是我想使用apache的认证。
有人知道解决办法吗?
问候 每天
附: 以下是我的 Apache 站点配置的 Mono 和 SSL 相关部分:
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
SSLOptions StrictRequire +StdEnvVars
SSLProtocol all -SSLv2
MonoServerPath wcs.service.de "/usr/bin/mod-mono-server4"
MonoDebug wcs.service.de true
MonoSetEnv wcs.service.de MONO_IOMAP=all
MonoAutoApplication disabled
MonoApplications wcs.service.de "/:/var/www/wcs"
【问题讨论】:
-
我找到了解决办法!它由 ServiceStack RequestFilter、原始 ASP.net 请求和参数“REMOTE_USER”组成。明天将发布更详细的解决方案;)
标签: c# apache rest mono servicestack