public void Init(HttpApplication context)
        {
            context.AuthenticateRequest += (sender, e) =>
            {
                HttpContext httpContext = ((HttpApplication)sender).Context;

                dynamic signedRequest = FacebookRequestHelpers.GetSignedRequest(
                    new HttpContextWrapper(httpContext),
                    rawSignedRequest =>
                {
                    FacebookConfiguration config = GlobalFacebookConfiguration.Configuration;
                    FacebookClient client        = config.ClientProvider.CreateClient();
                    return(client.ParseSignedRequest(rawSignedRequest));
                });

                if (signedRequest != null)
                {
                    string userId = signedRequest.user_id;
                    if (!String.IsNullOrEmpty(userId))
                    {
                        ClaimsPrincipal principal = new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim(ClaimTypes.NameIdentifier, userId) }));
                        Thread.CurrentPrincipal = principal;
                        httpContext.User        = principal;
                    }
                }
            };
        }
        public static void Register(FacebookConfiguration configuration)
        {
            // 다음 응용 프로그램 설정 키를 사용하여 web.config의 설정을 로드합니다.
            // Facebook:AppId, Facebook:AppSecret, Facebook:AppNamespace
            configuration.LoadFromAppSettings();

            // Facebook에서 서명한 요청 및 권한을 확인하기 위해 권한 부여 필터 추가
            GlobalFilters.Filters.Add(new FacebookAuthorizeFilter(configuration));
        }
        public static void Register(FacebookConfiguration configuration)
        {
            // Loads the settings from web.config using the following app setting keys:
            // Facebook:AppId, Facebook:AppSecret, Facebook:AppNamespace
            configuration.LoadFromAppSettings();

            // Adding the authorization filter to check for Facebook signed requests and permissions
            GlobalFilters.Filters.Add(new FacebookAuthorizeFilter(configuration));
        }
        public static void Register(FacebookConfiguration configuration)
        {
            // Loads the settings from web.config using the following app setting keys:
            // Facebook:AppId, Facebook:AppSecret, Facebook:AppNamespace
            configuration.LoadFromAppSettings();

            // Adding the authorization filter to handle all FacebookAuthorize attributes
            GlobalFilters.Filters.Add(new FacebookAuthorizeFilter(configuration));
        }