Switch token endpoint auth methods (PKJWT ↔ client_secret_*)
This runbook switches the BFF client between private_key_jwt and client_secret_post/client_secret_basic safely.
PKJWT → client_secret_post/basic
- IdP: Update client to
token_endpoint_auth_method: client_secret_post(orclient_secret_basic) and setclient_secretorclient_secret_hashinServiceConfigs/IdP/config/clients.yaml(or re‑register via DCR) - BFF: Set
MS_BFF_TOKEN_AUTH_METHODto the chosen method and setAUTH_CLIENT_SECRET; PEM can be removed/ignored - Restart BFF; verify
/token200 during login
client_secret_* → PKJWT
- IdP: Re‑register with
client_profiles.code-flow-pkjwtvia DCR, providing JWKS - BFF: Set
MS_BFF_TOKEN_AUTH_METHOD=private_key_jwt; ensureBFF_JWT_SIGNING_KEYPEM is mounted - Restart BFF; verify
/token200 and correct JWKSkid
Common pitfalls
- Changing BFF env without updating the IdP client (or vice versa) leads to 401
invalid_client - Missing/incorrect JWKS
kidvs PEM → signature mismatch - Missing
client_secretin clients.yaml when switching to secret methods
See also: services/bff/reference/bff-idp-oauth-e2e and services/bff/how-to/register-bff-private-key-jwt.