I’m trying to implement OpenId login for a web application. Whenever new user who logs in via OpenId I create a new user on the sustem, and among the data I store their openid URL, so that next time they login with that user.
I’m testing this with my Gmail OpenID, and the problem is that everytime I do this, Google sends a different openid URL, that is, https://www.google.com/accounts/o8/id?id=SomethingThatChangesFromTimeToTime
Of course I’m then not able to tell wheter this is or not a new user. I’m a bit puzzled: shouldn’t the openid identifier always remain the same?
Google’s OpenID identifier is more or less a hashed representation of multiple data including the host the request came from (more exactly the
openid.realmparameter sent to the provider). So if your host changes from time to time (like the port and ip address changes), then the ID will change from time to time too. StackOverflow uses a workaround for this issue too. Check these posts:Here is an FAQ excerpt from google: