Пример #1
0
 private void CheckObsoleteAuth()
 {
     if (!string.IsNullOrEmpty(BasicAuthUsername) && !string.IsNullOrEmpty(BasicAuthPassword))
     {
         LogLog.Warn(GetType(), "BasicAuthUsername & BasicAuthPassword tags are obsolete, Please use AuthenticationMethod new tag");
         var auth = new BasicAuthenticationMethod {
             Username = BasicAuthUsername, Password = BasicAuthPassword
         };
         AuthenticationMethod.AddBasic(auth);
     }
 }
Пример #2
0
 internal bool AuthenticateRequest(IIdentity identity, ChannelAuthenticationSchemes AuthenticationSchema)
 {
     if (identity == null)
     {
         throw new ChannelCredentialsException("Credentials are not provided");
     }
     else
     {
         if (AuthenticationSchema == ChannelAuthenticationSchemes.Basic)
         {
             KeyValuePair <string, string> userCredentials = GetCredentialsForBasicAuthentication(identity);
             return(BasicAuthenticationMethod.Invoke(userCredentials.Key, userCredentials.Value));
         }
         else
         {
             string token = GetCredentialsForTokenAuthentication(identity);
             return(TokenAuthenticationMethod.Invoke(token));
         }
     }
 }
Пример #3
0
 public void AddBasic(BasicAuthenticationMethod method)
 {
     AddFilter(method);
 }