OAuthMiddleware<TOptions> Class¶
An ASP.NET Core middleware for authenticating users using OAuth services.
- Namespace
Microsoft.AspNetCore.Authentication.OAuth
- Assemblies
- Microsoft.AspNetCore.Authentication.OAuth
Inheritance Hierarchy¶
System.Object
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware{{TOptions}}
Microsoft.AspNetCore.Authentication.OAuth.OAuthMiddleware<TOptions>
Syntax¶
public class OAuthMiddleware<TOptions> : AuthenticationMiddleware<TOptions> where TOptions : OAuthOptions, new ()
-
class
Microsoft.AspNetCore.Authentication.OAuth.
OAuthMiddleware<TOptions>
¶
Constructors¶
-
OAuthMiddleware
(Microsoft.AspNetCore.Http.RequestDelegate, Microsoft.AspNetCore.DataProtection.IDataProtectionProvider, Microsoft.Extensions.Logging.ILoggerFactory, System.Text.Encodings.Web.UrlEncoder, Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Authentication.SharedAuthenticationOptions>, Microsoft.Extensions.Options.IOptions<TOptions>)¶ Initializes a new
Microsoft.AspNetCore.Authentication.OAuth.OAuthMiddleware`1
.Arguments: - next (Microsoft.AspNetCore.Http.RequestDelegate) – The next middleware in the HTTP pipeline to invoke.
- encoder (System.Text.Encodings.Web.UrlEncoder) – The
System.Text.Encodings.Web.UrlEncoder
. - sharedOptions (Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Authentication.SharedAuthenticationOptions>) – The
Microsoft.AspNetCore.Authentication.SharedAuthenticationOptions
configuration options for this middleware. - options (Microsoft.Extensions.Options.IOptions<TOptions>) – Configuration options for the middleware.
public OAuthMiddleware(RequestDelegate next, IDataProtectionProvider dataProtectionProvider, ILoggerFactory loggerFactory, UrlEncoder encoder, IOptions<SharedAuthenticationOptions> sharedOptions, IOptions<TOptions> options)
-
Properties¶
-
Microsoft.AspNetCore.Authentication.OAuth.OAuthMiddleware<TOptions>.
Backchannel
¶ Return type: System.Net.Http.HttpClient protected HttpClient Backchannel { get; }
-
Methods¶
-
CreateHandler
()¶ Provides the
Microsoft.AspNetCore.Authentication.AuthenticationHandler`1
object for processing authentication-related requests.Return type: Microsoft.AspNetCore.Authentication.AuthenticationHandler<TOptions> Returns: An Microsoft.AspNetCore.Authentication.AuthenticationHandler`1
configured with theMicrosoft.AspNetCore.Builder.OAuthOptions
supplied to the constructor.protected override AuthenticationHandler<TOptions> CreateHandler()
-