<commit_before>﻿using AzureBot.Model;
using AzureBot.Services.Interfaces;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace AzureBot.Services.Impl
{
    public class OAuthAuthenticationService : IAuthenticationService
    {
        private string _clientId;
        private string _clientSecret;
        private string _tenantId;
        private string _redirectUri;
        private string _apiVersion;
           

        public OAuthAuthenticationService()
        {
            // Environment vars
            _clientId = Environment.GetEnvironmentVariable("ARM_API_CLIENTID");
            _clientSecret = Environment.GetEnvironmentVariable("ARM_API_CLIENTSECRET");

            // App settings
            _tenantId = ConfigurationManager.AppSettings["TenantId"];
            var baseUri = ConfigurationManager.AppSettings["RedirectBaseUri"];
            _redirectUri = baseUri + "/api/auth/receivetoken";
        }

        public async Task<string> GetToken(object[] args)
        {
            string authenticationCode = (string)args[0];
            string userId = (string)args[1];
            string token = string.Empty;

            if (!string.IsNullOrEmpty(authenticationCode) && !string.IsNullOrEmpty(userId))
            {
                var tokenUri = BuildOAuthTokenRequestUri(authenticationCode);
                string result = null;<commit_msg>removed empty field<commit_after>﻿using AzureBot.Model;
using AzureBot.Services.Interfaces;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace AzureBot.Services.Impl
{
    public class OAuthAuthenticationService : IAuthenticationService
    {
        private string _clientId;
        private string _clientSecret;
        private string _tenantId;
        private string _redirectUri;

        public OAuthAuthenticationService()
        {
            // Environment vars
            _clientId = Environment.GetEnvironmentVariable("ARM_API_CLIENTID");
            _clientSecret = Environment.GetEnvironmentVariable("ARM_API_CLIENTSECRET");

            // App settings
            _tenantId = ConfigurationManager.AppSettings["TenantId"];
            var baseUri = ConfigurationManager.AppSettings["RedirectBaseUri"];
            _redirectUri = baseUri + "/api/auth/receivetoken";
        }

        public async Task<string> GetToken(object[] args)
        {
            string authenticationCode = (string)args[0];
            string userId = (string)args[1];
            string token = string.Empty;

            if (!string.IsNullOrEmpty(authenticationCode) && !string.IsNullOrEmpty(userId))
            {
                var tokenUri = BuildOAuthTokenRequestUri(authenticationCode);
                string result = null;
{'fraction_non_alphanumeric': 0.08247089262613196, 'fraction_numerical': 0.00129366106080207, 'mean_word_length': 2.771951219512195, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7482064', 'n_tokens_mistral': 767, 'n_tokens_neox': 774, 'n_words': 170}