コード例 #1
0
        public FacebookUrlHelperFixture()
        {
            config = new FacebookAuthenticationConfiguration()
                         {
                             ApplicationLogoutPath = "logoutApp",
                             ApplicationBasePath = "http://127.0.0.1",
                             FacebookLoginPath = "/loginFacebook",
                             FacebookOAthResponsePath = "/oAthFacebook",
                             FacebookLogoutPath = "/logoutFacebook"

                         };

            this.urlHelper = new FacebookUrlHelper(
                config
                );
        }
コード例 #2
0
        /// <summary>
        /// Enable facebook authentication for the application
        /// </summary>
        /// <param name="configuration">
        /// The facebook authentication configuration
        /// </param>
        /// <param name="facebookAPIFactory">
        /// The facebook object builder
        /// </param>
        /// <param name="facebookUrlHelper">
        /// The facebook url helper
        /// </param>
        public static void Enable(FacebookAuthenticationConfiguration configuration, IFacebookAPIFactory facebookAPIFactory, IFacebookUrlHelper facebookUrlHelper)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            if (!configuration.IsValid)
            {
                throw new ArgumentException("Configuration is invalid", "configuration");
            }

            if (facebookAPIFactory == null)
            {
                throw new ArgumentNullException("facebookAPIFactory");
            }

            if (facebookUrlHelper == null)
            {
                throw new ArgumentNullException("facebookUrlHelper");
            }

            Enabled = true;
            Configuration = configuration;
            FacebookClientService = new FacebookClientService(ApplicationAuthenticator, FacebookCurrentAuthenticatedUserCache, facebookAPIFactory);
            FacebookOAuthService = new FacebookOAuthService(facebookAPIFactory, facebookUrlHelper);
        }
コード例 #3
0
 /// <summary>
 /// Enable facebook authentication for the application
 /// </summary>
 /// <param name="configuration">
 /// The facebook authentication configuration
 /// </param>
 public static void Enable(FacebookAuthenticationConfiguration configuration)
 {
     Enable(configuration, new FacebookAPIFactory(), new FacebookUrlHelper(configuration));
 }