身份验证失败时无法在ServiceStack中禁用重定向

时间:2013-02-25 21:44:06

标签: servicestack

我在Mono上运行ServiceStack 3.9.37。我只将它用作web服务(没有视图等)。

我有一个自定义身份验证提供程序。

由于凭据无效而导致身份验证失败,ServiceStack会将响应重定向到login.aspx。

身份验证配置如此

this.Plugins.Add(
  new AuthFeature(
    () => new AuthUserSession(),
    new IAuthProvider[] {
      new UserProfileCredentialsAuthProvider(),
      new AdminUserCredentialsAuthProvider()
    }
  )
  {
    ServiceRoutes = new Dictionary<Type, string[]> {
      { typeof(AuthService), new[]{"/auth", "/auth/{provider}"} }
    },
    HtmlRedirect = null
  }
);

这与When ServiceStack authentication fails, do not redirect?的问题基本相同,但我在Mono上运行,根本没有任何会员资格。

编辑:

忘记提及我使用Chrome扩展程序&#34;简单REST客户端&#34;来调用我的服务,我使用application / json作为Accept,text / json作为Content-Type。

0 个答案:

没有答案
相关问题