3

I have an application that uses the GAE users service and fedarated login.

Latetly for one user I get an xml feed in the nickname property.

For all the other fields the data is ok

In details:

My register handler:

class RegisterPersonHandler(UserPageHandler):

    def get(self):
        user = users.get_current_user()
        if not user:
            self.redirect(users.create_login_url(self.request.uri), abort=True)
            return
        person = Person.get_or_insert(user.user_id())
        if not self._register(person, user):
            logging.warning('Warning registration failed')
            return
        self.redirect("/")

    def post(self):
        self.view("No reason to be here Mr Jiggles ;-)")
        return

    @ndb.transactional()
    def _register(self, person, user):
        ''' Registration process happens here
        '''
        # check if the person has info and if not create it
        info = PersonInfo.query(ancestor=person.key).get()
        if not info:
            info = PersonInfo(id=user.user_id(), parent=person.key)
            info.nick_name = user.nickname()
            info.email = user.email()
            info.put()
        return True

At the nickname field I get the following string:

https://www.google.com/accounts/o8/id?id=[id_of_the_user]

Opening that url in my browser lets me download an xml with the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS xmlns:xrds="xri://$xrds" xmlns="xri://$xrd*($v*2.0)">
<XRD>
<Service priority="0">
<Type>http://specs.openid.net/auth/2.0/signon</Type>
<Type>http://openid.net/srv/ax/1.0</Type>
<Type>http://specs.openid.net/extensions/ui/1.0/mode/popup</Type>
<Type>http://specs.openid.net/extensions/ui/1.0/icon</Type>
<Type>http://specs.openid.net/extensions/pape/1.0</Type>
<URI>https://www.google.com/accounts/o8/ud</URI>
</Service>
<Service priority="10">
<Type>http://specs.openid.net/auth/2.0/signon</Type>
<Type>http://openid.net/srv/ax/1.0</Type>
<Type>http://specs.openid.net/extensions/ui/1.0/mode/popup</Type>
<Type>http://specs.openid.net/extensions/ui/1.0/icon</Type>
<Type>http://specs.openid.net/extensions/pape/1.0</Type>
<URI>https://www.google.com/accounts/o8/ud?source=mail</URI>
</Service>
<Service priority="10">
<Type>http://specs.openid.net/auth/2.0/signon</Type>
<Type>http://openid.net/srv/ax/1.0</Type>
<Type>http://specs.openid.net/extensions/ui/1.0/mode/popup</Type>
<Type>http://specs.openid.net/extensions/ui/1.0/icon</Type>
<Type>http://specs.openid.net/extensions/pape/1.0</Type>
<URI>https://www.google.com/accounts/o8/ud?source=gmail.com</URI>
</Service>
<Service priority="10">
<Type>http://specs.openid.net/auth/2.0/signon</Type>
<Type>http://openid.net/srv/ax/1.0</Type>
<Type>http://specs.openid.net/extensions/ui/1.0/mode/popup</Type>
<Type>http://specs.openid.net/extensions/ui/1.0/icon</Type>
<Type>http://specs.openid.net/extensions/pape/1.0</Type>
<URI>https://www.google.com/accounts/o8/ud?source=googlemail.com</URI>
</Service>
<Service priority="10">
<Type>http://specs.openid.net/auth/2.0/signon</Type>
<Type>http://openid.net/srv/ax/1.0</Type>
<Type>http://specs.openid.net/extensions/ui/1.0/mode/popup</Type>
<Type>http://specs.openid.net/extensions/ui/1.0/icon</Type>
<Type>http://specs.openid.net/extensions/pape/1.0</Type>
<URI>https://www.google.com/accounts/o8/ud?source=profiles</URI>
</Service>
</XRD>
</xrds:XRDS>

What am I missing?

EDIT

Because this is getting nowhere, I would like to at least know:

Can I trust the nickname propery to return a string with a useable nickname for the user? I have already figured out that this property imposes a risk if you want to expose it to public data, due to most of the cases beeing the "username" or email address...

BTW

From the Docs

nickname() Returns the "nickname" of the user, a displayable name. For Google Accounts users, the nickname is either the "name" portion of the user's email address if the address is in the same domain as the application, or the user's full email address otherwise. For OpenID users, the nickname is the OpenID identifier.

and a bit later

email() Returns the email address of the user. If you use OpenID, you should not rely on this email address to be correct. Applications should use nickname for displayable names.

Jimmy Kane
  • 16,223
  • 11
  • 86
  • 117

0 Answers0