public static IApplicationBuilder UseBearerAuthentication(this IApplicationBuilder app, BearerAuthenticationOptions options) { if (app == null) throw new ArgumentNullException(nameof(app)); if (options == null) throw new ArgumentNullException(nameof(options)); return app.UseMiddleware<BearerAuthenticationMiddleware>(options); }
public static IApplicationBuilder UseBearerAuthentication(this IApplicationBuilder app, Action<BearerAuthenticationOptions> configureOptions) { if (app == null) throw new ArgumentNullException(nameof(app)); var options = new BearerAuthenticationOptions(); configureOptions?.Invoke(options); return UseBearerAuthentication(app, options); }
public BearerTokenService( IOptions <AuthenticationOptions> authenticationOptionsAccessor, IUserManager userManager, IUnitOfWork unitOfWork ) : base(unitOfWork) { _authenticationOptions = authenticationOptionsAccessor.Value.Bearer; _userManager = userManager; }
public BaseBearerContext( HttpContext context, BearerAuthenticationOptions options) : base(context) { if (options == null) { throw new ArgumentNullException(nameof(options)); } Options = options; }
public BearerSignedInContext( HttpContext context, BearerAuthenticationOptions options, string authenticationScheme, ClaimsPrincipal principal, AuthenticationProperties properties) : base(context, options) { AuthenticationScheme = authenticationScheme; Principal = principal; Properties = properties; }
public BearerUnauthorizedContext(HttpContext context, BearerAuthenticationOptions options) : base(context, options) { }
public BearerBaseContext(HttpContext context, BearerAuthenticationOptions options) : base(context) { Options = options; }
public BearerForbiddenContext(HttpContext context, BearerAuthenticationOptions options) : base(context, options) { }
public BearerSigningOutContext(HttpContext context, BearerAuthenticationOptions options) : base(context, options) { }
public BearerValidatePrincipalContext(HttpContext context, BearerAuthenticationOptions options, ClaimsPrincipal principal, AuthenticationProperties properties) : base(context, options) { Principal = principal; Properties = properties; }
/// <summary> /// Adds the <see cref="BearerAuthenticationMiddleware"/> middleware to the specified <see cref="IApplicationBuilder"/>, which enables bearer authentication capabilities. /// </summary> /// <param name="app">The <see cref="IApplicationBuilder"/> to add the middleware to.</param> /// <param name="options">A <see cref="BearerAuthenticationOptions"/> that specifies options for the middleware.</param> /// <returns>A reference to this instance after the operation has completed.</returns> public static IApplicationBuilder UseBearerAuthentication(this IApplicationBuilder app, BearerAuthenticationOptions options) { if (app == null) { throw new ArgumentNullException(nameof(app)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } return(app.UseMiddleware <BearerAuthenticationMiddleware>(Options.Create(options))); }
public BearerValidatePrincipalContext(HttpContext context, AuthenticationTicket ticket, BearerAuthenticationOptions options) : base(context, options) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (ticket == null) { throw new ArgumentNullException(nameof(ticket)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } Principal = ticket.Principal; Properties = ticket.Properties; }