Class AMNetFixedKeyboardInteractiveAuthenticator
Keyboard-interactive authenticator for a single fixed response.
Inherited Members
Namespace: ApacheMinaSSHD.NET.Wrapper.Abstractions
Assembly: ApacheMinaSSHD.NET.Wrapper.dll
Syntax
public sealed class AMNetFixedKeyboardInteractiveAuthenticator : IAMNetKeyboardInteractiveAuthenticator, IDisposable
Remarks
This class is intended for samples, tests, or simple controlled deployments. Production applications should normally validate one-time codes or secondary factors through their own identity provider.
Constructors
| Edit this page View SourceAMNetFixedKeyboardInteractiveAuthenticator(string, string?, string, string, string)
Creates a fixed keyboard-interactive authenticator.
Declaration
public AMNetFixedKeyboardInteractiveAuthenticator(string expectedResponse, string? username = null, string prompt = "Verification code", string interactionName = "Authentication", string instruction = "Enter the verification code.")
Parameters
| Type | Name | Description |
|---|---|---|
| string | expectedResponse | The exact response to accept. |
| string | username | Optional exact username to accept. When null, any username can answer the challenge. |
| string | prompt | Prompt text shown to the client. |
| string | interactionName | Challenge name shown to the client. |
| string | instruction | Instruction text shown with the challenge. |
Properties
| Edit this page View SourceInstruction
Gets the instruction text shown with the challenge.
Declaration
public string Instruction { get; }
Property Value
| Type | Description |
|---|---|
| string |
InteractionName
Gets the challenge name shown to the client.
Declaration
public string InteractionName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Prompt
Gets the prompt text shown to the client.
Declaration
public string Prompt { get; }
Property Value
| Type | Description |
|---|---|
| string |
Username
Gets the optional exact username accepted by this authenticator.
Declaration
public string? Username { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceAuthenticate(ISshSession, string, IResponseList)
Validates the client's responses to the generated challenge.
Declaration
public bool Authenticate(ISshSession session, string username, IResponseList response)
Parameters
| Type | Name | Description |
|---|---|---|
| ISshSession | session | Session metadata for the connection being authenticated. |
| string | username | The username requested by the client. |
| IResponseList | response | The responses supplied by the client. |
Returns
| Type | Description |
|---|---|
| bool |
|
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
GenerateChallenge(string, ISshChallenge)
Populates the challenge sent to the client.
Declaration
public void GenerateChallenge(string username, ISshChallenge challenge)
Parameters
| Type | Name | Description |
|---|---|---|
| string | username | The username requested by the client. |
| ISshChallenge | challenge | The challenge object to populate with prompts. |