PHP Classes

Please make State parameter configurable

Recommend this page to a friend!

      PHP OAuth Library  >  PHP OAuth Library package blog  >  How Can the PHP OAuth...  >  All threads  >  Please make State parameter configurable  >  (Un) Subscribe thread alerts  
Subject:Please make State parameter configurable
Summary:To use own encode/decode algorithm instead of php sessions
Messages:3
Author:Sebas
Date:2017-08-28 15:47:05
 

  1. Please make State parameter configurable   Reply   Report abuse  
Picture of Sebas Sebas - 2017-08-28 15:47:05
Hello,

Please consider to make State parameter configurable. The current logic of the class is great indeed and I believe it should stay as it is further but with little more flexibility using condition IF for the state parameter. For example if to use own encode/decode algorithm instead of php session. Therefore would be really good to use state value just with own parameters (where I can wrap the timestamp as well for checking that later to prevent repetition attacks).

Would be really good to add to your class empty state option $client->state = '' (similar to $client->scope = '') -> if $client->state = '' (empty) then class will be using build-in random session ($_SESSION['OAUTH_STATE']) otherwise use the defined value.

Thanks

  2. Re: Please make State parameter configurable   Reply   Report abuse  
Picture of GrahamPHPClasses GrahamPHPClasses - 2017-10-30 01:22:04 - In reply to message 1 from Sebas
Hi, I totally agree.

We don't use php built-in sessions, so I'd really appreciate if state could be generated elsewhere and then used as a key in our own DB table.

Thanks

  3. Re: Please make State parameter configurable   Reply   Report abuse  
Picture of Olivier Zuccaro Olivier Zuccaro - 2018-03-14 09:39:41 - In reply to message 2 from GrahamPHPClasses
Since I had the same issue with Facebook soon enforcing "strict" authorization (or being mandatory if you want to access instagram datas)

You can override state using the session variable :
$_SESSION['OAUTH_STATE'] = "{mystate=myvalue}";

It is working with a Facebook Auth, I did not try it with anything else.