System.Net.ICredentials Interface

public interface ICredentials

Assembly

System

Library

Networking

Summary

Implemented by types that supply network credentials used to authenticate clients.

Description

The ICredentials interface defines the System.Net.ICredentials.GetCredential(System.Uri,System.String) method, which is used to supply network credentials for client authentication.

See Also

System.Net Namespace

Members

ICredentials Methods

ICredentials.GetCredential Method


ICredentials.GetCredential Method

NetworkCredential GetCredential(Uri uri, string authType);

Summary

Returns a NetworkCredential object that is associated with a Uniform Resource Identifier (URI) and authentication type.

Parameters

uri
A Uri representing the URI for which the client is providing authentication.
authType
A String containing the type of authentication. This value is required to be identical to the System.Net.IAuthenticationModule.AuthenticationType of the authentication module that uses the credential returned by this method.

Return Value

A NetworkCredential associated with the specified URI and authentication type, or null if the credentials cannot be provided.

Description

[Behaviors: As described above.]

[Overrides: Implement this method to return credentials information appropriate for the specified authentication type.]

[Usage: This method returns an object suitable for passing to the System.Net.IAuthenticationModule.Authenticate(System.String,System.Net.WebRequest,System.Net.ICredentials) method of the authorization module registered for the specified authentication type. For additional information, see System.Net.AuthenticationManager.Register(System.Net.IAuthenticationModule).]

See Also

System.Net.ICredentials Interface, System.Net Namespace