Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

user.name is always UUID when using OIDC and Spring Security

未关闭
#4,109 8 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
java, spring

调研方向

首先追踪 Servlet 和 Spring MVC 插件如何为 Spring Security OAuth2 请求获取经过身份验证的 Principal,并将其与现有的 Azure SSO preferred_username 回退进行比较。定义可配置的 JWT claim 应如何影响 user.name 或其他用户数据,然后根据 ECS schema 和相关的身份验证集成测试验证结果。

由索引模型根据 Issue 内容生成。

描述

agent-java community

Is your feature request related to a problem?

When using Spring Security oauth2 authentication to secure an API server, user.name in APM always shows the user ID (as it's the "name" of the Principal).

If a user describes an issue and I go into the APM service view to investigate, I don't typically have their UUID (and neither do they). I do however have their email (login) or preferred username, so I need to recover their UUID manually from Keycloak.

Describe the solution you'd like

I'd like a different claim, in case of JWTs, to be logged instead of or in addition to the UUID. preferred_username is already mentioned in an Azure SSO fallback. Ideally, which claim is used would be configurable. Of course this is only valid for JWTs and similar tokens, which is my use case, so not entirely generic.

This may require going through the Spring MVC plugin instead of the Servlet one?

Describe alternatives you've considered

Using MDC to get additional claims into the transaction data, but it doesn't fit well in the ECS schema and it requires adding code to every backend service.

主要语言
Java
星标
593
派生
339
平均合并
1 天 9 小时
30 天内合并 PR
13

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

elastic/apm-agent-java 的其他 Issue

查看 elastic/apm-agent-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。