Reputation: 79
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 '[email protected]' \
--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
Upvotes: 0
Views: 2278
Reputation: 1
You can extend Authenticator interface and read the custom header with
@Override public void authenticate(AuthenticationFlowContext context) {
List<String> customHeader = context.getSession().getContext().getRequestHeaders().getRequestHeader(customheader);
//perform action for accept and deny
}
place the custom jar under standalone folder (<=17 version) / place under /keycloak/providers/ directory above 18 version
Upvotes: 0