Authentication timeout in a flow that uses `max_age` parameter has a 'send another authorisation code' button that doesn't allow login
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- authentication
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 971
- Fork
- 223
- Merge medio
- 13h 48m
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di AzureAD/microsoft-authentication-library-for-python
-
needs attention untriaged
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
AzureSDK bug P1
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
http_client docstring does not say that timeout, verify and proxies only configure the default sessionForse già presa @HardMax71 l’ha presa 39 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 25/100
-
[Bug] The built-in retry never retries the token POST: HTTPAdapter(max_retries=1) keeps urllib3's default allowed_methodsForse già presa @HardMax71 l’ha presa 46 giorni fa. Apertabug untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
AzureAD/microsoft-authentication-library-for-python#957 · 3 commenti ·
-
public-client untriaged
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Tutte le issue di AzureAD/microsoft-authentication-library-for-python
Issue simili
-
bug documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
awslabs/visual-asset-management-system#514 ·
I maintainer di solito rispondono entro 1 giorno
-
backend bug spec:REQ-053
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
nolte/kamerplanter#2547 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
EleutherAI/lm-evaluation-harness#4425 ·
I maintainer di solito rispondono entro 1 giorno
-
Gemini: respect PLANNING_DISABLED=1 in lifecycle context hooksForse già presa @AmariAugustin l’ha presa oggi. Apertabug good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 87/100
OthmanAdi/planning-with-files#329 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
wr.dynamodb.read_items returns [{}] for a single partition value that does not existForse già presa @auraseb l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
aws/aws-sdk-pandas#3520 ·
I maintainer di solito rispondono entro 2 giorni