Unosquare
    Show / Hide Table of Contents

    Class BasicAuthenticationModule

    Simple HTTP basic authentication module that stores user names and passwords in a , and has no user roles.

    Inheritance
    Object
    WebModuleBase
    AuthenticationModuleBase
    BasicAuthenticationModuleBase
    BasicAuthenticationModule
    Implements
    IWebModuleImpl
    IWebModule
    Inherited Members
    BasicAuthenticationModuleBase.AuthenticationType
    BasicAuthenticationModuleBase.Realm
    BasicAuthenticationModuleBase.AuthenticateAsync(IHttpContext)
    AuthenticationModuleBase.IsFinalHandler
    AuthenticationModuleBase.OnMissingCredentials
    AuthenticationModuleBase.OnInvalidCredentials
    AuthenticationModuleBase.OnRequestAsync(IHttpContext)
    WebModuleBase.Container
    WebModuleBase.IWebModuleImpl.SetContainer(IWebModuleContainer)
    WebModuleBase.BaseRoute
    WebModuleBase.OnUnhandledException
    WebModuleBase.OnHttpException
    WebModuleBase.LogSource
    WebModuleBase.Start(CancellationToken)
    WebModuleBase.MatchUrlPath(String)
    WebModuleBase.HandleRequestAsync(IHttpContext)
    WebModuleBase.OnStart(CancellationToken)
    WebModuleBase.SetContainer(IWebModuleContainer)
    Namespace: EmbedIO.Authentication
    Syntax
    public class BasicAuthenticationModule : BasicAuthenticationModuleBase, IWebModuleImpl, IWebModule

    Constructors

    BasicAuthenticationModule(String, String)

    Initializes a new instance of the BasicAuthenticationModule class.

    Declaration
    public BasicAuthenticationModule(string baseRoute, string realm = null)
    Parameters
    Type Name Description
    String baseRoute

    The base route.

    String realm

    The authentication realm.

    Remarks

    If realm is null or the empty string, the Realm property will be set equal to BaseRoute.

    Properties

    Accounts

    Gets a dictionary of valid user names and passwords.

    Declaration
    public ConcurrentDictionary<string, string> Accounts { get; }
    Property Value
    Type Description
    ConcurrentDictionary<String, String>

    Methods

    VerifyCredentialsAsync(String, String, String, IList<String>, CancellationToken)

    Verifies the credentials given in the Authentication request header.

    Declaration
    protected override sealed Task<bool> VerifyCredentialsAsync(string path, string userName, string password, IList<string> roles, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    String path

    The URL path requested by the client. Note that this is relative to the module's BaseRoute.

    String userName

    The user name.

    String password

    The password, or the empty string if none has been given.

    IList<String> roles

    A list to which the user's roles can be added.

    CancellationToken cancellationToken

    A use to cancel the operation.

    Returns
    Type Description
    Task<Boolean>

    A whose result will be true if the given credentials are valid, false if they are not.

    Overrides
    BasicAuthenticationModuleBase.VerifyCredentialsAsync(String, String, String, IList<String>, CancellationToken)

    Implements

    IWebModuleImpl
    IWebModule

    Comments

    Back to top Copyright © 2017-2019 Unosquare