// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.Framework.Internal;
using Newtonsoft.Json.Linq;
namespace Microsoft.AspNet.Authentication.Facebook
{
///
/// Contains static methods that allow to extract user's information from a
/// instance retrieved from Facebook after a successful authentication process.
///
public static class FacebookHelper
{
///
/// Gets the Facebook user ID.
///
public static string GetId([NotNull] JObject user) => user.Value("id");
///
/// Gets the user's name.
///
public static string GetName([NotNull] JObject user) => user.Value("name");
///
/// Gets the user's link.
///
public static string GetLink([NotNull] JObject user) => user.Value("link");
///
/// Gets the Facebook username.
///
public static string GetUserName([NotNull] JObject user) => user.Value("username");
///
/// Gets the Facebook email.
///
public static string GetEmail([NotNull] JObject user) => user.Value("email");
}
}