title: How can I configure multiple authentication managers depending on the incoming URL for an authorization server?
body: <p><strong>With Spring Security &lt;5.2</strong></p>
  <p>In a legacy project, for a password grant scenario, I need to configure an authorization server.</p>
  <p>Currently it is done extending <code>AuthorizationServerConfigurerAdapter</code>, and the authorization endpoints are configured overriding the <code>configure(AuthorizationEndpointsServerConfigurer)</code> method.</p>
  <p>My problem is that this configurer takes one <code>AuthenticationManager</code> for the password grant, when I would need something like an <code>AuthenticationManagerResolver</code> (<strong>but I can't upgrade to 5.2</strong>) to be able to apply a different authentication depending on the incoming URL (an authentication manager for admin URLs, e.g. &quot;/admin/**&quot;, and another one for non-admin).</p>
  <p>How can I do that? I can change the approach, but again I can't upgrade.</p>