🔍 Code Extractor

class IdentityProvider

Maturity: 53

Represents an Azure Active Directory (Azure AD) identity provider entity with client credentials for OAuth authentication.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/identities/provider.py
Lines:
6 - 29
Complexity:
simple

Purpose

This class models an identity provider configuration in Azure AD, encapsulating the client ID and client secret credentials needed for OAuth-based authentication with various identity providers including Microsoft, Google, Facebook, Amazon, LinkedIn, Twitter, and preview providers like Weibo, QQ, WeChat, GitHub, and OpenID Connect-supported providers. It inherits from Entity and provides read-only property access to the provider's credentials stored in the underlying properties dictionary.

Source Code

class IdentityProvider(Entity):
    """
    Represents an Azure Active Directory (Azure AD) identity provider.
    The identity provider can be Microsoft, Google, Facebook, Amazon, LinkedIn, or Twitter.
    The following Identity Providers are in Preview: Weibo, QQ, WeChat, GitHub and any OpenID Connect
    supported providers.
    """

    @property
    def client_id(self):
        # type: () -> Optional[str]
        """
        The client ID for the application. This is the client ID obtained when registering the application
        with the identity provider."""
        return self.properties.get("clientId", None)

    @property
    def client_secret(self):
        # type: () -> Optional[str]
        """
        The client secret for the application. This is the client secret obtained when registering the application
        with the identity provider. This is write-only. A read operation will return ****
        """
        return self.properties.get("clientSecret", None)

Parameters

Name Type Default Kind
bases Entity -

Parameter Details

bases: Inherits from Entity class which provides the base functionality for Azure AD entities, including the properties dictionary that stores the identity provider's data

Return Value

Instantiation returns an IdentityProvider object that provides property-based access to client credentials. The client_id property returns the OAuth client ID string or None if not set. The client_secret property returns the client secret string or '****' for read operations (write-only field) or None if not set.

Class Interface

Methods

@property client_id(self) -> Optional[str] property

Purpose: Retrieves the OAuth client ID for the identity provider application

Returns: The client ID string obtained when registering the application with the identity provider, or None if not set

@property client_secret(self) -> Optional[str] property

Purpose: Retrieves the OAuth client secret for the identity provider application (write-only field)

Returns: The client secret string (returns '****' on read operations for security) or None if not set

Attributes

Name Type Description Scope
properties dict Inherited from Entity base class; stores the identity provider's data including clientId and clientSecret instance

Dependencies

  • typing
  • office365.entity

Required Imports

from typing import Optional
from office365.entity import Entity

Usage Example

# Assuming you have an authenticated context to Azure AD
# and have retrieved an IdentityProvider instance

# Typically retrieved from Azure AD API, not directly instantiated
identity_provider = context.identity_providers.get_by_id('provider_id')

# Access client ID
client_id = identity_provider.client_id
if client_id:
    print(f"Client ID: {client_id}")

# Access client secret (returns **** on read for security)
client_secret = identity_provider.client_secret
if client_secret:
    print(f"Client Secret: {client_secret}")  # Will show ****

# Note: This class is typically used as part of the office365 SDK
# for managing Azure AD identity provider configurations

Best Practices

  • This class is typically not instantiated directly but retrieved through Azure AD API calls using the office365 SDK
  • The client_secret property is write-only; read operations return '****' for security reasons
  • Both properties return None if the corresponding data is not present in the underlying properties dictionary
  • This class inherits from Entity, so it has access to all Entity base class methods and the properties dictionary
  • When working with identity providers, ensure proper Azure AD permissions are configured
  • Client credentials should be securely stored and managed according to OAuth best practices
  • The class supports multiple identity provider types (Microsoft, Google, Facebook, Amazon, LinkedIn, Twitter, Weibo, QQ, WeChat, GitHub, and OpenID Connect providers)
  • Preview providers (Weibo, QQ, WeChat, GitHub, OpenID Connect) may have limited support or different configuration requirements

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class SocialIdentityProvider 82.5% similar

    A class representing social identity providers for Azure Active Directory (Azure AD) and Azure AD B2C tenants, providing access to OAuth client credentials and provider type information.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/identities/providers/social_identity.py
  • class IdentityProviderBase 75.6% similar

    Represents identity providers with External Identities for both Azure Active Directory tenant and Azure AD B2C tenant, providing access to identity provider properties.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/identities/providers/base.py
  • class BuiltInIdentityProvider 71.5% similar

    A class representing built-in identity providers with External Identities for an Azure Active Directory tenant, specifically for B2B scenarios.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/identities/providers/builtin_identity.py
  • class IdentityProviderBaseCollection 67.5% similar

    A collection class for managing IdentityProviderBase entities in Microsoft Graph API, providing methods to query and retrieve identity provider information.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/identities/providers/base_collection.py
  • class IdentityProviderCollection 65.9% similar

    A collection class for managing Identity Provider entities in Microsoft Graph API, providing access to identity provider operations and queries.

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