Skip to content

Add username/password login option on AuthGuard (v0.11.0)#105

Merged
rbardaji merged 6 commits intomainfrom
feature/104-credentials-login
Apr 22, 2026
Merged

Add username/password login option on AuthGuard (v0.11.0)#105
rbardaji merged 6 commits intomainfrom
feature/104-credentials-login

Conversation

@rbardaji
Copy link
Copy Markdown
Collaborator

Summary

  • Add a new POST /user/login endpoint that forwards username/password to the configured identity provider and returns the access token plus profile data
  • Add a toggle link below the "Authenticate" button on the UI login screen so users can switch to a credentials form (username + password, with show/hide toggle) instead of pasting an access token; a reciprocal link returns to the token form
  • Bump version to 0.11.0

Closes #104

Test plan

  • Unit tests for authenticate_with_credentials (happy path, 400/401/403, network error, 5xx, non-JSON body, missing access_token)
  • Route tests for POST /user/login (success, 401, 502, validation errors, public access)
  • Full test suite passes (1033 tests)
  • black --check --diff . passes
  • flake8 api/ tests/ --max-line-length=88 --extend-ignore=E203,W503,E501,F401 passes
  • Manual end-to-end verification on local stack (token form and credentials form both work)

Raul Bardaji added 6 commits April 22, 2026 11:37
Introduce a new POST /user/login endpoint that forwards username and
password to the configured identity provider and returns the access
token together with the user profile data.

The IDP login URL is derived from the existing auth_api_url setting, so
no additional configuration is required. IDP 4xx responses are mapped to
401 Unauthorized and transport/5xx errors to 502 Bad Gateway.

Refs #104
Add a login helper in the UI API service that posts the provided
username and password to the new /user/login endpoint and stores the
returned access token in localStorage so subsequent requests are
authenticated automatically.

Refs #104
Add a toggle below the Authenticate button that lets users switch from
the access token form to a username/password form. Submitting the
credentials form calls authAPI.login, stores the returned access token
and unlocks the app. A reciprocal link returns to the token form.

Closes #104
Cover the happy path, invalid credentials (401), IDP outages (502),
unexpected IDP status codes, malformed IDP responses and request
validation for both the authenticate_with_credentials service and the
POST /user/login route.

Refs #104
@rbardaji rbardaji merged commit 3d757e6 into main Apr 22, 2026
1 check passed
@rbardaji rbardaji deleted the feature/104-credentials-login branch April 22, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add username/password login option to AuthGuard screen

1 participant