コード例 #1
0
 protected void openid_ValidationSucceeded(object sender, EventArgs e)
 {
     // User has been validated!  Respond appropriately.        
     OpenIdClient openIdClient = (OpenIdClient)sender;
     OpenIdUser openIdUser = openIdClient.RetrieveUser();
     LoginInfo loginInfo = new LoginInfo();
     loginInfo.openID = openIdUser.BaseIdentity;
     String firstName = openIdUser.GetValue("http://openid.dossia.org/participant/firstName");
     String lastName = openIdUser.GetValue("http://openid.dossia.org/participant/lastName");
     loginInfo.firstName = firstName;
     loginInfo.lastName = lastName;
     Session["loginInfo"] = loginInfo;
     Response.Redirect("Default.aspx", true);
 }
コード例 #2
0
 protected void openid_ValidationSucceeded(object sender, EventArgs e)
 {
     // User has been validated!  Respond appropriately.        
     OpenIdClient openIdClient = (OpenIdClient)sender;
     OpenIdUser openIdUser = openIdClient.RetrieveUser();
     LoginInfo loginInfo = new LoginInfo();
     loginInfo.openID = openIdUser.BaseIdentity;
     loginInfo.extensionData = openIdUser.ExtensionData;
     OAuthClient oauthClient = DossiaOauth.createDossiaOAuthClient();
     OAuthExtension oauthExtension = new OAuthExtension(openIdClient, oauthClient);
     loginInfo.accessToken = oauthExtension.GetAccessToken();
     Session["loginInfo"] = loginInfo;
     Response.Redirect("Default.aspx", true);
 }