Hi Larry,

thanks for the quick reply. It might have something to do with the 
certificate. Me calling it a production server is actually not totally 
correct, it's more of a staging server, and therefore the SSL certificate 
does not match the domain name.

Using basic auth was more of a way to find out what is going wrong. Our 
goal is to have API authentication based on the auth table in web2py. With 
basic auth and Apache/WSGI, aren't we restricted to a password-file and 
therefore a separate user/pass set than in web2py?


On Monday, September 16, 2013 6:08:14 PM UTC+2, Larry Weinberg wrote:
>
> I'm doing exactly that and not running into troubles.
> Could it be something about your SSL certificate?  If it's not a well 
> trusted certificate sometimes you need to install it on the client side.
> Does it match the domain name you are calling?
>
> I test my server with the following python code and I can use basic 
> authentication with restful calls:
>
> import requests
> from   requests.auth import HTTPBasicAuth
> import json
>
> user      = 'myn...@my.com <javascript:>'
> passwd = 'mypassword'
> url        = 'http://mysrver/app/controller/resfullcall.json'
> r           = requests.get(url, auth=HTTPBasicAuth(user, passwd))
> # print r.text
>
> # Decode the JSON response and get the access token
> decodedDict         = json.loads(r.text)
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to