FLPATH-4479: Add authentication user guide - #22
Conversation
User-facing auth setup, login, tokens, and troubleshooting aligned with the control-plane Keycloak/OIDC behavior. Assisted-By: Claude (Anthropic) Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Code Review by Qodo
1.
|
PR Summary by QodoDocument authentication workflows for CLI, API, and UI
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="content/docs/getting-started/authentication.md" line_range="110-131" />
<code_context>
+Example for the reference Keycloak realm (issuer must match OIDC discovery):
+
+```bash
+export DCM_ISSUER_URL=http://keycloak:8080/realms/dcm
+dcm login --control-plane-url http://localhost:8080
+dcm sp provider list
+```
+
+`dcm login` saves `issuer-url` in `~/.dcm/config.yaml`. Tokens are stored in the
+OS keyring when available, otherwise in `~/.dcm/tokens.json` (mode `0600`).
+
+To sign out and remove stored tokens:
+
+```bash
+dcm logout
+```
+
+See [CLI Configuration](../user-guide/cli-configuration/#authentication) for
+flags and environment variables.
+
+> **Local issuer hostname:** The reference stack advertises issuer
+> `http://keycloak:8080/realms/dcm`. The control plane resolves `keycloak` on
+> the compose network. On your host, map `keycloak` to the Keycloak container IP
+> (or use the same issuer URL your operator documents) so `dcm login` can reach
+> OIDC discovery and the device flow.
+
+### Web UI (Backstage)
</code_context>
<issue_to_address>
**issue:** The copy-pasted CLI example uses `http://keycloak:8080/realms/dcm`, but a CLI running on the host cannot resolve the `keycloak` container hostname by default, so `dcm login` fails during OIDC discovery. The suggested workaround of mapping the hostname to a container IP is not reproducible or stable, and replacing the hostname with `localhost` will fail issuer validation unless the IdP is configured to advertise that issuer.
**Triggers:** When a user runs the documented login command from the host against the local compose stack.
**Suggested fix:** Use an issuer hostname reachable from the host and configure Keycloak and `AUTH_ISSUER_URL` to advertise that same hostname, or provide explicit, stable host-to-container DNS/port-mapping instructions.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: content/docs/getting-started/authentication.md:131
Document /etc/hosts and issuer discovery before dcm login so host-side OIDC matches stock compose; link from CLI config. Assisted-By: Claude (Anthropic) Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Agent path, audience, proxy reference, warning callout, flag-based CLI examples. Assisted-By: Claude (Anthropic) Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
When --token is set it wins over stored login for API calls. Assisted-By: Claude (Anthropic) Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
vkolodny
left a comment
There was a problem hiding this comment.
Separate from the inline /providers curl examples: the doc also uses dcm sp provider list in a few places. That CLI subcommand still calls the removed /api/v1alpha1/providers route (control-plane#51). The CLI should be updated to list registrations via the supported API (e.g. /agents) and then these doc examples can follow — worth a CLI follow-up so users are not pointed at a dead endpoint.
Use catalog-items for auth curl and agents in local setup. Assisted-By: Claude (Anthropic) Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Empty means no audience check; call out explicit dcm-api for reference auth stacks. Assisted-By: Claude (Anthropic) Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
jordigilh
left a comment
There was a problem hiding this comment.
Reviewed in depth; no outstanding important findings.
jordigilh
left a comment
There was a problem hiding this comment.
Changing my earlier approval to request changes after a current-head audit. The authentication guide still instructs users to run dcm sp provider list, but the current CLI calls the removed /api/v1alpha1/providers route, so the documented smoke flow ends in 404. The existing review thread identifies this same issue; it must be fixed before approval/merge.
Use catalog item list for smoke checks after /providers removal. Assisted-By: Claude (Anthropic) Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
@jordigilh Fixed in 6ff7285 |
|
lgtm |
Documents how to use DCM when authentication is enabled on the control plane
Adds a Getting Started Authentication page covering OIDC/JWT behavior, operator prerequisites (compose/Helm pointers to control-plane RUN.md), CLI device login and static tokens, API Authorization: Bearer usage, Backstage/UI login at a high level, and common troubleshooting. Updates CLI Configuration, Local Setup, Troubleshooting, and DCM UI with cross-links and auth-related settings (issuer-url, DCM_TOKEN, dcm login / logout).
Content matches current implementation (Keycloak reference stack, default AUTH_DISABLED=true, public health endpoint, service-provider auth caveat).
Fixes: FLPATH-4479
Summary by Sourcery
Document how to configure and use authenticated DCM control planes across the CLI, API, and web UI.
New Features:
Enhancements:
Documentation:
Chores: