Add username/password login option on AuthGuard (v0.11.0)#105
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /user/loginendpoint that forwardsusername/passwordto the configured identity provider and returns the access token plus profile dataCloses #104
Test plan
authenticate_with_credentials(happy path, 400/401/403, network error, 5xx, non-JSON body, missing access_token)POST /user/login(success, 401, 502, validation errors, public access)black --check --diff .passesflake8 api/ tests/ --max-line-length=88 --extend-ignore=E203,W503,E501,F401passes