Skip to content
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

User-Interactive Authentication: What to respond when a client attempts to complete an already-completed stage? #1987

Closed
joepie91 opened this issue May 5, 2019 · 3 comments · Fixed by #2054
Assignees
Labels
clarification An area where the spec could do with being more explicit client-server Client-Server API

Comments

@joepie91
Copy link

joepie91 commented May 5, 2019

In the User-Interactive Authentication part of the specification, it states that the response contains an array of completed stages, as well as how to handle authentication stage attempts.

However, it does not specify what the correct behaviour would be if the client attempts to authenticate to a stage that has already been completed. Should it:

  1. Silently ignore the attempt, and return the same response as before, with the 'completed stages' unchanged?
  2. Reattempt authentication of that stage as if it was never in the 'completed stages' list to begin with?
  3. Return a 401 (incorrect authentication details) response?
  4. Return a 400 or 422 (bad/invalid request) response?
  5. Something else?

In particular considering the potential need for supporting retransmission of authentication attempts when the connection is shaky, I suspect that it should be option 1 or 2, but I'm not sure.

@turt2live turt2live added clarification An area where the spec could do with being more explicit client-server Client-Server API labels May 14, 2019
@turt2live turt2live added this to Nice to have clarifications in Matrix 1.0 workflow May 25, 2019
@turt2live
Copy link
Member

Although Synapse doesn't care, the language of the spec implies that completed stages cannot be retried. For re-transmission: the client could submit the stage again, and the server return an authentication error.

@turt2live turt2live self-assigned this May 30, 2019
@turt2live turt2live moved this from Clarifications TODO to In progress in Matrix 1.0 workflow May 30, 2019
turt2live added a commit that referenced this issue May 30, 2019
Fixes #1987

Note: Synapse currently does not care, however the spirit of the text in the spec implies that completed == done forever, so we're just reinforcing it here.
turt2live added a commit that referenced this issue May 30, 2019
Fixes #1987

Note: Synapse currently does not care, however the spirit of the text in the spec implies that completed == done forever, so we're just reinforcing it here.
@uhoreg
Copy link
Member

uhoreg commented May 30, 2019

Would it not be better to allow clients to re-submit the last stage, in the case e.g. where a proxy eats the server's response to the client and the client doesn't know if the last stage succeeded?

@turt2live
Copy link
Member

The server would process it as "hey, you already did that: see? [completed_flows]" rather than try and re-validate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification An area where the spec could do with being more explicit client-server Client-Server API
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants