Api - Can't Authenticate A Customer To A Storefront

I have enabled and generated API key and I am able to get authenticated link from localhost/cscart/api/auth but the problem is that I can't have the customer authenticated to the storefront. For example I have a storefront localhost/cscart/store1 and manually it is working fine with registration and login. Even I can authenticate customer to localhost/cscart but can't authenticate the customer to localhost/cscart/store1......what am I doing wrong?