title: Authentication and RequireRole with ServiceStack
body: <p>I'm trying to create a simple web service with ServiceStack. On the server (service) side, I've first created a user "administrator" and assigned it the "Admin" role. I'm using the ServiceStack built-in credentials authentication and I it authenticates nicely. However, any subsequent call to any webservice that is decorated with the [Authenticate] attribute returns a the following error: </p>
  
  <p><em>No configuration was added for OAuth provider 'basic'</em></p>
  
  <p>FYI: the database is RavenDb - using ServiceStack.Authentication.RavenDb. I also registered a MemoryCacheClient in the App_Start.AppHost.Configure(). Let me know if you need to see all code in App_Start.AppHost class.</p>
  
  <p>Server Code (excerpt):</p>
  
  <pre><code>namespace MyTest 
  {
      [Route("/hello")]
      [Route("/hello/{Name}")]
      [Authenticate]
      public class Hello
      {
          public string Name { get; set; }
      }
  
      public class HelloResponse
      {
          public string Result { get; set; }
      }
  
      public class HelloService : Service
      {
          public IUserAuthRepository UserAuthRepo { get; set; }
  
          public object Any(Hello request)
          {
              return new HelloResponse { Result = "Hello, " + request.Name };
          }
      }
  }</code></pre>
  
  <p>Client side:</p>
  
  <pre><code>var client = new JsonServiceClient("http://127.0.0.1:65385/auth/credentials?format=json");
  var auth   = new Auth { UserName = "administrator", Password = "12345" };
  
  var authResponse = client.Post(auth);
  
  if (authResponse.ResponseStatus.ErrorCode == null)
  {
      client = new JsonServiceClient("http://127.0.0.1:65385/hello");
      client.UserName = "administrator";
      client.Password = "12345";
  
      // When sending the request - it returns "Not Found"
      var helloResponse = client.Send(new Hello { Name = "John" });
  }</code></pre>
  
  <p><strong>EDIT:</strong> <br />
  The web.config of my services looks exactly like written in section 2a of <a href="http://www.servicestack.net/ServiceStack.Hello/" rel="nofollow">the Hello World tutorial</a></p>
  
  <p>Here's the configuration of my AppHost:</p>
  
  <pre><code>public override void Configure(Funq.Container container)
  {
      container.Register(new MemoryCacheClient { FlushOnDispose = false });
      container.Register(new EmbeddableDocumentStore { DataDirectory = "Data" }.Initialize());
  
      ConfigureAuth(container);
  }
  
  private void ConfigureAuth(Funq.Container container)
  {
      var appSettings = new AppSettings();
  
      Plugins.Add(new AuthFeature(() => new CustomUserSession(),
          new IAuthProvider[] {
              new CredentialsAuthProvider(appSettings)}));
  
      Plugins.Add(new RegistrationFeature());
  
      container.Register(
          new RavenUserAuthRepository(c.Resolve()));
  }
  </code></pre>