Passing the credentials to a photon with REST (cloud) API

Setting credentials over an internet connection for which you'd need those same credentials is going to be a bit problematic, don't you think? It's like going inside to get your key, so you can go inside. Kind of defeats the purpose.
That said, there are some people in the community working on a direct connection with the Photon, so you can pass the credentials directly. There have been some promising demos already. Check it out, might be what you're looking for: