title: IdentityServer 4: No storage mechanism for grants specified - use AddInMemoryStores
body: <p>I am using Identity Server 4 , ASP.NET Core and trying to replace the IdentityServer developer in Production environment.  But getting the following error:</p>
  
  <pre><code>No storage mechanism for grants specified. Use the 'AddInMemoryStores' extension method to register a development version.
  </code></pre>
  
  <p>So, I tried to implement the services as mentioned in this <a href="https://stackoverflow.com/questions/35304038/identityserver4-register-userservice-and-get-users-from-database-in-asp-net-core">answer</a>:</p>
  
  <ul>
  <li>IProfileService</li>
  <li>IResourceOwnerPasswordValidator</li>
  </ul>
  
  <p>This is my <em>ConfigureServices</em> Method in <em>Startup</em> class: </p>
  
  <pre><code>            services.AddMvc();
              var identityBuilder = services.AddIdentityServer();
              identityBuilder.AddInMemoryScopes(identitySrvConfig.GetScopes());
              identityBuilder.AddInMemoryClients(identitySrvConfig.GetClients());
              identityBuilder.AddProfileService&lt;ProfileService&gt;();
              identityBuilder.Services.AddTransient&lt;IResourceOwnerPasswordValidator, ResourceOwnerPasswordValidator&gt;();
  </code></pre>
  
  <p>Taking into consideration that in my case the interface signature is different:</p>
  
  <pre><code> public class ResourceOwnerPasswordValidator : IdentityServer4.Validation.IResourceOwnerPasswordValidator
  {
      public Task ValidateAsync(ResourceOwnerPasswordValidationContext context)
      {
          throw new NotImplementedException();
      }
  }
  </code></pre>
  
  <p>But I am still getting the same error, what is the problem?</p>