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

Make X-RUCIO-ACCOUNT header optional in auth server #5833

Closed
maany opened this issue Aug 24, 2022 · 0 comments · Fixed by #5857
Closed

Make X-RUCIO-ACCOUNT header optional in auth server #5833

maany opened this issue Aug 24, 2022 · 0 comments · Fixed by #5857

Comments

@maany
Copy link
Member

maany commented Aug 24, 2022

Motivation

In the rucio server, /auth/userpass endpoint has a hard requirement for the account header.

if not account or not username or not password:
return generate_http_error_flask(401, CannotAuthenticate.__name__, 'Cannot authenticate without passing all required arguments', headers=headers)

This complicates the login workflow for the new webui. The login page asks the user for the identity i.e. username' and password` but if the user does not specify the account, the login will fail.

In order to make the account field optional, this endpoint must be modified

Modification

  • if the header is present, use that account
  • if the header is not present, list the accounts associated with the identity.
    • if 0 accounts are found, raise appropriate error
    • if a single account is found, use that
    • if multiple accounts are found
      • if default account is specified, use that
      • otherwise, return a list of accounts that the UI can render and ask the person to pick one explicitly

This must be done in a way that other endpoints can re-use the logic

@maany maany self-assigned this Aug 24, 2022
maany added a commit to maany/rucio that referenced this issue Aug 25, 2022
maany added a commit to maany/rucio that referenced this issue Aug 25, 2022
maany added a commit to maany/rucio that referenced this issue Sep 2, 2022
maany added a commit to maany/rucio that referenced this issue Sep 5, 2022
maany added a commit to maany/rucio that referenced this issue Sep 5, 2022
maany added a commit to maany/rucio that referenced this issue Sep 5, 2022
maany added a commit to maany/rucio that referenced this issue Sep 5, 2022
maany added a commit to maany/rucio that referenced this issue Sep 5, 2022
maany added a commit to maany/rucio that referenced this issue Sep 19, 2022
maany added a commit to maany/rucio that referenced this issue Oct 3, 2022
maany added a commit to maany/rucio that referenced this issue Oct 3, 2022
@bari12 bari12 added this to the 1.29.6 milestone Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment