I already could add multiple authentication providers as mentioned in Adding multiple authenticaion providers. Now Spring will check in both LDAP and database for users.
However my use case is little different. I want to bind a authentication provider per a client, not check in all providers. Say for clients with clienti_d1 and client_id2 it will check users in LDAP and for client_id3 it will check database. Basically LDAP based authentication for internal apps and database based authentication for external apps.
POST /oauth/token for client_id1:secret1 => hit LDAP authentication
POST /oauth/token for client_id2:secret2 => hit DB authentication