public dynamic[] Call(IDictionary<string, dynamic> environment) { var auth = new BasicAuthRequest(environment); if (!auth.IsProvided()) { return Unauthorized(null); } if (!auth.IsBasic()) { return BadRequest(); } if (IsValid(auth)) { environment["REMOTE_USER"] = auth.Username; return App.Call(environment); } return Unauthorized(null); }
public dynamic[] Call(IDictionary <string, dynamic> environment) { var auth = new BasicAuthRequest(environment); if (!auth.IsProvided()) { return(Unauthorized(null)); } if (!auth.IsBasic()) { return(BadRequest()); } if (IsValid(auth)) { environment["REMOTE_USER"] = auth.Username; return(App.Call(environment)); } return(Unauthorized(null)); }
private bool IsValid(BasicAuthRequest auth) { return Authenticator.Invoke(auth.Username, auth.Credentials.Last()); }
private bool IsValid(BasicAuthRequest auth) { return(Authenticator.Invoke(auth.Username, auth.Credentials.Last())); }