[Bug] MSAL.PY's error has no indicator for `InteractionRequired`
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- python
- Domínio
- authentication, backend-api-design
Direção de pesquisa
Start by reading the MSAL Python error handling and token acquisition paths referenced by the issue, along with the linked Azure CLI handling and interactive sample. Identify how errors expose interaction requirements with and without WAM. Done means MSAL provides a clear indicator clients can use without parsing error_description.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Describe the bug
Azure CLI relies on AADSTS50076 to detect MFA error (https://github.com/Azure/azure-cli/pull/12516):
if 'AADSTS50076' in msg:
# The tenant requires MFA and can't be accessed with home tenant's refresh token
mfa_tenants.append(t)
and let the user know interaction is required:
# Show warning for MFA tenants
if mfa_tenants:
logger.warning("The following tenants require Multi-Factor Authentication (MFA). "
"Use 'az login --tenant TENANT_ID' to explicitly login to a tenant.")
for t in mfa_tenants:
logger.warning("%s", t.tenant_id_name)
Today I was told by MSAL team that clients shouldn't parse error_description. However, MSAL.PY has no clear indicator that interaction is required, with or without WAM:
With WAM:
{
"error": "broker_error",
"error_description": "SubError: basic_action V2Error: invalid_grant AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access 'xxx'. Trace ID: xxx Correlation ID: xxx Timestamp: 2024-05-15 01:13:49Z. Status: Response_Status.Status_InteractionRequired, Error code: 3399614476, Tag: 557973645",
"msal_telemetry": "..."
}
Without WAM:
{
"error": "invalid_grant",
"error_description": "AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access 'xxx'. Trace ID: xxx Correlation ID: xxx Timestamp: 2024-05-15 01:16:43Z",
"error_codes": [
50076
],
"timestamp": "2024-05-15 01:16:43Z",
"trace_id": "xxx",
"correlation_id": "xxx",
"error_uri": "https://login.microsoftonline.com/error?code=50076",
"suberror": "basic_action",
"classification": "basic_action"
}
This makes Azure CLI have no way of knowing whether the error can be recovered by performing interactive authentication.
The MSAL example unconditionally launches acquire_token_interactive if acquire_token_silent fails to get an access token:
To Reproduce
az login with an account that requires MFA for non-home tenants.
Expected behavior
MSAL.PY's error should have an indicator for InteractionRequired.
What you see instead
MSAL.PY's error has no indicator for InteractionRequired.
The MSAL Python version you are using
1.28.0
Additional context
Add any other context about the problem here.
- Linguagem predominante
- Python
- Estrelas
- 971
- Forks
- 223
- Merge médio
- 13h 48min
- PRs com merge (30d)
- 2
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de AzureAD/microsoft-authentication-library-for-python
-
needs attention untriaged
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
AzureAD/microsoft-authentication-library-for-python#973 · 1 comentário ·
-
AzureSDK bug P1
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
-
http_client docstring does not say that timeout, verify and proxies only configure the default sessionTalvez já em andamento @HardMax71 assumiu há 40 dias. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 25/100
-
[Bug] The built-in retry never retries the token POST: HTTPAdapter(max_retries=1) keeps urllib3's default allowed_methodsTalvez já em andamento @HardMax71 assumiu há 46 dias. Abertabug untriaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 35/100
AzureAD/microsoft-authentication-library-for-python#957 · 3 comentários ·
-
public-client untriaged
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
Todas as issues de AzureAD/microsoft-authentication-library-for-python
Issues semelhantes
-
[Bug]: `hermes plugins update` clones an entire monorepo twice - `subdir` is resolved but dropped at both catalog-update call sitesTalvez já em andamento @HootRock assumiu hoje. Abertacomp/cli P2 type/perf
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
NousResearch/hermes-agent#142417 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
bug enhancement python
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
DewaldOosthuizen/tech-cheat-sheets-and-notes#392 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 1 dia
-
bug p2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
amd/gaia#5471 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Restore postgresql_vm_test_charm actions.yaml change (removed in canonical/postgresql-operator#2054)Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
canonical/postgresql-single-kernel-library#390 · 1 comentário ·
Mantenedores costumam responder em até 2 dias