AuthorizedAccess Class
Namespace: System.Net.Security
Assembly: System.dll
Assembly: System.dll
Summary
Represents the authorization information for accessing network resources. This class is used to encapsulate the credentials and security context required for network authentication.
Syntax
C#
public sealed class AuthorizedAccess
{
// Constructors
public AuthorizedAccess(ICredentials credentials);
public AuthorizedAccess(ICredentials credentials, string targetName);
public AuthorizedAccess(ICredentials credentials, string targetName, string clientName);
// Properties
public ICredentials Credentials { get; }
public string ClientName { get; }
public string TargetName { get; }
// Methods
public static AuthorizedAccess CreateDefault(string targetName);
}
Remarks
The AuthorizedAccess class is a fundamental component in managing network resource access within the .NET Framework. It provides a structured way to store and pass the necessary authentication information, such as user credentials and the target service name.
When you need to establish a secure connection or perform authenticated operations with a network resource (like a web server or an FTP server), you often need to provide credentials. The AuthorizedAccess class helps centralize this information.
The static method CreateDefault is a convenient way to obtain an AuthorizedAccess object with default credentials for a specified target.
Constructors
| Constructor | Description |
|---|---|
| AuthorizedAccess(ICredentials credentials) | Initializes a new instance of the AuthorizedAccess class with the specified credentials. |
| AuthorizedAccess(ICredentials credentials, string targetName) | Initializes a new instance of the AuthorizedAccess class with the specified credentials and target name. |
| AuthorizedAccess(ICredentials credentials, string targetName, string clientName) | Initializes a new instance of the AuthorizedAccess class with the specified credentials, target name, and client name. |
Properties
| Property | Type | Description |
|---|---|---|
| Credentials | System.Net.ICredentials |
Gets the credentials used for network access. |
| ClientName | System.String |
Gets the name of the client initiating the connection. |
| TargetName | System.String |
Gets the name of the target resource. |
Methods
| Method | Description |
|---|---|
| CreateDefault(string targetName) | Creates an AuthorizedAccess object using default credentials for the specified target. |