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); } }
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)); } } }
public void AddBasic(BasicAuthenticationMethod method) { AddFilter(method); }