🔍 Code Extractor

class ClientCertificateAuthentication

Maturity: 48

A class representing Pkcs12-based client certificate authentication configuration, derived from ApiAuthenticationConfigurationBase, used to manage and retrieve public properties of uploaded certificates.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/authentication/client_certificate.py
Lines:
10 - 24
Complexity:
simple

Purpose

This class serves as a specialized authentication configuration container for client certificate-based authentication using Pkcs12 certificates. It extends the base API authentication configuration to specifically handle certificate collections, allowing applications to store and manage multiple Pkcs12 certificates for authentication purposes. This is typically used in scenarios where client certificate authentication is required for API access, such as in Microsoft 365/Office 365 integrations.

Source Code

class ClientCertificateAuthentication(ApiAuthenticationConfigurationBase):
    """
    A type derived from apiAuthenticationConfigurationBase that is used to represent
    a Pkcs12-based client certificate authentication.
    This is used to retrieve the public properties of uploaded certificates.
    """

    def __init__(self, certificates=None):
        """
        :param list[Pkcs12CertificateInformation] certificates:
        """
        super(ClientCertificateAuthentication, self).__init__()
        self.certificateList = ClientValueCollection(
            Pkcs12CertificateInformation, certificates
        )

Parameters

Name Type Default Kind
bases ApiAuthenticationConfigurationBase -

Parameter Details

certificates: Optional list of Pkcs12CertificateInformation objects representing the client certificates to be used for authentication. Can be None to initialize an empty certificate collection. Each certificate in the list should contain the public properties of an uploaded Pkcs12 certificate.

Return Value

Instantiation returns a ClientCertificateAuthentication object with an initialized certificateList attribute containing the provided certificates (or an empty collection if none provided). The object inherits all methods and properties from ApiAuthenticationConfigurationBase.

Class Interface

Methods

__init__(self, certificates=None)

Purpose: Initializes a new ClientCertificateAuthentication instance with an optional list of Pkcs12 certificates

Parameters:

  • certificates: Optional list of Pkcs12CertificateInformation objects to initialize the certificate collection

Returns: None (constructor)

Attributes

Name Type Description Scope
certificateList ClientValueCollection[Pkcs12CertificateInformation] A collection of Pkcs12CertificateInformation objects representing the client certificates used for authentication. This is a specialized collection type that manages certificate objects. instance

Dependencies

  • office365

Required Imports

from office365.directory.authentication.client_certificate import ClientCertificateAuthentication
from office365.directory.certificates.pkcs12_information import Pkcs12CertificateInformation

Usage Example

from office365.directory.authentication.client_certificate import ClientCertificateAuthentication
from office365.directory.certificates.pkcs12_information import Pkcs12CertificateInformation

# Create certificate information objects
cert1 = Pkcs12CertificateInformation()
cert2 = Pkcs12CertificateInformation()

# Initialize with certificates
auth_config = ClientCertificateAuthentication(certificates=[cert1, cert2])

# Or initialize empty and add certificates later
auth_config = ClientCertificateAuthentication()
# Access the certificate list
cert_list = auth_config.certificateList

Best Practices

  • Always ensure certificates passed to the constructor are valid Pkcs12CertificateInformation objects
  • The certificateList attribute is a ClientValueCollection, which provides collection-specific operations for managing certificates
  • This class inherits from ApiAuthenticationConfigurationBase, so be aware of inherited methods and properties
  • Use this class when implementing client certificate authentication for Office 365/Microsoft Graph API integrations
  • Certificates should be properly uploaded and registered in the directory before being referenced in this configuration
  • The class is designed to work within the Office 365 SDK ecosystem and should be used in conjunction with other Office 365 authentication components

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class ApiAuthenticationConfigurationBase 78.0% similar

    Base class for holding authentication configuration information when calling APIs, serving as a parent class for various authentication types.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/authentication/configuration_base.py
  • class Pkcs12CertificateInformation 67.7% similar

    A data class that represents the public information of a PKCS#12 certificate, including thumbprint, active status, and validity period.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/certificates/pkcs12_information.py
  • class SelfSignedCertificate 63.9% similar

    A data class representing the public part of a self-signed certificate, inheriting from ClientValue for use in Office 365 API operations.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/certificates/self_signed.py
  • class CertificateBasedAuthConfiguration 63.4% similar

    Represents Azure Active Directory certificate-based authentication configuration for Exchange Online accounts, managing trusted certificate authorities for client certificate authentication.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/certificates/auth_configuration.py
  • class CertificateAuthority 63.3% similar

    A data class representing a certificate authority with its associated properties such as certificate, revocation list URL, and issuer information.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/certificates/authority.py
← Back to Browse