Skip to content

whoami shows no user for a sign-in: the app does not publish who the user is #182

Closed

Description

Measured

After a browser sign-in with the published CLI (0.4.4, macOS), hodeishield whoami prints Profile, API, App, Credential, Issuer, Expires and Scopes, but no User line ("user": null with --json).

The CLI reads the user from the authorization server's userinfo_endpoint (auth/oauth.rs, userinfo) and leaves the line out when there is none. The published authorization-server metadata (/.well-known/oauth-authorization-server/api/auth) has no userinfo_endpoint and offers no openid, profile or email scope, so there is nothing to call. GET /v1/me (API document 2026-10-19) describes the credential, tenant and organisation, but not the user.

Acceptance criteria

  • After a sign-in, whoami shows the signed-in user (name and email) in the table and in --json (user), read from GET /v1/me.
  • With an API key or a portfolio key there is no user line, as today.
  • Names from the API are cleaned before they are printed; a test covers it.
  • No new OAuth scope is requested for this.

Depends on

The API: GET /v1/me returning the user (id, name, email) for a sign-in token.

Activity

  1. d0ubl3g commented on Oct 15, 2026

    @d0ubl3g
    ContributorAuthor

    The CLI side is in dev (#189): whoami reads the signed-in user from GET /v1/me when the API provides it, and ignores it for keys. Output does not change until the API returns the field. This issue stays open until a sign-in shows the user against the published API.

  2. d0ubl3g commented on Oct 15, 2026

    @d0ubl3g
    ContributorAuthor

    Reopened: version 0.5.0 reads the signed-in user from GET /v1/me and shows it in the User line and in --json (user), but the published API document (2026-10-19) does not return user in that response yet, so whoami still shows no user after a sign-in. This stays open until the API sends it.

  3. d0ubl3g commented on Oct 18, 2026

    @d0ubl3g
    ContributorAuthor

    Verified against the published API with version 0.5.0 on Linux, 2026-10-19:

    • Browser and device sign-ins of a tenant user and of a managed-service-provider user (signed into a client tenant): whoami shows User <name> <<email>> in the table, and whoami --json carries the same value in user, read from GET /v1/me.
    • The scopes requested are the 0.5.0 defaults; no new scope.
    • Name cleaning is covered by the unit tests in commands/session.rs; the API-key and portfolio-key path (no user line) is covered by the same tests.

    Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions