One Authentification but different pages

5 messages Options
Embed this post
Permalink
patrick_try

One Authentification but different pages

Reply Threaded More More options
Print post
Permalink
Hello together,

one point seems to be a little tricky, but hopefully possible!?

The problem is:
1. All pages were generated by one index.php-file
2. All pages are shown as an html-file through the htaccess
3. It seems that the Auth wanted to have for every (html)file a seperate Authentification

But one SessionToken should be enough for all pages. Is it possible?

Maybe if I change the $client?
----------------------
  $client = Zend_Gdata_AuthSub::getHttpClient($_POST['token']);
  $gdata = new Zend_Gdata($client);
----------------------

THX in advance.
Ryan Boyd-3

Re: One Authentification but different pages

Reply Threaded More More options
Print post
Permalink
Hi Patrick,

Here's the process for AuthSub:
1) You generate a link for the user to click on that directs them over to https://www.google.com/accounts/AuthSubRequest
2) The user clicks on the link, and grants your app the ability to access data on behalf of the user.
3) The user's web browser is redirected to your site using the value of the 'next' URL.  A single-use token is appended to the next URL as a query parameter called 'token'.
4) You can access the value of this query parameter as $_GET['token']. 
5) Even if you asked for a session token, you actually made a request for a token that's upgradable to a session token.  You upgrade the token to a session token using the AuthSubSessionToken service (accessible via AuthSub::getAuthSubSessionToken).
6) You'll get a new token as a result of the upgrade.  This token can be used to make many requests to the service
7) How you store the token you got in steps 5/6 is up to you, but the usual mechanism for storing the AuthSub session token is in the PHP session ($_SESSION). See http://us3.php.net/session for more information on PHP session handling.

Does this information help a bit?

Cheers,
-Ryan

On Tue, Feb 26, 2008 at 4:56 PM, patrick_try <[hidden email]> wrote:

Hello together,

one point seems to be a little tricky, but hopefully possible!?

The problem is:
1. All pages were generated by one index.php-file
2. All pages are shown as an html-file through the htaccess
3. It seems that the Auth wanted to have for every (html)file a seperate
Authentification

But one SessionToken should be enough for all pages. Is it possible?

Maybe if I change the $client? :confused:
----------------------
 $client = Zend_Gdata_AuthSub::getHttpClient($_POST['token']);
 $gdata = new Zend_Gdata($client);
----------------------

THX in advance.

--
View this message in context: http://www.nabble.com/One-Authentification-but-different-pages-tp15703639s16154p15703639.html
Sent from the Zend gdata mailing list archive at Nabble.com.


patrick_try

Re: One Authentification but different pages

Reply Threaded More More options
Print post
Permalink
Hi Ryan,

thx for the answer, but it doens't help a lot.
Maybe I explain a little around my problem.
The System should be started once - to get a SingleSession. After that I want to hardcode this ID in the file to get a permanent connection. When the user surfs a xml-file will generate in the background and send to the mighty g(oogle).
I think this is the best way to update all products by google, isn't it?
But the problem is still there, maybe I should set the code in the distribution index - I thought it would be enough to set it only in the last php (product_page.php).




Ryan Boyd-3 wrote:
Hi Patrick,

Here's the process for AuthSub:
1) You generate a link for the user to click on that directs them over to
https://www.google.com/accounts/AuthSubRequest
2) The user clicks on the link, and grants your app the ability to access
data on behalf of the user.
3) The user's web browser is redirected to your site using the value of the
'next' URL.  A single-use token is appended to the next URL as a query
parameter called 'token'.
4) You can access the value of this query parameter as $_GET['token'].
5) Even if you asked for a session token, you actually made a request for a
token that's upgradable to a session token.  You upgrade the token to a
session token using the AuthSubSessionToken service (accessible via
AuthSub::getAuthSubSessionToken).
6) You'll get a new token as a result of the upgrade.  This token can be
used to make many requests to the service
7) How you store the token you got in steps 5/6 is up to you, but the usual
mechanism for storing the AuthSub session token is in the PHP session
($_SESSION). See http://us3.php.net/session for more information on PHP
session handling.

Does this information help a bit?

Cheers,
-Ryan

On Tue, Feb 26, 2008 at 4:56 PM, patrick_try <try.out@gmx.de> wrote:

