Method GetCredentialAsync
GetCredentialAsync(CredentialRequestInfo, Boolean)
Obtains a Credential of the specified AuthenticationType that can be used to access the secured resource identified by the ServiceUri. If required, the ChallengeHandler will be called to prompt for credentials. In case of Token, the user is typically challenged for a username and password which are used to generate a token. This method is called internally when a network request fails with an authentication error.
Declaration
public Task<Credential> GetCredentialAsync(CredentialRequestInfo credentialRequestInfo, bool retry)
Parameters
| Type | Name | Description |
|---|---|---|
| CredentialRequestInfo | credentialRequestInfo | The information about the credential to get. |
| System.Boolean | retry | Indicates whether this method is being called after the first attempt to authenticate failed.
This parameter affects behavior when a credential of matching AuthenticationType already exists for the given URL.
When |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Credential> | A task object representing the asynchronous get credential operation. The value of the task result is a Credential object.
The result will be |
Applies to
Platforms and versions
| Target | Versions |
|---|---|
| .NET Standard 2.0 | 100.3 - 200.8 |
| .NET | 100.13 - 200.8 |
| .NET Windows | 100.13 - 200.8 |
| .NET Android | 200.0 - 200.8 |
| .NET iOS | 200.0 - 200.8 |
| .NET Framework | 100.0 - 200.8 |
| Xamarin.Android | 100.0 - 100.15 |
| Xamarin.iOS | 100.0 - 100.15 |
| UWP | 100.0 - 200.8 |