Method GenerateCredentialAsync
GenerateCredentialAsync(Uri, String, String, GenerateTokenOptions)
Generates a token credential object asynchronously. You need to provide the service URI, the username and the password. This is a helper method typically called by the UI challenging the user.
Declaration
[Obsolete("Use AccessTokenCredential.CreateAsync to create token credentials with username and password.")]
public Task<TokenCredential> GenerateCredentialAsync(Uri serviceUri, string userName, string password, GenerateTokenOptions generateTokenOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service Uri. |
| System.String | userName | The user name. |
| System.String | password | The password. |
| GenerateTokenOptions | generateTokenOptions | The optional infos concerning the token to generate (referer, credentials). |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<TokenCredential> | The task object representing the asynchronous generate credential operation. The value of the task result is a TokenCredential object. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | serviceUri |
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.2 - 200.8 |
| .NET iOS | 200.0 - 200.8 |
| .NET Framework | 100.0 - 200.8 |
| Xamarin.Android | 100.0 - 100.14 |
| Xamarin.iOS | 100.0 - 100.15 |
| UWP | 100.0 - 200.8 |
GenerateCredentialAsync(Uri, GenerateTokenOptions)
Generates a token credential object asynchronously. You need to provide the service URL. This is a helper method typically called by the UI challenging the user.
Declaration
[Obsolete("Use AccessTokenCredential.CreateNetworkSecuredAsync to create network-secured or federated token credentials.")]
public Task<TokenCredential> GenerateCredentialAsync(Uri serviceUri, GenerateTokenOptions generateTokenOptions = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The URL. |
| GenerateTokenOptions | generateTokenOptions | The optional infos concerning the token to generate (referer, credentials). |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<TokenCredential> | The task object representing the asynchronous generate credential operation. The value of the task result is a TokenCredential object. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | serviceUri |
See Also
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.2 - 200.8 |
| .NET iOS | 200.0 - 200.8 |
| .NET Framework | 100.0 - 200.8 |
| Xamarin.Android | 100.0 - 100.14 |
| Xamarin.iOS | 100.0 - 100.15 |
| UWP | 100.0 - 200.8 |