当前位置: 首页>>代码示例>>C#>>正文


C# HttpContextWrapper.AuthenticateCurrentRequest方法代码示例

本文整理汇总了C#中System.Web.HttpContextWrapper.AuthenticateCurrentRequest方法的典型用法代码示例。如果您正苦于以下问题:C# HttpContextWrapper.AuthenticateCurrentRequest方法的具体用法?C# HttpContextWrapper.AuthenticateCurrentRequest怎么用?C# HttpContextWrapper.AuthenticateCurrentRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.HttpContextWrapper的用法示例。


在下文中一共展示了HttpContextWrapper.AuthenticateCurrentRequest方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AuthenticateTicket

		public static bool AuthenticateTicket() {
			// see http://issues.umbraco.org/issue/U4-6342#comment=67-19466 (from http://issues.umbraco.org/issue/U4-6332)
			var http = new HttpContextWrapper(HttpContext.Current);
			var ticket = http.GetUmbracoAuthTicket();
			if (ticket != null)
			{
				return http.AuthenticateCurrentRequest(ticket, true);
			}
			return false;
		}
开发者ID:kjac,项目名称:Umbracian-Frontend-Editing,代码行数:10,代码来源:AuthenticationHelper.cs

示例2: OnPreInit

        protected override void OnPreInit(EventArgs e) {

            base.OnPreInit(e);

            if (PackageHelpers.UmbracoVersion != "7.2.2") return;

            // Handle authentication stuff to counteract bug in Umbraco 7.2.2 (see U4-6342)
            HttpContextWrapper http = new HttpContextWrapper(Context);
            FormsAuthenticationTicket ticket = http.GetUmbracoAuthTicket();
            http.AuthenticateCurrentRequest(ticket, true);

        }
开发者ID:johanreitsma,项目名称:Skybrud.Social.Umbraco,代码行数:12,代码来源:InstagramOAuth.aspx.cs

示例3: AuthenticateRequest

        /// <summary>
        /// Authenticates the request by reading the FormsAuthentication cookie and setting the 
        /// context and thread principle object
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <remarks>
        /// We will set the identity, culture, etc... for any request that is:
        /// * A back office request
        /// * An installer request
        /// * A /base request (since these can be back office web service requests)
        /// </remarks>
        static void AuthenticateRequest(object sender, EventArgs e)
        {
            var app = (HttpApplication)sender;
            var http = new HttpContextWrapper(app.Context);

            // do not process if client-side request
            if (http.Request.Url.IsClientSideRequest())
                return;

            var req = new HttpRequestWrapper(app.Request);

            if (ShouldAuthenticateRequest(req, UmbracoContext.Current.OriginalRequestUrl))
            {
                var ticket = http.GetUmbracoAuthTicket();

                http.AuthenticateCurrentRequest(ticket, ShouldIgnoreTicketRenew(UmbracoContext.Current.OriginalRequestUrl, http) == false);
            }

        }
开发者ID:phaniarveti,项目名称:Experiments,代码行数:31,代码来源:UmbracoModule.cs


注:本文中的System.Web.HttpContextWrapper.AuthenticateCurrentRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。