Retrieving username from OpenID

I use OpenID authentication in conjunction with traditional case / signature authentication on my site. When someone first signs up using OpenID, I would like to be able to retrieve the username for use on the site.

This is easy for some openid identifiers - for example:

http://username.myopenid.com/
http://username.livejournal.com/
http://claimid.com/username

However, this is not always the case, since any URL can essentially be used as an OpenID.

One option is to maintain a list of URL formats as described above, where I know that I can extract the username and automatically assign the username in other cases (which can be changed after logging in). Is there another, more flexible way to retrieve a username?

+3
source share
3 answers

OpenID has an API for retrieving user information such as name, email address, etc. I would just use this name if the user allows you to access it.

+2
source

This tutorial seems to cover what you want and more attributes.

+3
source

OpenID - , / OpenID, URL-, .

, URL- , (, Google) - , . .

+1

Source: https://habr.com/ru/post/1703616/


All Articles