Hi. Thanks. Sorry for the late response as I haven’t been logged in to this forum for quite a while. I followed the comment from Allan on stackoverflow (java - Create a custom identity provider and configure it with keycloak - Stack Overflow) and managed to create a custom Authenticator intercepting the OIDC authentication flow. I added ‘extends AbstractUsernameFormAuthenticator imlements Authenticator’ to my class and fetched the query param from context.getHttpRequest().
Then I called my rest api and added the params to the context.getSession().users(). In addition I added mappings from User Attributes in keycloak and everything was working well in the getUserInfo method.