anonymsean / oauth

Automatically exported from code.google.com/p/oauth
0 stars 0 forks source link

Python Client Example confusion #82

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Maybe I'm not understanding this right, but the example client has these
constants defined:

SERVER = 'localhost'
PORT = 8080

REQUEST_TOKEN_URL = 'https://photos.example.net/request_token'
ACCESS_TOKEN_URL = 'https://photos.example.net/access_token'
AUTHORIZATION_URL = 'https://photos.example.net/authorize'
CALLBACK_URL = 'http://printer.example.com/request_token_ready'
RESOURCE_URL = 'http://photos.example.net/photos'

Shouldn't the URLs be paths like this?

SERVER = 'photos.example.net'
PORT = 443

REQUEST_TOKEN_URL = '/request_token'
ACCESS_TOKEN_URL = '/access_token'
AUTHORIZATION_URL = '/authorize'
CALLBACK_URL = '/request_token_ready'
RESOURCE_URL = '/photos'

Otherwise calling methods like:

token = client.fetch_request_token(oauth_request)

will result in a request to this full URL:

http://localhost:8080https://photos.example.net/request_token

Can you add a comment or something to explain this?

Original issue reported on code.google.com by rwilli...@gmail.com on 12 Feb 2009 at 12:28

GoogleCodeExporter commented 8 years ago

Original comment by leah.culver on 17 Feb 2009 at 8:37

GoogleCodeExporter commented 8 years ago
The server and port settings are for the client and the urls are for the example
server. The example client isn't really meant to be used in production... it's 
really
just an example and a test.

Sorry that this isn't very clear. I've added some comments so I hope that helps.
There are plenty of implementations of an OAuth client out in the wild but most 
are
specific to your web framework.

Original comment by leah.culver on 18 Feb 2009 at 12:20