# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ from typing import TYPE_CHECKING from azure.core.exceptions import ClientAuthenticationError if TYPE_CHECKING: from typing import Any, Optional, Sequence [docs]class CredentialUnavailableError(ClientAuthenticationError): """The credential did not attempt to authenticate because required data or state is unavailable.""" [docs]class AuthenticationRequiredError(CredentialUnavailableError): """Interactive authentication is required to acquire a token.""" def __init__(self, scopes, message=None, error_details=None, **kwargs): # type: (Sequence[str], Optional[str], Optional[str], **Any) -> None self._scopes = scopes self._error_details = error_details if not message: message = "Interactive authentication is required to get a token. Call 'authenticate' to begin." super(AuthenticationRequiredError, self).__init__(message=message, **kwargs) @property def scopes(self): # type: () -> Sequence[str] """Scopes requested during the failed authentication""" return self._scopes @property def error_details(self): # type: () -> Optional[str] """Additional authentication error details from Azure Active Directory""" return self._error_details
ncG1vNJzZmiZqqq%2Fpr%2FDpJuom6Njr627wWeaqKqVY8SqusOorqxmnprBcHDWnploqKmptbC6jpqxrqqVYralsc2toK2xX2Z7dXqPm2pol52ksba4xKxmmrKlp7JwtcOepa2hpK58oLHXnJyprJmku7R6x62kpQ%3D%3D