On Mar 7, 2011, at 7:51 AM, Alexei Vinidiktov wrote:
> When I do basic authentication to a web2py app from a *desktop* app (tried 
> two test apps I wrote in Python and REALbasic) I can get the user's first 
> name and last name from the web app, but I can't get his/her id.
> 
> @service.xmlrpc     
> @service.jsonrpc
> def getUserName():
>     return str(auth.user_id) + " " + auth.user.first_name + " " + 
> auth.user.last_name
> 
> The above function returns "None" for the user id and the correct first name 
> and last name.
> 
> The same function called from a *web based* user interface (written with 
> qooxdoo and authenticated via the standard login form) works fine returning 
> both the user id and his first and last names. 
> 
> What am I doing wrong?
> 
> I'm on web2py 1.89.5
> 

Just a shot in the dark: try auth.user.id instead.

Reply via email to