Giter Club home page Giter Club logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Hello uweiss,

Is it correct when I understand that you would like your service provider to:
- receive additional parameters when handling the request-token request
- save these received with the request-token.

I assume the $server->authorizeVerify() will then also need to return those 
extra parameters.  As will the 
$store->getConsumerRequestToken(), $store->getConsumerAccessToken().

Maybe we should also let the $consumer->requestRequestToken() add extra 
parameters to the outgoing 
request.

Any extra ideas?

- Marc

Original comment by [email protected] on 13 Jul 2008 at 6:05

  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

from oauth-php.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
hi Marc,

Yes and no. Handling and saving extra parameters is certainly an option from 
within
the library, but it is not really necessary. A user of the library can access 
these
parameters pretty well with $server->getParameter('param_name'). The problem I 
had
was actually associating this parameter with a token (or ost_id), which was not
possible when calling $s->requestToken(), because it exits. I rewrote that 
function
and inserted some of my own code for fetching the ost_id and saving the 
parameters in
my own parameter table, where I also save other things like expiration of the 
token
(which will be set by the user on the authorization step). It would be nice if
$s->requestToken() returned the ost_id. 

See http://proofile.org/apidoc/oauth for how I am using these parameters.

yes, $c->requestRequestToken() should be able to have parameters added (6.1.1 of
http://oauth.net/core/). Also, on a side note, a caller should be enabled to 
change
the http request method (GET, or anything else, instead of just POST). 

keep up the good work, I really like the library.
ueli

Original comment by [email protected] on 14 Jul 2008 at 10:31

from oauth-php.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Hi Ueli,

I propose to change OAuthServer::requestToken() so that it returns the new 
request_token, and does not call exit() anymore.  
OAuthRequester::requestRequestToken() will be changed to accept additional 
parameters and also an optional http request method.

In OAuthServer:

    /**
     * Handle the request_token request.
     * Returns the new request token and request token secret.
     * 
     * TODO: add correct result code to exception
     * 
     * @return string   returned request token, false on an error
     */
    public function requestToken ()


And in OAuthRequester:

    /**
     * Request a request token from the site belonging to consumer_key
     * 
     * @param string consumer_key
     * @param int usr_id
     * @param array params (optional) extra arguments for when requesting the request token
     * @param string method (optional) change the method of the request, defaults to POST (as it should be)
     * @exception OAuthException when no key could be fetched
     * @exception OAuthException when no server with consumer_key registered
     * @return array (authorize_uri, token)
     */
    static function requestRequestToken ( $consumer_key, $usr_id, $params = null, $method = 'POST' )


Would this help you and fix the problems you encountered?

- Marc

Original comment by [email protected] on 16 Jul 2008 at 3:52

from oauth-php.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
perfect, thanks marc!

Original comment by [email protected] on 16 Jul 2008 at 4:10

from oauth-php.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
I committed the proposed changes.  
See revision 45.  

Also adapted the documentation for the OAuthServer

Original comment by [email protected] on 16 Jul 2008 at 4:25

from oauth-php.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Will start testing.

Original comment by [email protected] on 16 Jul 2008 at 4:26

  • Changed state: Fixed

from oauth-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.