skillhub/server
XiaoSeS b1f1b18737 fix(auth): stop the DingTalk callback being routed to the OIDC provider
The DingTalk login could not complete. Adding openid to the authorization
request's scope set avoided the nonce at the authorize step but broke the
callback: OAuth2LoginAuthenticationProvider.authenticate returns null when
getScopes() contains "openid", handing the exchange to
OidcAuthorizationCodeAuthenticationProvider, which fails with
invalid_id_token because DingTalk returns no id_token. Neither the token
client nor the user service was ever reached. spring-security-oauth2-jose is
on the runtime classpath, so that provider is registered.

The scope now goes onto the outgoing authorization URI directly, leaving
getScopes() empty. Both openid-keyed mechanisms are then avoided: no nonce,
because the registration still declares no scope in configuration, and no
OIDC routing, because the request carries no openid scope.

The previous test asserted getScopes() contains "openid" -- the exact state
that breaks the callback -- so it locked the bug in. It now asserts the
inverse, and restoring the old implementation makes it fail.

Also switches the registration from client-authentication-method: none to
client-secret-post. "none" made Spring apply PKCE and emit a code_challenge
that DingTalkTokenResponseClient cannot answer, since its JSON token request
sends no code_verifier. It was also semantically wrong: DingTalk is a
confidential client that carries its secret in the request body.

Verified against a local staging instance: the authorization URI now carries
scope=openid with no nonce and no code_challenge, and a callback with a fake
code fails in the token exchange with no OIDC provider involvement in the
logs.

Drops SUBJECT_ATTRIBUTE, which lost its last reference when the user service
stopped pre-resolving the subject.

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
2026-09-21 15:15:41 +08:00
..
.mvn docs: add Maven mirror config and troubleshooting guide for China developers (#233) 2026-04-07 09:50:07 +08:00
scripts feat(notification): add in-app notifications and harden delivery 2026-03-23 12:31:28 +08:00
skillhub-app fix(auth): stop the DingTalk callback being routed to the OIDC provider 2026-09-21 15:15:41 +08:00
skillhub-auth fix(auth): stop the DingTalk callback being routed to the OIDC provider 2026-09-21 15:15:41 +08:00
skillhub-domain feat(auth): unified identity core with LEGACY/SHADOW/ACTIVE rollout (#874) 2026-09-18 14:34:37 +08:00
skillhub-infra feat(auth): unified identity core with LEGACY/SHADOW/ACTIVE rollout (#874) 2026-09-18 14:34:37 +08:00
skillhub-notification refactor(notification): replace SSE with HTTP polling 2026-09-03 11:38:02 +08:00
skillhub-search feat(suite): publish suites from multi-skill bundles 2026-09-17 11:16:39 +08:00
skillhub-storage fix(storage): disable chunked encoding for Aliyun OSS compatibility 2026-05-06 13:56:55 +08:00
.dockerignore feat(staging): optimize staging build with local Maven packaging 2026-03-14 14:21:06 +08:00
Dockerfile fix(deploy): preserve storage volume ownership 2026-08-29 15:58:55 +08:00
Dockerfile.dev fix(storage): defer S3 bucket verification until first access (#289) 2026-04-12 15:24:09 +08:00
mvnw feat: initialize Maven multi-module project structure 2026-03-11 22:52:04 +08:00
mvnw.cmd feat: initialize Maven multi-module project structure 2026-03-11 22:52:04 +08:00
pom.xml feat(notification): add in-app notifications and harden delivery 2026-03-23 12:31:28 +08:00