Click here to Skip to main content
15,886,049 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a page Mywebhome.aspx , in which i use the the given source below for button ...

<asp:Button ID="btnGoogleLogin" runat="server" CommandArgument="https://www.google.com/accounts/o8/id" OnCommand="btnGoogleLogin_Click" Text="Sign In with Google" OnClick="btnGoogleLogin_Click1"/>


and Mywebhome.cs code is as given below ..

protected void Page_Load(object sender, EventArgs e)
{
OpenIdRelyingParty rp = new OpenIdRelyingParty();
var response = rp.GetResponse();
if (response != null)
{
switch (response.Status)
{
case AuthenticationStatus.Authenticated:
Session["GoogleIdentifier"] = response.ClaimedIdentifier.ToString();
Response.Redirect("Default.aspx");
break;
case AuthenticationStatus.Canceled:
Session["GoogleIdentifier"] = "Cancelled.";
break;
case AuthenticationStatus.Failed:
Session["GoogleIdentifier"] = "Login Failed.";
break;
}
}
}

protected void btnGoogleLogin_Click(object sender, CommandEventArgs e)
{
string discoveryUri = e.CommandArgument.ToString();
OpenIdRelyingParty openid = new OpenIdRelyingParty();
var URIbuilder = new UriBuilder(Request.Url) { Query = "" };
var req = openid.CreateRequest(discoveryUri, URIbuilder.Uri, URIbuilder.Uri);
req.RedirectToProvider();



}





and after authentication i redirect it to a default.aspx page ...


Code is working proprely , but problem is that .. how i will found login "email id" and "user name" of google ..


can any one help please ...

the code which is i use is using from this post ..

"http://dotnet.dzone.com/news/implementing-google-account"
Posted
Comments
GDdixit 20-Mar-14 5:59am    
pls suggest something ... ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900