/// <summary> /// Initializes a new <see cref="OAuthCreatingTicketContext"/>. /// </summary> /// <param name="context">The HTTP environment.</param> /// <param name="options">The options used by the authentication middleware.</param> /// <param name="backchannel">The HTTP client used by the authentication middleware</param> /// <param name="ticket">The <see cref="AuthenticationTicket"/>.</param> /// <param name="tokens">The tokens returned from the token endpoint.</param> /// <param name="user">The JSON-serialized user.</param> public WeixinOAuthCreatingTicketContext( HttpContext context, AuthenticationScheme scheme, WeixinOAuthOptions options, HttpClient backchannel, AuthenticationTicket ticket, WeixinOAuthTokenResponse tokens, JObject user) : base(context, scheme, options) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } if (backchannel == null) { throw new ArgumentNullException(nameof(backchannel)); } if (tokens == null) { throw new ArgumentNullException(nameof(tokens)); } TokenResponse = tokens; Backchannel = backchannel; Ticket = ticket; User = user ?? new JObject(); }
/// <summary> /// Initializes a new <see cref="WeixinOAuthCreatingTicketContext"/>. /// </summary> /// <param name="context">The HTTP environment.</param> /// <param name="options">The options used by the authentication middleware.</param> /// <param name="backchannel">The HTTP client used by the authentication middleware</param> /// <param name="ticket">The <see cref="AuthenticationTicket"/>.</param> /// <param name="tokens">The tokens returned from the token endpoint.</param> public WeixinOAuthCreatingTicketContext( HttpContext context, AuthenticationScheme scheme, WeixinOAuthOptions options, HttpClient backchannel, AuthenticationTicket ticket, WeixinOAuthTokenResponse tokens) : this(context, scheme, options, backchannel, ticket, tokens, user : new JObject()) { }