Exemple #1
0
        protected BaseChannelProcessor(ChannelContract channel)
        {
            Channel    = channel;
            Attributes = new AttributesReader(Channel.Attributes).Read();

            StemmerBase stemmer = new RussianStemmer();

            foreach (string s in Channel.Tags.Split(';'))
            {
                _tags.Add(stemmer.Stem(s.Trim()));
            }
        }
Exemple #2
0
        public static BaseChannelProcessor Create(ChannelContract channel)
        {
            switch (channel.Type)
            {
            //case ChannelTypes.Facebook:
            //    return new FbProcessor(channel);

            case ChannelTypes.Vk:
                return(new VkProcessor(channel));

            default:
                throw new NotImplementedException();
            }
        }
Exemple #3
0
 public VkProcessor(ChannelContract channel) : base(channel)
 {
     Token = Attributes["Token"];
 }
Exemple #4
0
        static BOAContextData Authenticate(BOAContextData data, Action <string> trace, ChannelContract channelContract)
        {
            if (data.authenticationResponse != null)
            {
                return(data);
            }

            data = LoadBOAConfigurationFile(data, trace);

            var request = new AuthenticationRequest
            {
                AuthenticationContext = new AuthenticationContext
                {
                    Channel  = channelContract,
                    UserName = AuthenticationUserName
                }
            };

            trace("Authenticate response waiting...");

            var response = new UserManager().Authenticate(request);

            if (!response.Success)
            {
                throw new AuthenticationException("LoginFailed." + StringHelper.ResultToDetailedString(response.Results));
            }

            trace("Authenticate is success.");

            return(data.WithAuthenticationResponse(response));
        }
Exemple #5
0
 /// <summary>
 ///     Authenticates the specified channel contract.
 /// </summary>
 public void Authenticate(ChannelContract channelContract)
 {
     data = Authenticate(data, trace, channelContract);
 }