I use Owin, Katana and Nancy to host a simple site with the required separation. Note. I also use the nuget package - Nancy.MSOwinSecurity
app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = Constants.AuthenticationType, LoginPath = new PathString("/Login"), }); app.UseNancy();
Here is my module code
public class LoginModule : NancyModule { public LoginModule() { Post["login"] = p => { var name = Request.Form.name; var auth = Context.GetAuthenticationManager(); var claims = new List<Claim> {new Claim(ClaimTypes.Name, name)}; var id = new ClaimsIdentity(claims, Constants.AuthenticationType); auth.SignIn(id);
My feed form
<form name="login" action="/login" method="post" accept-charset="utf-8"> <ul> ... </ul> </form>
Now I am looking for a redirection after successfully entering ReturnUrl -
eg. To come in? ReturnUrl =% 2Fblah% 2blahblah
It seems that there is no redirect method, for example, when authenticating forms, plus the query string parameter property is empty.
authentication c # owin katana nancy
Ned ryerson
source share