implement and test client credentials exchange