I have implemented this simple code as described here ( vs 2010 , webforms)
protected void Page_Load(object sender, EventArgs e)
{
var openid = new OpenIdRelyingParty();
var response = openid.GetResponse();
if (response != null && response.Status == AuthenticationStatus.Authenticated)
{
FormsAuthentication.RedirectFromLoginPage(response.ClaimedIdentifier, false);
}
}
Click
function :
protected void btnGoogle_Click(object sender, ImageClickEventArgs e)
{
using (OpenIdRelyingParty openid = new OpenIdRelyingParty())
{
var request = openid.CreateRequest("https://www.google.com/accounts/o8/id");
request.RedirectToProvider();
}
}
Question #1
When I click the login ( via google) it opens this consent screen :
But how come it works ? I thought that I have to create an API key in Google developer console in order to allow people to login. ( like I did here with other app of myne->)
Obviously I didn't create any "localhost
" app. so how does it still works ? (again it's a demo I've downloaded from the internet).
Question #2
Once I have a result :
How can I fetch user data ? ( email for example) {the article doesn't mention it}
nb DotNetOpenAuth ver 3.4.6.10357