class ClientCertificateAuthentication
A class representing Pkcs12-based client certificate authentication configuration, derived from ApiAuthenticationConfigurationBase, used to manage and retrieve public properties of uploaded certificates.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/authentication/client_certificate.py
10 - 24
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
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class ApiAuthenticationConfigurationBase 78.0% similar
-
class Pkcs12CertificateInformation 67.7% similar
-
class SelfSignedCertificate 63.9% similar
-
class CertificateBasedAuthConfiguration 63.4% similar
-
class CertificateAuthority 63.3% similar