-
Notifications
You must be signed in to change notification settings - Fork 969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting 500 server error on sending "totp_code" #2680
Comments
Can you please include the log lines? |
Done! |
Thank you for the report, that is helpful! Looks like we forgot to do this kratos/selfservice/strategy/totp/settings.go Lines 263 to 272 in 39bb84d
around here: kratos/selfservice/strategy/totp/settings.go Line 229 in 39bb84d As a workaround you can create a new settings flow after you have disconnected the app. It looks like we do not properly reset the TOTP state in the flow after disconnecting! Fixes (with tests please :) ) highly appreciated! |
I'll see if I can reproduce this and devise a fix. |
@rostyk110 I set up Kratos and the selfservice UI locally and couldn't reproduce the issue. I noticed that whenever I link/unlink TOTP I get a new flow (the Edit: I managed to reproduce it with https://github.com/ory/kratos-selfservice-ui-react-nextjs |
@aeneasr I looked into this more and I think I found the root cause. At the end of every successful settings submission, Kratos regenerates the UI nodes: kratos/selfservice/flow/settings/hook.go Lines 218 to 223 in 0856bd7
InternalContext in their PopulateSettingsMethod (TOTP and WebAuthn do that). However, while the UI nodes are copied into the current flow, InternalContext isn't.
If I add I made some other observations, too, while looking at the code:
How would you like to proceed with this? It seems to me that merging the |
@aeneasr any chance to fix that next week? :( |
@aeneasr Could you comment on my findings? I want to contribute a fix once we agree on the proper solution. It would be nice to get a fix into the next release. |
Sorry, my last comment was a bit quick to write. To be honest, I'm not sure. The code you linked though is using I think the best option we have is to create go and cypress test cases that emulate this behavior and then fix it by working backwards in identifying the bug. |
As an update, I'm currently busy with other tasks. I won't be able to work on this for some time, unfortunately. |
Preflight checklist
Describe the bug
Auth app - Google Authenticator
When I try to add Auth app, I get 500 Server Error. It happens after: connect Auth App (successfully), disconnect (successfully), connect again (getting Error).
Response:
Reproducing the bug
Sorry, recording is 24.2MB, so I compressed it.
Screen Recording 2022-08-22 at 22.09.45.mov.zip
Or here is youtube link:
https://www.youtube.com/watch?v=_37Fns4AkT0
Relevant log output
Relevant configuration
No response
Version
v0.10.1
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
Kubernetes
Additional Context
cURL:
curl 'http://localhost:3006/api/.ory/self-service/settings?flow=6469be6f-c9d8-49f4-826d-949fa43c8bad' \ -H 'Accept: application/json, text/plain, */*' \ -H 'Accept-Language: en-US,en;q=0.9,uk;q=0.8' \ -H 'Cache-Control: no-cache' \ -H 'Connection: keep-alive' \ -H 'Content-Type: application/json' \ -H 'Cookie: csrf_token_dc00b226a17ebfc20ec30276b3639d78899dea58cd5bfa217fda35d=knZgAiXII00Ai3yj/DR7W2ExgN3jrhVIBTKvnsYQ=; ory_session_playground=MTY2MTE5NTMyMnw3MVlXVVJOR0w1YUwwVlFBTXlNaHJfMVZEanVYYXdxRnl4Si1WWmJSTlVKM2otdXFjMXJnSTBpMEhrZS1fcVRrSzVLUGV4M09ORXhJS2Z1YwWmxITjQwZk1ZOUdjdlRoU3FSTDl6UUljWk5hYURyQS1NMkJ5YlZDNWpoTkc4d3pjN21qcEZjV3Z0WEVJZDZ2TWNPWloxbHBNR2xMNllOR0NWcExpMERsYVFQRXo5ek1sQURKWmdfeDRvaWRQcVhLSmsxdGJtcXktTWd1VFJmek5WSTVoYUE9PXx7X1LLIvbtYh5ngb01VhqlNOaqb9SULFuNSvS3XaXzhA==' \ -H 'Origin: http://localhost:3006' \ -H 'Pragma: no-cache' \ -H 'Referer: http://localhost:3006/settings?flow=6469be6f-c9d8-49f4-826d-949fa43c8bad' \ -H 'Sec-Fetch-Dest: empty' \ -H 'Sec-Fetch-Mode: cors' \ -H 'Sec-Fetch-Site: same-origin' \ -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36' \ -H 'sec-ch-ua: "Chromium";v="104", " Not A;Brand";v="99", "Google Chrome";v="104"' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'sec-ch-ua-platform: "macOS"' \ --data-raw '{"csrf_token":"iEUaHOidwsWWzNC7IpImB1yjpMpWuNOpBFGQQaVXhiJZOr5n9uvF4d1cPZIkF7UWxuEBYz/fZn==","totp_code":"650204","method":"totp"}' \ --compressed
The text was updated successfully, but these errors were encountered: