Class BasicAuthenticationModule
Simple HTTP basic authentication module that stores user names and passwords
in a
Inheritance
BasicAuthenticationModule
Inherited Members
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
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 |
Returns
Type | Description |
---|---|
Task<Boolean> | A |