Bandwidth.Standard/Authentication/VoiceBasicAuthManager.cs
/// <summary>
/// Adds authentication to the given HttpRequest
/// </summary>
/// <param name="httpRequest">Http Request</param>
/// <return>Returns the httpRequest after adding authentication</return>
Adds authentication to the given HttpRequest
Adds authentication to the given HttpRequest
public Task<HttpRequest> ApplyAsync(HttpRequest httpRequest)
        {
            string authCredentials = BasicAuthUserName + ":" + BasicAuthPassword;
            byte[] data = Encoding.ASCII.GetBytes(authCredentials);
            httpRequest.Headers["Authorization"] = "Basic " + Convert.ToBase64String(data);
            return Task.FromResult(httpRequest);
        }
public Task < HttpRequest > ApplyAsync ( HttpRequest httpRequest ) { string authCredentials = BasicAuthUserName + " " + BasicAuthPassword ; byte [ ] data = Encoding . ASCII . GetBytes ( authCredentials ) ; httpRequest . Headers [ " " ] = " " + Convert . ToBase64String ( data ) ; return Task . FromResult ( httpRequest ) ; }
Adds authentication to the given HttpRequest
Adds authentication to the given HttpRequest
Returns the httpRequest after adding authentication
Returns the httpRequest after adding authentication
httpRequest
HttpRequest
None