public AuthenticationConfiguration()
        {
            Mappings = new List<AuthenticationOptionMapping>();
            DefaultAuthenticationScheme = "unspecified";
            InheritHostClientIdentity = false;

            EnableSessionToken = false;
            SessionToken = new SessionTokenConfiguration();
        }
        public AuthenticationConfiguration()
        {
            Mappings = new List <AuthenticationOptionMapping>();
            DefaultAuthenticationScheme       = "unspecified";
            SendWwwAuthenticateResponseHeader = true;
            InheritHostClientIdentity         = false;

            EnableSessionToken = false;
            SessionToken       = new SessionTokenConfiguration();
        }
        public AuthenticationConfiguration()
        {
            Mappings = new List<AuthenticationOptionMapping>();
            DefaultAuthenticationScheme = string.Empty;
            SendWwwAuthenticateResponseHeader = true;
            InheritHostClientIdentity = true;
            RequireSsl = true;

            EnableSessionToken = false;
            SessionToken = new SessionTokenConfiguration();
        }
        public AuthenticationConfiguration()
        {
            Mappings = new List <AuthenticationOptionMapping>();
            SendWwwAuthenticateResponseHeaders = true;
            InheritHostClientIdentity          = true;
            RequireSsl = true;
            SetPrincipalOnRequestInstance = true;

            EnableSessionToken = false;
            SessionToken       = new SessionTokenConfiguration();
        }
        public AuthenticationConfiguration()
        {
            Mappings = new List<AuthenticationOptionMapping>();
            DefaultAuthenticationScheme = "unspecified";
            SendWwwAuthenticateResponseHeader = true;
            SetNoRedirectMarker = false;
            InheritHostClientIdentity = false;

            EnableSessionToken = false;
            SessionToken = new SessionTokenConfiguration();
        }
        public AuthenticationConfiguration()
        {
            Mappings = new List<AuthenticationOptionMapping>();
            SendWwwAuthenticateResponseHeaders = true;
            InheritHostClientIdentity = true;
            RequireSsl = true;
            SetPrincipalOnRequestInstance = true;

            EnableSessionToken = false;
            SessionToken = new SessionTokenConfiguration();
        }
        private static AuthenticationConfiguration CreateAuthenticationConfiguration()
        {
            const string signingKey = "fWUU28oBOIcaQuwUKiL01KztD/CsZX83C3I0M1MOYN4=";

            var confing = new SessionTokenConfiguration();
            confing.Scheme = "Session";
            confing.SigningKey = signingKey;

            var authentication = new AuthenticationConfiguration
            {
                RequireSsl = false,
                EnableSessionToken = true,
                SessionToken = confing,
            };

            authentication.DefaultAuthenticationScheme = "Basic";

            authentication.AddBasicAuthentication((username, password) => IsAuthenticated(username, password));
            
            //Use this to prevent your browser showing the standard basic auth login dialog on failure.
            authentication.SendWwwAuthenticateResponseHeader = false;
            
            return authentication;
        }