Change the condition of grant and client match determination to client.id. Since we're using client.id associate client and grant.