// 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 System.Security.Claims; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Authentication; using Newtonsoft.Json.Linq; namespace Microsoft.AspNetCore.Authentication.Twitter { /// /// Contains information about the login session as well as the user . /// public class TwitterCreatingTicketContext : BaseTwitterContext { /// /// Initializes a /// /// The HTTP environment /// The options for Twitter /// Twitter user ID /// Twitter screen name /// Twitter access token /// Twitter access token secret /// User details public TwitterCreatingTicketContext( HttpContext context, TwitterOptions options, string userId, string screenName, string accessToken, string accessTokenSecret, JObject user) : base(context, options) { UserId = userId; ScreenName = screenName; AccessToken = accessToken; AccessTokenSecret = accessTokenSecret; User = user ?? new JObject(); } /// /// Gets the Twitter user ID /// public string UserId { get; } /// /// Gets the Twitter screen name /// public string ScreenName { get; } /// /// Gets the Twitter access token /// public string AccessToken { get; } /// /// Gets the Twitter access token secret /// public string AccessTokenSecret { get; } /// /// Gets the JSON-serialized user or an empty /// if it is not available. /// public JObject User { get; } /// /// Gets the representing the user /// public ClaimsPrincipal Principal { get; set; } /// /// Gets or sets a property bag for common authentication properties /// public AuthenticationProperties Properties { get; set; } } }