IAuthenticationModule.PreAuthenticate(WebRequest, ICredentials) Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Returnerar en instans av Authorization klassen för en autentiseringsbegäran till en server.
public:
System::Net::Authorization ^ PreAuthenticate(System::Net::WebRequest ^ request, System::Net::ICredentials ^ credentials);
public System.Net.Authorization PreAuthenticate(System.Net.WebRequest request, System.Net.ICredentials credentials);
abstract member PreAuthenticate : System.Net.WebRequest * System.Net.ICredentials -> System.Net.Authorization
Public Function PreAuthenticate (request As WebRequest, credentials As ICredentials) As Authorization
Parametrar
- request
- WebRequest
Den WebRequest instans som är associerad med autentiseringsbegäran.
- credentials
- ICredentials
Autentiseringsuppgifterna som är associerade med autentiseringsbegäran.
Returer
En Authorization instans som innehåller auktoriseringsmeddelandet för begäran.
Exempel
I följande exempel visas hur du PreAuthenticate använder metoden. Ett fullständigt exempel finns i AuthenticationManager klassen .
// The PreAuthenticate method specifies whether the authentication implemented
// by this class allows pre-authentication.
// Even if you do not use it, this method must be implemented to obey to the rules
// of interface implementation.
// In this case it always returns null.
public Authorization PreAuthenticate(WebRequest request, ICredentials credentials)
{
return null;
}
' The PreAuthenticate method specifies whether the authentication implemented
' by this class allows pre-authentication.
' Even if you do not use it, this method must be implemented to obey to the rules
' of interface implementation.
' In this case it always returns null.
Public Function PreAuthenticate(ByVal request As WebRequest, ByVal credentials As ICredentials) As Authorization _
Implements IAuthenticationModule.PreAuthenticate
Return Nothing
End Function 'PreAuthenticate
Kommentarer
När egenskapen CanPreAuthenticate är truePreAuthenticate returnerar metoden en instans av Authorization klassen som innehåller ett autentiseringsmeddelande.