Adding headers to request/response of token endpoint

Can we add custom headers to the token endpoint?

curl --location --request POST 'https://localhost:8081/auth/realms/global/protocol/openid-connect/token' \

--header 'Content-Type: application/x-www-form-urlencoded' \

--data-urlencode 'client_id=login' \

--data-urlencode 'username=balabla@bla.com' \

--data-urlencode 'password=balbabsfeds@123' \


We are using userfederation with custom logic to determine whether the credentials are authentic. We’ve implemented the authentication spi shown below.
implements UserStorageProvider,
UserLookupProvider,
CredentialInputValidator,
CredentialInputUpdater,
UserRegistrationProvider