Class AMNetSshAuthenticationMethods
SSH authentication method names and helpers for building multi-step authentication policies without raw protocol strings.
Inherited Members
Namespace: ApacheMinaSSHD.NET.Wrapper
Assembly: ApacheMinaSSHD.NET.Wrapper.dll
Syntax
public static class AMNetSshAuthenticationMethods
Remarks
SSH authentication policies use a space-separated list of comma-separated
method chains. Each chain lists methods that must all succeed in order, while
the outer list represents alternatives. For example,
publickey password,keyboard-interactive allows either public key alone
or password followed by keyboard-interactive.
Fields
| Edit this page View SourceKeyboardInteractive
Keyboard-interactive authentication such as one-time codes or custom prompts.
Declaration
public const string KeyboardInteractive = "keyboard-interactive"
Field Value
| Type | Description |
|---|---|
| string |
Password
Username and password authentication.
Declaration
public const string Password = "password"
Field Value
| Type | Description |
|---|---|
| string |
PublicKey
Public key authentication, including authorized_keys-backed flows.
Declaration
public const string PublicKey = "publickey"
Field Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceAllowAny(IEnumerable<string>)
Builds an authentication policy where any one of the supplied chains may succeed.
Declaration
public static string AllowAny(IEnumerable<string> authenticationChains)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<string> | authenticationChains | Authentication chains such as PublicKey or values returned by RequireAll(params string[]). |
Returns
| Type | Description |
|---|---|
| string | A space-separated authentication policy string. |
AllowAny(params string[])
Builds an authentication policy where any one of the supplied chains may succeed.
Declaration
public static string AllowAny(params string[] authenticationChains)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | authenticationChains | Authentication chains such as PublicKey or values returned by RequireAll(params string[]). |
Returns
| Type | Description |
|---|---|
| string | A space-separated authentication policy string. |
Parse(string?)
Parses an authentication policy into alternative chains.
Declaration
public static IReadOnlyList<IReadOnlyList<string>> Parse(string? authenticationPolicy)
Parameters
| Type | Name | Description |
|---|---|---|
| string | authenticationPolicy | The SSH authentication policy string. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<IReadOnlyList<string>> | Authentication chains in evaluation order. |
RequireAll(IEnumerable<string>)
Builds a required authentication chain where every method must succeed in order.
Declaration
public static string RequireAll(IEnumerable<string> authenticationMethods)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<string> | authenticationMethods |
Returns
| Type | Description |
|---|---|
| string | A comma-separated authentication chain. |
RequireAll(params string[])
Builds a required authentication chain where every method must succeed in order.
Declaration
public static string RequireAll(params string[] authenticationMethods)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | authenticationMethods |
Returns
| Type | Description |
|---|---|
| string | A comma-separated authentication chain. |