尝试使用 ServiceStack 进行身份验证,并将其重定向到登录页面,如下所示:
Plugins.Add(new AuthFeature(
() => new CustomUserSession(), //Use your own typed Custom UserSession type
new IAuthProvider[] {
new CredentialsAuthProvider(), //HTML Form post of UserName/Password credentials
new TwitterAuthProvider(appSettings), //Sign-in with Twitter
new FacebookAuthProvider(appSettings), //Sign-in with Facebook
new DigestAuthProvider(appSettings), //Sign-in with Digest Auth
new BasicAuthProvider(), //Sign-in with Basic Auth
new GoogleOpenIdOAuthProvider(appSettings), //Sign-in with Google OpenId
new YahooOpenIdOAuthProvider(appSettings), //Sign-in with Yahoo OpenId
new OpenIdOAuthProvider(appSettings), //Sign-in with Custom OpenId
}, "http://www.anyURIhereisignored.com"));
然而,这种情况下的 URI 参数“ http://www.anyURIhereisignored.com ”被简单地忽略了。
查看 AuthFeature 的类定义,我看到 htmlRedirect 参数被声明为可选,默认值为“~/login”,但它似乎总是使用该值并忽略传入的任何内容。似乎虽然htmlRedirect 值最初设置为传递的 URI,不知何故在内部它从不使用它,而是始终默认为“~/login”。还有其他人遇到同样的问题吗?