Fix format of ClientCertificate[Key]Data from auth plugins (#480)
* Fix format of ClientCertificate[Key]Data from auth plugins * Add external certificate tests to AuthTests * format
This commit is contained in:
@@ -391,8 +391,11 @@ namespace k8s
|
||||
|
||||
var (accessToken, clientCertificateData, clientCertificateKeyData) = ExecuteExternalCommand(userDetails.UserCredentials.ExternalExecution);
|
||||
AccessToken = accessToken;
|
||||
ClientCertificateData = clientCertificateData;
|
||||
ClientCertificateKeyData = clientCertificateKeyData;
|
||||
// When reading ClientCertificateData from a config file it will be base64 encoded, and code later in the system (see CertUtils.GeneratePfx)
|
||||
// expects ClientCertificateData and ClientCertificateKeyData to be base64 encoded because of this. However the string returned by external
|
||||
// auth providers is the raw certificate and key PEM text, so we need to take that and base64 encoded it here so it can be decoded later.
|
||||
ClientCertificateData = clientCertificateData == null ? null : Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(clientCertificateData));
|
||||
ClientCertificateKeyData = clientCertificateKeyData == null ? null : Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(clientCertificateKeyData));
|
||||
|
||||
userCredentialsFound = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user