Skip to content

[Bug] Client UserAPI falls back to an incompatible auth path on Server 1.5 #759

Description

@looksaw2

Bug Type (问题类型)

rest-api (结果不合预期)

Before submit

  • I had searched in the issues and found no similar issues.

Environment (环境信息)

  • HugeGraph Server: 1.5.0 (Core 1.5.0, REST API 0.71.0.0)
  • Reproduction Hubble/Toolchain baseline: 60df3c51 (before the compatibility changes)
  • Current upstream PR target: be7ef3a
  • Authentication: StandardAuthenticator enabled
  • Deployment: standalone, DEFAULT / hugegraph
  • OS: macOS
  • Browser: Google Chrome
  • Data size: not data-dependent

Expected & Actual behavior (期望与实际表现)

When the current Java Client connects to an authentication-enabled HugeGraph Server 1.5, AuthManager creates UserAPI with the GraphSpace-scoped path. Because Server 1.5 does not support GraphSpace, RestClient removes the graphspaces/DEFAULT/ prefix and sends the request to /auth/users. Server 1.5 instead requires /graphs/{graph}/auth/users, and that legacy endpoint returns a users wrapper.

As a result, user lookup fails even when the supplied Basic credentials are valid. The Hubble screenshots below show the broader user-visible login symptom; this issue is intentionally scoped to the Java Client UserAPI path and response handling. Full Hubble login compatibility should be handled separately.

Steps to reproduce

  1. Start HugeGraph Server 1.5.0 with StandardAuthenticator enabled.
  2. Confirm GET /versions reports Core 1.5.0.
  3. Confirm the test credentials are accepted by GET /graphs/hugegraph/auth/users?name=<user>.
  4. Create a current pre-fix HugeClient for DEFAULT / hugegraph.
  5. Call client.auth().getUser(<existing-user>).
  6. Observe that the client falls back to /auth/users instead of /graphs/hugegraph/auth/users, so the lookup fails.

Before evidence

Step 1: Open the Hubble login page

Hubble login page before compatibility fix

Step 2: Enter credentials already verified against the Server 1.5 graph-scoped auth endpoint

Verified local credentials entered with password masked

Step 3: Submit the login form

Hubble login request fails against Server 1.5

Actual behavior

The legacy server request is routed to the unscoped /auth/users endpoint and user lookup fails. In Hubble this surfaces as Request failed: Failed to login HugeGraph Server.

Expected behavior

When GraphSpace is unsupported and a graph name is available, UserAPI should use /graphs/{graph}/auth/users and read the legacy users response wrapper. The existing GraphSpace-scoped behavior for modern servers should remain unchanged.

Proposed focused fix

  • Add a graph-aware legacy auth path in the Java Client.
  • Use it only when GraphSpace is unsupported and a graph name is present.
  • Parse the Server 1.5 users wrapper in UserAPI.getByName().
  • Add regression tests for both legacy and modern paths.

Vertex/Edge example (问题点 / 边数据举例)

N/A  this issue is not dependent on vertex or edge data.

Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

N/A  this issue is caused by authentication endpoint compatibility, not graph schema.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingclienthugegraph-client

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions