Como o mesmo 2FA (TOTP) do Keycloak aparece nos dois fluxos de login.
grant_type=password — login nesta app, sem redirecionamentoNa tela de login, é o botão Entrar.
POST /token com
grant_type=password, username, password e totp.Validate OTP).POST http://keycloak:8080/realms/poc/protocol/openid-connect/token Content-Type: application/x-www-form-urlencoded grant_type=password client_id=poc-tema2-ropc client_secret=*** username=poc.user password=*** totp=123456 scope=openid profile email
O Direct Grant nativo do Keycloak ignora o segundo fator. Este realm usa um flow
próprio, direct grant with otp, apontado em realm.directGrantFlow:
Validate Username [REQUIRED] Validate Password [REQUIRED] direct grant otp conditional [CONDITIONAL] Condition - user configured [REQUIRED] Validate OTP [REQUIRED]
401 invalid_grant e a tela de login mostra a resposta crua.