class Authentication_v1
Exposes relationships that represent the authentication methods supported by Azure AD and that can configured for users.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/authentication/authentication.py
7 - 101
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: Parameterdefault_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)
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class Authentication 66.9% similar
-
class AuthenticationMethod 64.3% similar
-
class AuthenticationMethodsRoot 62.6% similar
-
class TenantRelationship 60.3% similar
-
class AuthenticationMethodsPolicy 59.2% similar