<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace BrockAllen.OAuth2
{
    class FacebookProvider : Provider
    {
        public FacebookProvider(string clientID, string clientSecret, string scope)
            : base(ProviderType.Facebook,                
                "https://www.facebook.com/dialog/oauth",
                "https://graph.facebook.com/oauth/access_token",
                "https://graph.facebook.com/me",
                clientID, clientSecret)
        {
            if (scope == null)
            {
                Scope = "email";
            }
            else
            {
                Scope = scope;
            }
        }

        static Dictionary<string, string> supportedClaimTypes = new Dictionary<string, string>();
        static FacebookProvider()
        {
            supportedClaimTypes.Add("id", ClaimTypes.NameIdentifier);
            supportedClaimTypes.Add("name", ClaimTypes.Name);
            supportedClaimTypes.Add("first_name", ClaimTypes.GivenName);
            supportedClaimTypes.Add("last_name", ClaimTypes.Surname);
            supportedClaimTypes.Add("gender", ClaimTypes.Gender);
            supportedClaimTypes.Add("link", ClaimTypes.Webpage);
            supportedClaimTypes.Add("birthday", ClaimTypes.DateOfBirth);
            supportedClaimTypes.Add("locale", ClaimTypes.Locality);
            supportedClaimTypes.Add("email", ClaimTypes.Email);<commit_msg>Adding email to Facebook so that BrockAllen Membership doesn't bomb<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace BrockAllen.OAuth2
{
    class FacebookProvider : Provider
    {
        public FacebookProvider(string clientID, string clientSecret, string scope)
            : base(ProviderType.Facebook,                
                "https://www.facebook.com/dialog/oauth",
                "https://graph.facebook.com/oauth/access_token",
                "https://graph.facebook.com/me",
                clientID, clientSecret)
        {
            if (scope == null)
            {
                Scope = "email";
            }
            else
            {
                Scope = scope;
            }

            this.additionalParams = new System.Collections.Specialized.NameValueCollection();
            this.additionalParams.Add("fields", "email");
        }

        static Dictionary<string, string> supportedClaimTypes = new Dictionary<string, string>();
        static FacebookProvider()
        {
            supportedClaimTypes.Add("id", ClaimTypes.NameIdentifier);
            supportedClaimTypes.Add("name", ClaimTypes.Name);
            supportedClaimTypes.Add("first_name", ClaimTypes.GivenName);
            supportedClaimTypes.Add("last_name", ClaimTypes.Surname);
            supportedClaimTypes.Add("gender", ClaimTypes.Gender);
            supportedClaimTypes.Add("link", ClaimTypes.Webpage);
            supportedClaimTypes.Add("birthday", ClaimTypes.DateOfBirth);
            supportedClaimTypes.Add("locale", ClaimTypes.Locality);
            supportedClaimTypes.Add("email", ClaimTypes.Email);
{'fraction_non_alphanumeric': 0.1042355061580054, 'fraction_numerical': 0.0006007810153199159, 'mean_word_length': 2.2487804878048783, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3088486', 'n_tokens_mistral': 861, 'n_tokens_neox': 805, 'n_words': 147}