[https://github.com/ServiceStack/Test][1]
I clone above(MVC project) because I don’t have redis or PostgreSql,
so i setup ormlite.sqlite use next code it
var path = "~/dd.db".MapAbsolutePath();
container.Register<IDbConnectionFactory>(c => new OrmLiteConnectionFactory(
path, SqliteDialect.Provider));
container.Register<ICacheClient>(c => new MemoryCacheClient());
now I have 3 questions:
1: at homecontrol/Login
why should call FormsAuthentication.SetAuthCookie(); since AuthenticateAttribute depend on ‘ss-pid’, it has no mater with ‘.ASPXAUTH’
using (var authService = ResolveService<AuthenticateService>())
{
var response = authService.Authenticate(new Authenticate
{
provider = CredentialsAuthProvider.Name,
UserName = userName,
Password = password,
RememberMe = true,
});
// add ASP.NET auth cookie
FormsAuthentication.SetAuthCookie(userName, true);
//
return Redirect(string.IsNullOrEmpty(redirect) ? "/" : redirect);
}
2:although I login(use test,test), it set cookie to me, but ‘/api/auth’ also return HTTP/1.1 401 Unauthorized?
3: if I use Session in services, I should save Session manualy , and it will auto save in ServiceStackController, is it right?
[1]: https://github.com/ServiceStack/Test