views:

105

answers:

1

I'm trying OpenID support for Google App Engine on a small project i have on my machine but when i call:

users.create_login_url(federated_identity = provider_url)

i get this error:

google_appengine/google/appengine/api/user_service_pb.py", line 178, in ByteSize
    n += self.lengthString(len(self.destination_url_))
TypeError: object of type 'NoneType' has no len()

provider_url is https://www.google.com/accounts/o8/id

any clue?

+5  A: 

You should normally pass a dest_url parameter to create_login_url, unless you're certain that there is a "current request" whose url you want to use instead. Apparently, the latter condition does not obtain, so the destination url stays None, which causes the problem you're observing. Passing an explicit dest_url should fix it.

Alex Martelli
@Alex that did the trick, many thanks. I don't understand when you say "unless you're certain that there is a "current request" whose url you want to use instead".
systempuntoout
@system, if you're in the middle of responding to a request (and the destination URL for the login is exactly the URL that request is asking you to serve) then you shouldn't have to repeat that bit of info in `dest_url` (though it can't hurt if you do, the system should be able to deduce it on your behalf if you don't pass it).
Alex Martelli
@Alex perfect, thanks again.
systempuntoout
@system, you're welcome!
Alex Martelli