Skip to content

Bug : API v2 auth token creation fails due to token request field mismatch #348

@Shikshak-Kumar

Description

@Shikshak-Kumar

Description

Token creation via API v2 fails because the frontend sends snake_case
token request fields, while the backend expects camelCase fields.

Steps to Reproduce

  1. Build FOSSologyUI pointing to API v2:

NEXT_PUBLIC_SERVER_URL=localhost/repo/api/v2

  1. Attempt to create a new authentication token via the UI or REST call.
  2. Observe token creation failure or missing token metadata.

Expected Behavior

Token should be created successfully with correct token name, scope,
and expiry.

Actual Behavior

Token metadata is ignored or token creation fails because the backend
does not recognize the provided request fields.

Root Cause

The backend TokenRequest::fromArray() explicitly expects camelCase
fields (tokenName, tokenScope, tokenExpire), but the frontend
sends snake_case fields (token_name, token_scope, token_expire).

Environment

  • FOSSologyUI version: main branch
  • API version: v2
  • OS: macOS (Apple Silicon)
  • Browser: Chrome

Additional Context

This issue only affects API v2 authentication token creation.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions