PHP Classes

Great library, but one issue I need help with

Recommend this page to a friend!

      PHP OAuth Library  >  PHP OAuth Library package blog  >  Learn with a PHP OAut...  >  All threads  >  Great library, but one issue I need...  >  (Un) Subscribe thread alerts  
Subject:Great library, but one issue I need...
Summary:Need to pass data into library that will be returned on success
Messages:2
Author:Martin Kirk
Date:2017-01-26 19:24:51
 

  1. Great library, but one issue I need...   Reply   Report abuse  
Picture of Martin Kirk Martin Kirk - 2017-01-26 19:24:51
This library seems to be exactly what I was looking for, and I have had no problem in creating a configuration and login module for my system. For this, many thanks.

I do have one problem which I have so far failed to slve, and I would appreciate if anypne could give me some pointers, or even an example.

I need to be able to call the login process from any page on our site, and have the process return to that page upon a succesful login. In order to do that I need to be able to pass the URL of the target page through the login process.

Looking at the code, it looks as if I should be able to put data into the $_SESSION['OAUTH_STATE'] variable, and have that returned along with the access token to the redirect URL.

Looking at what is returned, I am assuming it is in ssession_state parameter.

The data I am placing in the $_SESSION['OAUTH_STATE'] is json encoded, and then base64url endoced. However, trying to apply the 2 decodongd to the returned data (in the reverse order) isn't returning any usable data.

Of course, it may be that I am taking the wrong approach altogether, so any suggestions gratefully received.

  2. Re: Great library, but one issue I need...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2017-01-26 20:48:53 - In reply to message 1 from Martin Kirk
No, do not use the OAUTH_STATE variable. That is for the internal use of the class. You can use other session variables for keeping track of the return page.