Access user email address in Login with Blockstack integration

I am developing the login with blockstack integration for an app “Prism”. In this app I require user to signup using their email address, so I am looking for a way to get the user’s email address when logging in through Blockstack (in the same way it happens with Facebook and Google login).
However at the moment I haven’t seen any way to access the user’s email address.
In my current login scenario once the user is logged in and I access the user’s data I basically get a JSON object with several fields (all of them empty) but there is no mention about the user’s email address.
I see there is a “Scopes” parameter I can set in the redirectToSignIn function, when requesting the user to sign in, but I don’t see anywhere in the documentation what value I can set for scopes.
Here is a screen of my “login with blockstack” implementation:

So, in short: is there any way I can ask for user’s email address when he is logging through Blockstack? And if so, how can I get it into my app?



Also, I am looking for a unique identifier for the user on blockstack (when the user logs in my app through blockstack).

Can you please confirm me that the field “userData.appPrivateKey” is a Blockstack unique identifier for the user on my app, so that the same value will be returned if the same blockstack user login in different sessions in my app?

Apps currently don’t have the permission to request the email scope. But this is something we could potentially open up to developers. cc: @larry @ryan

You can use the appPrivateKey for this purpose.

This is totally something we should do - I’ve opened a feature issue for this. It would be great if you could comment on it so that we have a better idea of the demand for this:

1 Like

I have also added my comments to the issue on Github.