/// <summary> /// Creates a new context object. /// </summary> /// <param name="context">The HTTP request context.</param> /// <param name="options">The Twitter2 middleware options.</param> /// <param name="properties">The authentication properties of the challenge.</param> /// <param name="redirectUri">The initial redirect URI.</param> public Twitter2RedirectToAuthorizationEndpointContext(HttpContext context, Twitter2Options options, AuthenticationProperties properties, string redirectUri) : base(context, options) { RedirectUri = redirectUri; Properties = properties; }
/// <summary> /// Creates a new context object. /// </summary> /// <param name="context">The HTTP request context.</param> /// <param name="options">The Twitter2 middleware options.</param> /// <param name="properties">The authentication properties of the challenge.</param> /// <param name="redirectUri">The initial redirect URI.</param> public Twitter2RedirectToAuthorizationEndpointContext(HttpContext context, Twitter2Options options, AuthenticationProperties properties, string redirectUri) : base(context, options) { RedirectUri = redirectUri; Properties = properties; }
/// <summary> /// Adds the <see cref="Twitter2Middleware"/> middleware to the specified <see cref="IApplicationBuilder"/>, which enables Twitter2 authentication capabilities. /// </summary> /// <param name="app">The <see cref="IApplicationBuilder"/> to add the middleware to.</param> /// <param name="options">A <see cref="Twitter2Options"/> that specifies options for the middleware.</param> /// <returns>A reference to this instance after the operation has completed.</returns> public static IApplicationBuilder UseTwitter2Authentication(this IApplicationBuilder app, Twitter2Options options) { if (app == null) { throw new ArgumentNullException(nameof(app)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } return app.UseMiddleware<Twitter2Middleware>(options); }
/// <summary> /// Adds the <see cref="Twitter2Middleware"/> middleware to the specified <see cref="IApplicationBuilder"/>, which enables Twitter2 authentication capabilities. /// </summary> /// <param name="app">The <see cref="IApplicationBuilder"/> to add the middleware to.</param> /// <param name="configureOptions">An action delegate to configure the provided <see cref="Twitter2Options"/>.</param> /// <returns>A reference to this instance after the operation has completed.</returns> public static IApplicationBuilder UseTwitter2Authentication(this IApplicationBuilder app, Action<Twitter2Options> configureOptions = null) { if (app == null) { throw new ArgumentNullException(nameof(app)); } var options = new Twitter2Options(); if (configureOptions != null) { configureOptions(options); } return app.UseTwitter2Authentication(options); }
/// <summary> /// Initializes a <see cref="Twitter2CreatingTicketContext"/> /// </summary> /// <param name="context">The HTTP environment</param> /// <param name="userId">Twitter2 user ID</param> /// <param name="screenName">Twitter2 screen name</param> /// <param name="accessToken">Twitter2 access token</param> /// <param name="accessTokenSecret">Twitter2 access token secret</param> public Twitter2CreatingTicketContext( HttpContext context, Twitter2Options options, string userId, string screenName, string accessToken, string accessTokenSecret) : base(context, options) { UserId = userId; ScreenName = screenName; AccessToken = accessToken; AccessTokenSecret = accessTokenSecret; }
/// <summary> /// Initializes a <see cref="Twitter2CreatingTicketContext"/> /// </summary> /// <param name="context">The HTTP environment</param> /// <param name="userId">Twitter2 user ID</param> /// <param name="screenName">Twitter2 screen name</param> /// <param name="accessToken">Twitter2 access token</param> /// <param name="accessTokenSecret">Twitter2 access token secret</param> public Twitter2CreatingTicketContext( HttpContext context, Twitter2Options options, string userId, string screenName, string accessToken, string accessTokenSecret) : base(context, options) { UserId = userId; ScreenName = screenName; AccessToken = accessToken; AccessTokenSecret = accessTokenSecret; }
/// <summary> /// Initializes a <see cref="BaseTwitter2Context"/> /// </summary> /// <param name="context">The HTTP environment</param> /// <param name="options">The options for Twitter2</param> public BaseTwitter2Context(HttpContext context, Twitter2Options options) : base(context) { Options = options; }
/// <summary> /// Initializes a <see cref="BaseTwitter2Context"/> /// </summary> /// <param name="context">The HTTP environment</param> /// <param name="options">The options for Twitter2</param> public BaseTwitter2Context(HttpContext context, Twitter2Options options) : base(context) { Options = options; }