class PasswordResetResponse
A data class that encapsulates the new system-generated password returned after a password reset operation in Azure AD.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/authentication/password_reset_response.py
4 - 13
simple
Purpose
This class serves as a value object (inheriting from ClientValue) to represent the response from an Azure AD password reset operation. It stores the newly generated password that the system creates when a user's password is reset. This class is typically used in the Office365 SDK to handle password reset responses in a structured way, providing type safety and clear data encapsulation for password reset operations.
Source Code
class PasswordResetResponse(ClientValue):
"""
Represents the new system-generated password after a password reset operation.
"""
def __init__(self, new_password=None):
"""
:param str new_password: The Azure AD-generated password.
"""
self.newPassword = new_password
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
new_password: The Azure AD-generated password string. This is the new password that has been automatically created by the Azure AD system during a password reset operation. Can be None if not yet set or if the operation failed. Expected to be a string value when populated.
Return Value
Instantiation returns a PasswordResetResponse object containing the new password. The object itself doesn't have methods that return values, but provides access to the newPassword attribute which contains the system-generated password string or None.
Class Interface
Methods
__init__(self, new_password=None) -> None
Purpose: Initializes a new PasswordResetResponse instance with an optional new password value
Parameters:
new_password: Optional string containing the Azure AD-generated password. Defaults to None if not provided.
Returns: None - this is a constructor that initializes the instance
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
newPassword |
str or None | Stores the Azure AD-generated password string after a password reset operation. Will be None if no password was provided during initialization or if the reset operation has not completed successfully. | instance |
Dependencies
office365
Required Imports
from office365.runtime.client_value import ClientValue
Usage Example
from office365.runtime.client_value import ClientValue
class PasswordResetResponse(ClientValue):
def __init__(self, new_password=None):
self.newPassword = new_password
# Create an instance with a new password
reset_response = PasswordResetResponse(new_password="TempPass123!")
print(f"New password: {reset_response.newPassword}")
# Create an instance without a password (default)
empty_response = PasswordResetResponse()
print(f"Password set: {empty_response.newPassword is not None}")
# Typically used in Azure AD operations:
# response = user.reset_password()
# new_password = response.newPassword
Best Practices
- This is a simple data container class with no business logic, making it easy to instantiate and use
- The class follows the value object pattern, inheriting from ClientValue which likely provides serialization capabilities
- Store the new password securely and transmit it to the user through secure channels only
- The newPassword attribute should be treated as sensitive data and not logged or exposed unnecessarily
- This class is typically instantiated by the Office365 SDK internally rather than manually by developers
- No state management or side effects - this is a pure data container
- The class uses camelCase for the attribute name (newPassword) which is consistent with Office365 API conventions
- No validation is performed on the password parameter, so ensure valid data is passed during instantiation
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class PasswordCredential 64.6% similar
-
class PasswordProfile 61.6% similar
-
class PasswordAuthenticationMethod 61.3% similar
-
class AuthenticationMethod 59.8% similar
-
class RiskUserActivity 57.4% similar