What should I set REALM to, using LightOpenID, for Google url's to remain consistent, for storage in my database?

StackOverflow https://stackoverflow.com/questions/5453156

  •  12-11-2019
  •  | 
  •  

문제

Recently, I noticed that when storing the resulting identity in my database, Google would sometimes return a different identity for the same user, resulting in two database entries for a single user.

After a little research, I figured out that Google uses $openid->realm along with the username to create the identity. And by default the realm becomes the URL of your website. Using LightOpenID, what should I set $openid->realm to for the resulting Google identities to remain consistent, so that I can store them in my database? Can I just set 'realm' to whatever I like? Or does it have to relate to my URL?

도움이 되었습니까?

해결책

I looked at the spec:

http://openid.net/specs/openid-authentication-2_0.html#realms

After some trial and error, I ended up using http://*.mydomain.com as the realm and my problem was solved. Google would always return the same identity. Originally I was trying simply *.mydomain.com and that was creating an error.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top