コード例 #1
0
ファイル: ServicesModule.cs プロジェクト: biganth/Curt
        internal static void CheckForReal401(IServicesContext context)
        {
            if(context == null)
            {
                throw new ArgumentNullException("context");
            }

            if (context.DoA401)
            {
                var response = context.BaseContext.Response;
                response.ClearContent();
                response.ClearHeaders();
                response.StatusCode = 401;

                if (context.SupportBasicAuth)
                {
                    response.AppendHeader("WWW-Authenticate", "Basic realm=\"DNNAPI\"");
                }

                if (context.SupportDigestAuth)
                {
                    var stale = context.IsStale.ToString(CultureInfo.InvariantCulture).ToLowerInvariant();
                    var value = string.Format("Digest realm=\"DNNAPI\", nonce=\"{0}\",  opaque=\"0000000000000000\", stale={1}, algorithm=MD5, qop=\"auth\"", CreateNewNonce(), stale);
                    response.AppendHeader("WWW-Authenticate", value);
                }
            }
        }
コード例 #2
0
        internal static void CheckForReal401(IServicesContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            if (context.DoA401)
            {
                var response = context.BaseContext.Response;
                response.ClearContent();
                response.ClearHeaders();
                response.StatusCode = 401;

                if (context.SupportBasicAuth)
                {
                    response.AppendHeader("WWW-Authenticate", "Basic realm=\"DNNAPI\"");
                }

                if (context.SupportDigestAuth)
                {
                    var stale = context.IsStale.ToString(CultureInfo.InvariantCulture).ToLowerInvariant();
                    var value = string.Format("Digest realm=\"DNNAPI\", nonce=\"{0}\",  opaque=\"0000000000000000\", stale={1}, algorithm=MD5, qop=\"auth\"", CreateNewNonce(), stale);
                    response.AppendHeader("WWW-Authenticate", value);
                }
            }
        }
コード例 #3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="emailServices"></param>
 /// <param name="configurationManager"></param>
 /// <param name="servicesContext">The services context</param>
 public FileSystemServices(IServicesContext servicesContext, IEmailServices emailServices, IConfigurationManager configurationManager)
     : base(servicesContext)
 {
     _emailServices        = emailServices;
     _configurationManager = configurationManager;
 }