🔍 Code Extractor

class Authentication_v1

Maturity: 34

Exposes relationships that represent the authentication methods supported by Azure AD and that can configured for users.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/authentication/authentication.py
Lines:
7 - 101
Complexity:
moderate

Purpose

Exposes relationships that represent the authentication methods supported by Azure AD and that can configured for users.

Source Code

class Authentication(Entity):
    """
    Exposes relationships that represent the authentication methods supported by Azure AD and that can configured
    for users.
    """

    @property
    def email_methods(self):
        """The email address registered to a user for authentication."""
        from office365.directory.authentication.methods.email import (
            EmailAuthenticationMethod,
        )

        return self.properties.get(
            "emailMethods",
            EntityCollection(
                self.context,
                EmailAuthenticationMethod,
                ResourcePath("emailMethods", self.resource_path),
            ),
        )

    @property
    def fido2_methods(self):
        """Represents the FIDO2 security keys registered to a user for authentication."""
        from office365.directory.authentication.methods.fido import (
            Fido2AuthenticationMethod,
        )

        return self.properties.get(
            "fido2Methods",
            EntityCollection(
                self.context,
                Fido2AuthenticationMethod,
                ResourcePath("fido2Methods", self.resource_path),
            ),
        )

    @property
    def phone_methods(self):
        """The phone numbers registered to a user for authentication."""
        from office365.directory.authentication.methods.phone import (
            PhoneAuthenticationMethod,
        )

        return self.properties.get(
            "phoneMethods",
            EntityCollection(
                self.context,
                PhoneAuthenticationMethod,
                ResourcePath("phoneMethods", self.resource_path),
            ),
        )

    @property
    def password_methods(self):
        """Represents the password that's registered to a user for authentication. For security, the password itself
        will never be returned in the object, but action can be taken to reset a password.
        """
        from office365.directory.authentication.methods.password import (
            PasswordAuthenticationMethod,
        )

        return self.properties.get(
            "passwordMethods",
            EntityCollection(
                self.context,
                PasswordAuthenticationMethod,
                ResourcePath("passwordMethods", self.resource_path),
            ),
        )

    @property
    def methods(self):
        # type: () -> EntityCollection[AuthenticationMethod]
        """Represents all authentication methods registered to a user."""
        return self.properties.get(
            "methods",
            EntityCollection(
                self.context,
                AuthenticationMethod,
                ResourcePath("methods", self.resource_path),
            ),
        )

    def get_property(self, name, default_value=None):
        if default_value is None:
            property_mapping = {
                "emailMethods": self.email_methods,
                "fido2Methods": self.fido2_methods,
                "passwordMethods": self.password_methods,
                "phoneMethods": self.phone_methods,
            }
            default_value = property_mapping.get(name, None)
        return super(Authentication, self).get_property(name, default_value)

Parameters

Name Type Default Kind
bases Entity -

Parameter Details

bases: Parameter of type Entity

Return Value

Returns unspecified type

Class Interface

Methods

email_methods(self) property

Purpose: The email address registered to a user for authentication.

Returns: None

fido2_methods(self) property

Purpose: Represents the FIDO2 security keys registered to a user for authentication.

Returns: None

phone_methods(self) property

Purpose: The phone numbers registered to a user for authentication.

Returns: None

password_methods(self) property

Purpose: Represents the password that's registered to a user for authentication. For security, the password itself will never be returned in the object, but action can be taken to reset a password.

Returns: See docstring for return details

methods(self) property

Purpose: Represents all authentication methods registered to a user.

Returns: None

get_property(self, name, default_value)

Purpose: Retrieves property

Parameters:

  • name: Parameter
  • default_value: Parameter

Returns: None

Required Imports

from office365.directory.authentication.methods.method import AuthenticationMethod
from office365.entity import Entity
from office365.entity_collection import EntityCollection
from office365.runtime.paths.resource_path import ResourcePath
from office365.directory.authentication.methods.email import EmailAuthenticationMethod

Usage Example

# Example usage:
# result = Authentication(bases)

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class Authentication 66.9% similar

    A class representing authentication methods in SharePoint, inheriting from Entity to expose relationships for authentication.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/oauth/authentication.py
  • class AuthenticationMethod 64.3% similar

    Represents an authentication method registered to a user in Azure Active Directory, providing functionality to manage authentication credentials such as passwords, phone numbers, and FIDO2 security keys.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/authentication/methods/method.py
  • class AuthenticationMethodsRoot 62.6% similar

    A container class for navigating and accessing Azure AD authentication methods resources, providing access to user registration details and authentication method statistics.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/authentication/methods/root.py
  • class TenantRelationship 60.3% similar

    A class representing tenant relationships in Azure AD, providing methods to query and validate tenant information across different Azure AD tenants.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/tenant_relationship.py
  • class AuthenticationMethodsPolicy 59.2% similar

    A class representing Azure Active Directory authentication methods policy that defines which authentication methods users can use for sign-in and multi-factor authentication (MFA).

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