问题
In my site, I am using authentication based on OpenID. I am requesting 'email address' from the OpenID provider. The problem is each provider is sending the email address in their own parameter in GET response after authentication. I am listing down three of what I have seen
StackExchange
openid_alias3_value_alias1
Yahoo!
openid_ax_value_email
openid_ext1_value_email
It is difficult (and not standard) to write separate lines of code for each OpenID provider. Is there a standard for this?
(added a bug : https://meta.stackexchange.com/questions/106922/stackexchange-openid-parameter-for-email-should-be-openid-ax-value-email)
回答1:
As there's no identifier like openid.email
defined in the Positive Assertions section of the OpenID Auth 2.0 specs, I'd say: no, there is no such standard.
OpenID supports extensions to carry extra data like email
, but it's completely up to the OpenID provider which data to reveal (if any at all), what identifiers to use and where to place them in their extension namespace hierarchy.
来源:https://stackoverflow.com/questions/7497943/common-parameter-to-retrieve-email-address-from-openid-provider