>
> Hello together,
>
> one point seems to be a little tricky, but hopefully possible!?
>
> The problem is:
> 1. All pages were generated by one index.php-file
> 2. All pages are shown as an html-file through the htaccess
> 3. It seems that the Auth wanted to have for every (html)file a seperate
> Authentification
>
> But one SessionToken should be enough for all pages. Is it possible?
>
> Maybe if I change the $client? :confused:
> ----------------------
>  $client = Zend_Gdata_AuthSub::getHttpClient($_POST['token']);
>  $gdata = new Zend_Gdata($client);
> ----------------------
>
> THX in advance.
>
> --
> View this message in context:
> http://www.nabble.com/One-Authentification-but-different-pages-tp15703639s16154p15703639.html
> Sent from the Zend gdata mailing list archive at Nabble.com.
>
>
Ryan Boyd-3

Re: One Authentification but different pages

Reply Threaded More More options
Print post
Permalink
Hi Patrick,

I'm not quite sure I'm following, so I'll explain what I'm thinking and then ask for some more information if that doesn't help.

It sounds like you may just be getting a single use token and not upgrading it to a session token.  A single use token is only valid for one request, and must be upgraded using Zend_Gdata_AuthSub::getAuthSubSessionToken

Can you please describe the request flow - something like this:
1) I generate the link to AuthSubRequest as https://www.google.com/accounts/AuthSubRequest?scope=<scope value>&next=<next value>&session=1&secure=0
2) The user clicks on the above link, and chooses to Accept
3) The user's browser is redirected to <next value>?token=<token value>
4) I upgrade the token to a session token using Zend_Gdata_AuthSub::getAuthSubSessionToken(<token value>);
5) This gives me a new token which I store ...
6) On subsequent requests, I look for the session token in ...

Thanks,
-Ryan

On Fri, Feb 29, 2008 at 11:03 AM, patrick_try <[hidden email]> wrote:

Hi Ryan,

thx for the answer, but it doens't help a lot.
Maybe I explain a little around my problem.
The System should be started once - to get a SingleSession. After that I
want to hardcode this ID in the file to get a permanent connection. When the
user surfs a xml-file will generate in the background and send to the mighty
g(oogle).
I think this is the best way to update all products by google, isn't it?
But the problem is still there, maybe I should set the code in the
distribution index - I thought it would be enough to set it only in the last
php (product_page.php).





Ryan Boyd-3 wrote:
>
> Hi Patrick,
>
> Here's the process for AuthSub:
> 1) You generate a link for the user to click on that directs them over to
> https://www.google.com/accounts/AuthSubRequest
> 2) The user clicks on the link, and grants your app the ability to access
> data on behalf of the user.
> 3) The user's web browser is redirected to your site using the value of
> the
> 'next' URL.  A single-use token is appended to the next URL as a query
> parameter called 'token'.
> 4) You can access the value of this query parameter as $_GET['token'].
> 5) Even if you asked for a session token, you actually made a request for
> a
> token that's upgradable to a session token.  You upgrade the token to a
> session token using the AuthSubSessionToken service (accessible via
> AuthSub::getAuthSubSessionToken).
> 6) You'll get a new token as a result of the upgrade.  This token can be
> used to make many requests to the service
> 7) How you store the token you got in steps 5/6 is up to you, but the
> usual
> mechanism for storing the AuthSub session token is in the PHP session
> ($_SESSION). See http://us3.php.net/session for more information on PHP
> session handling.
>
> Does this information help a bit?
>
> Cheers,
> -Ryan
>
> On Tue, Feb 26, 2008 at 4:56 PM, patrick_try <[hidden email]> wrote:
>
>>
>> Hello together,
>>
>> one point seems to be a little tricky, but hopefully possible!?
>>
>> The problem is:
>> 1. All pages were generated by one index.php-file
>> 2. All pages are shown as an html-file through the htaccess
>> 3. It seems that the Auth wanted to have for every (html)file a seperate
>> Authentification
>>
>> But one SessionToken should be enough for all pages. Is it possible?
>>
>> Maybe if I change the $client? :confused:
>> ----------------------
>>  $client = Zend_Gdata_AuthSub::getHttpClient($_POST['token']);
>>  $gdata = new Zend_Gdata($client);
>> ----------------------
>>
>> THX in advance.
>>
>> --
>> View this message in context:
>> http://www.nabble.com/One-Authentification-but-different-pages-tp15703639s16154p15703639.html
>> Sent from the Zend gdata mailing list archive at Nabble.com.
>>
>>
>
>

