aspnet-starter-kit
aspnet-starter-kit copied to clipboard
Add [Login with Facebook] button
- [ ] Create
/client/components/ButtonUI component powered by React and MDL - [ ] Put
<Button>Login with Facebook</Button>in the header (see/client/components/Layout) - [ ] Clicking on this button should trigger an HTTP POST request to
/login/facebook
//html
<asp:Button ID="btnLogin" runat="server" Text="Login with FaceBook" OnClick="Login" /> <asp:Panel ID="pnlFaceBookUser" runat="server" Visible="false">
|
|
| ID: |
| UserName: |
| Name: |
| Email: |
/asp:Panel
//database
using ASPSnippets.FaceBookAPI; using System.Web.Script.Serialization;
public class FaceBookUser { public string Id { get; set; } public string Name { get; set; } public string UserName { get; set; } public string PictureUrl { get; set; } public string Email { get; set; } }
//authentic user using facebook account
protected void Login(object sender, EventArgs e) { FaceBookConnect.Authorize("user_photos,email", Request.Url.AbsoluteUri.Split('?')[0]); }