[csharp] [Req#15932] Added support for windows authentication by exposing UseDefaultCredentials property (#15935)

* Added support for windows authentication by exposing UseDefaultCredentials property

* Updated samples and docs

* update doc, samples

---------

Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
Aswin Francis
2023-07-03 13:23:47 +05:30
committed by GitHub
parent 117e5118b1
commit ba0c73e164
31 changed files with 245 additions and 29 deletions

View File

@@ -70,6 +70,8 @@ namespace Org.OpenAPITools.Client
/// </summary>
private string _basePath;
private bool _useDefaultCredentials = false;
/// <summary>
/// Gets or sets the API key based on the authentication name.
/// This is the key and value comprising the "secret" for accessing an API.
@@ -275,11 +277,21 @@ namespace Org.OpenAPITools.Client
/// <summary>
/// Gets or sets the base path for API access.
/// </summary>
public virtual string BasePath {
public virtual string BasePath
{
get { return _basePath; }
set { _basePath = value; }
}
/// <summary>
/// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false.
/// </summary>
public virtual bool UseDefaultCredentials
{
get { return _useDefaultCredentials; }
set { _useDefaultCredentials = value; }
}
/// <summary>
/// Gets or sets the default header.
/// </summary>
@@ -689,6 +701,7 @@ namespace Org.OpenAPITools.Client
TempFolderPath = second.TempFolderPath ?? first.TempFolderPath,
DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat,
ClientCertificates = second.ClientCertificates ?? first.ClientCertificates,
UseDefaultCredentials = second.UseDefaultCredentials
};
return config;
}

View File

@@ -99,6 +99,11 @@ namespace Org.OpenAPITools.Client
/// <value>Password.</value>
string Password { get; }
/// <summary>
/// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false.
/// </summary>
bool UseDefaultCredentials { get; }
/// <summary>
/// Get the servers associated with the operation.
/// </summary>