Authentication timeout in a flow that uses `max_age` parameter has a 'send another authorisation code' button that doesn't allow login
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- python
- Domínio
- authentication
Direção de pesquisa
Start by reading ConfidentialClientApplication.initiate_auth_code_flow and tracing how max_age and auth_time are checked across the password and MFA steps. Reproduce the reported delay between password entry and MFA, then compare the behavior with a fresh attempt after cancellation. Done means the timeout flow allows a valid MFA retry or requests password and MFA again without raising the reported error.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Describe the bug
The optional max_age parameter in the ConfidentialClientApplication. initiate_auth_code_flow is compared against the time the user entered their password instead of the full authentication with the MFA, which leads to odd behaviours for authentication timeout. A user that takes to long to enter the MFA sees a 'this has timed-out, send another authorization code' but entering the MFA again will not work because the time will be past the max_age, so an error will be raised instead.
To Reproduce
Steps to reproduce the behavior:
- Initiate a auth code flow with the
max_ageparameter set to 60 seconds (for example) - I enter my password, but don't enter my MFA devices for a couple of minutes
- I see that too much time has passed and a button saying 'send another authorisation code'
- I press on that 'send another authorization code' button
Expected behavior
I would expect one of two behaviors:
- I re-enter my MFA code and I can login
- I am asked to re-enter my password and MFA and I can login
What you see instead
I re-enter my MFA code and a python error is raised:
RuntimeError( RuntimeError: 13. auth_time (1642085298) was requested, by using max_age (60) parameter, and now (1642085502) too much time has elasped since last end-user authentication.
The MSAL Python version you are using
1.16.0
Additional context
If a user takes too long to enter their password everything works fine since the max_age is evaluated since the password was entered. This is only an issue if the user takes to long to add their MFA code.
This flow is also fine if after I enter my password and take too long to enter my MFA code, I click on 'cancel' and then try again, and it will ask for my password + MFA again.
- 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
-
documentation
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
Mantenedores costumam responder em até 1 dia
-
good first issue module-baseline needs triage ux
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
darnitdevorg/darnit#650 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
nyjc-computing/campus#938 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
nf-osi/nf-metadata-dictionary#1027 ·
Mantenedores costumam responder em até 1 dia
-
bug documentation
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
qatrackplus/qatrackplus#913 ·
Mantenedores costumam responder em até 3 dias