Skip to content

[Bug] Pre-auth keys "user" field returns the email. #2520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 of 4 tasks
tale opened this issue Apr 6, 2025 · 0 comments · May be fixed by #2542
Open
3 of 4 tasks

[Bug] Pre-auth keys "user" field returns the email. #2520

tale opened this issue Apr 6, 2025 · 0 comments · May be fixed by #2542
Labels
bug Something isn't working
Milestone

Comments

@tale
Copy link

tale commented Apr 6, 2025

Is this a support request?

  • This is not a support request

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I'm not entirely sure if this is intended behavior or a bug, but when requesting pre-auth keys via the API /api/v1/preauthkey?user=<user>, the user field on the returned keys have emails and not the user.name or a user object.

Example:

{
  "preAuthKeys": [
    {
      "user": "[email protected]",
      "id": "2",
      "key": "[redacted]",
      "reusable": true,
      "ephemeral": false,
      "used": true,
      "expiration": "2025-07-05T19:00:37.730Z",
      "createdAt": "2025-04-06T19:00:37.840878704Z",
      "aclTags": []
    }
  ]
}

Expected Behavior

API docs aren't clear on this and I expect the response to either return the user.name since that is what we use to filter for pre-auth keys in the request (?user=<user.name>). Or even better, it should return the entire user object, exactly the same as how /api/v1/node does.

Steps To Reproduce

  1. Setup Headscale with OIDC
  2. Authenticate via OIDC (creating an OIDC user in the database)
  3. Generate a pre-auth key tied to the OIDC user
  4. Request the auth keys tied to the OIDC user via the API.

Environment

- OS: macOS Sequoia 15.3.2
- Headscale version: v0.25.1
- Tailscale version: 1.82.0

Runtime environment

  • Headscale is behind a (reverse) proxy
  • Headscale runs in a container

Debug information

status.json
debug_netmap.json

@tale tale added the bug Something isn't working label Apr 6, 2025
@kradalby kradalby added this to the v0.26.0 milestone Apr 14, 2025
@kradalby kradalby linked a pull request Apr 23, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants