Search code examples
phpgoogle-appsgoogle-apps-marketplace

Carry data from start of authentication process to end of process


I am developing a Google Marketplace App. I am using PHP.

I am trying to have an access point to my app which doesn't require the user to have logged into my app (or possibly even Google Apps for that matter), and then once they have submitted the entry point (which just consists of a string) that string is carried through the authentication process so that when they authenticated my app can process that string just as if they had been logged in.

Basically I have a HTML form which is like a cut down version of my app (which can be embedded on a website using an iFrame for example), and when the user fills it out it does an AJAX call to an API in my app which does require authentication, so the authentication process begins, but once it has finished it has lost the original data.

Does anyone know a solution to this?


Solution

  • I ended up using sessions however it was more tricky than usual because the authentication occurs on a different domain to the access point to the app. What I ended up doing was encoding $_SESSION and storing it in a database, and then when the authentication has occured and the app is logged in it checks the database for any sessions and restores them.