uploadSamlPublicCertificateWithHttpInfo method

Future<Response> uploadSamlPublicCertificateWithHttpInfo(
  1. MultipartFile certificate
)

Upload public certificate

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

Note: This method returns the HTTP Response.

Parameters:

  • MultipartFile certificate (required): The public certificate file

Implementation

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

  // 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,
  );
}