Retrieving Email Address from Yesid OpenID

Is there a way to get the email address of the user after authentication using the Yesod OpenId implementation?

In my test application, the redirection and authentication happens correctly, and maybe AuthId gives me the identifier of the corresponding entry in my database. However, this identification is saved as a URL.

I can work with this, but it would be nice to also get the actual email used for authentication, as other OpenId packages allow. Is this possible with Yesod OpenId? Is there something I can do with authOpenIdExtended (it is unclear how to use it)?

+3
source share
2 answers

Having studied this again, I found the answer:

-, authOpenIdExtended :

authPlugins _ = [authOpenIdExtended [("openid.ns.ax", "http://openid.net/srv/ax/1.0"), 
                                     ("openid.ax.mode", "fetch_request"), 
                                     ("openid.ax.type.email", "http://axschema.org/contact/email"),
                                     ("openid.ax.required", "email")
                                     ]]

: https://developers.google.com/accounts/docs/OpenID Google Yahoo.

, , "credsExtra creds" creds, getAuthId. , OpenId. authOpenIdExtended key/value "openid.ax.value.email" ( Yahoo) "openid.ext1.value.email" ( Google). , Google "openid.ax.value.email", .

, -.

+2

GoogleEmail. , OpenID . - , OpenID, / , .

+3

All Articles