--
View this message in context: http://www.nabble.com/One-Authentification-but-different-pages-tp15703639s16154p15765302.html
Sent from the Zend gdata mailing list archive at Nabble.com.


patrick_try

Re: One Authentification but different pages

Reply Threaded More More options
Print post
Permalink
Yes, that is the right order. And the first step via the index.php is made.

THX so far

Ryan Boyd-3 wrote:
Hi Patrick,
I'm not quite sure I'm following, so I'll explain what I'm thinking and then
ask for some more information if that doesn't help.

It sounds like you may just be getting a single use token and not upgrading
it to a session token.  A single use token is only valid for one request,
and must be upgraded using Zend_Gdata_AuthSub::getAuthSubSessionToken

Can you please describe the request flow - something like this:
1) I generate the link to AuthSubRequest as
https://www.google.com/accounts/AuthSubRequest?scope=<scope
value>&next=<next value>&session=1&secure=0
2) The user clicks on the above link, and chooses to Accept
3) The user's browser is redirected to <next value>?token=<token value>
4) I upgrade the token to a session token using
Zend_Gdata_AuthSub::getAuthSubSessionToken(<token value>);
5) This gives me a new token which I store ...
6) On subsequent requests, I look for the session token in ...

Thanks,
-Ryan

On Fri, Feb 29, 2008 at 11:03 AM, patrick_try <try.out@gmx.de> wrote:

>
> Hi Ryan,
>
> thx for the answer, but it doens't help a lot.
> Maybe I explain a little around my problem.
> The System should be started once - to get a SingleSession. After that I
> want to hardcode this ID in the file to get a permanent connection. When
> the
> user surfs a xml-file will generate in the background and send to the
> mighty
> g(oogle).
> I think this is the best way to update all products by google, isn't it?
> But the problem is still there, maybe I should set the code in the
> distribution index - I thought it would be enough to set it only in the
> last
> php (product_page.php).
>
>
>
>
>
> Ryan Boyd-3 wrote:
> >
> > Hi Patrick,
> >
> > Here's the process for AuthSub:
> > 1) You generate a link for the user to click on that directs them over
> to
> > https://www.google.com/accounts/AuthSubRequest
> > 2) The user clicks on the link, and grants your app the ability to
> access
> > data on behalf of the user.
> > 3) The user's web browser is redirected to your site using the value of
> > the
> > 'next' URL.  A single-use token is appended to the next URL as a query
> > parameter called 'token'.
> > 4) You can access the value of this query parameter as $_GET['token'].
> > 5) Even if you asked for a session token, you actually made a request
> for
> > a
> > token that's upgradable to a session token.  You upgrade the token to a
> > session token using the AuthSubSessionToken service (accessible via
> > AuthSub::getAuthSubSessionToken).
> > 6) You'll get a new token as a result of the upgrade.  This token can be
> > used to make many requests to the service
> > 7) How you store the token you got in steps 5/6 is up to you, but the
> > usual
> > mechanism for storing the AuthSub session token is in the PHP session
> > ($_SESSION). See http://us3.php.net/session for more information on PHP
> > session handling.
> >
> > Does this information help a bit?
> >
> > Cheers,
> > -Ryan
> >
> > On Tue, Feb 26, 2008 at 4:56 PM, patrick_try <try.out@gmx.de> wrote:
> >
> >>
> >> Hello together,
> >>
> >> one point seems to be a little tricky, but hopefully possible!?
> >>
> >> The problem is:
> >> 1. All pages were generated by one index.php-file
> >> 2. All pages are shown as an html-file through the htaccess
> >> 3. It seems that the Auth wanted to have for every (html)file a
> seperate
> >> Authentification
> >>
> >> But one SessionToken should be enough for all pages. Is it possible?
> >>
> >> Maybe if I change the $client? :confused:
> >> ----------------------
> >>  $client = Zend_Gdata_AuthSub::getHttpClient($_POST['token']);
> >>  $gdata = new Zend_Gdata($client);
> >> ----------------------
> >>
> >> THX in advance.
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/One-Authentification-but-different-pages-tp15703639s16154p15703639.html
> >> Sent from the Zend gdata mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/One-Authentification-but-different-pages-tp15703639s16154p15765302.html
> Sent from the Zend gdata mailing list archive at Nabble.com.
>
>