Skip to content

Commit

Permalink
adding auth string encoding for application gets
Browse files Browse the repository at this point in the history
  • Loading branch information
slorello89 committed Nov 11, 2019
1 parent f5683be commit ac3be56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Nexmo.Api/Request/VersionedApiRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ private static string DoRequest(Uri uri, AuthType authType, Credentials creds =
}
else if(authType == AuthType.Basic)
{
req.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", $"{apiKey}:{apiSecret}");
var authBytes = Encoding.UTF8.GetBytes(apiKey + ":" + apiSecret);
req.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic",
Convert.ToBase64String(authBytes));
}


Expand Down

0 comments on commit ac3be56

Please sign in to comment.