uploadSamlPrivateCertificateWithHttpInfo method

Future<Response> uploadSamlPrivateCertificateWithHttpInfo(
  1. MultipartFile certificate
)

Upload private key

Upload the private key to be used for encryption with your SAML configuration. The server will pick a hard-coded filename for the PrivateKeyFile setting in your config.json. ##### Permissions Must have sysconsole_write_authentication permission.

Note: This method returns the HTTP Response.

Parameters:

  • MultipartFile certificate (required): The private key file

Implementation

Future<Response> uploadSamlPrivateCertificateWithHttpInfo(
  MultipartFile certificate,
) async {
  // ignore: prefer_const_declarations
  final path = r'/saml/certificate/private';

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <MmQueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>['multipart/form-data'];

  bool hasFields = false;
  final mp = MultipartRequest('POST', Uri.parse(path));
  if (certificate != null) {
    hasFields = true;
    mp.fields[r'certificate'] = certificate.field;
    mp.files.add(certificate);
  }
  if (hasFields) {
    postBody = mp;
  }

  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}