Inheritance: NRack.Auth.Abstract.AuthRequestBase
Example #1
0
        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);
        }
Example #2
0
        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));
        }
Example #3
0
 private bool IsValid(BasicAuthRequest auth)
 {
     return Authenticator.Invoke(auth.Username, auth.Credentials.Last());
 }
Example #4
0
 private bool IsValid(BasicAuthRequest auth)
 {
     return(Authenticator.Invoke(auth.Username, auth.Credentials.Last()));
 }