Did you do it?
I think this is pretty straightforward:
- Check
org.keycloak.authentication.authenticators.browser.IdentityProviderAuthenticatorfor an example of how to get uri params in the authentication flow and thenCookieAuthenticator.javafor how to communicate success to the flow. - Setup a custom flow using your authenticator
The steps above will authenticate a user in the keycloak database. The second part would be to get this user form your rest API.
For that, you need to implement a UserLookupProvider.
In your authenticator, when you ask for the user with id endUserString all classes implementing UserLookupProvider will be called until one return an UserModel. You just implement the query to your rest API here, convert the api data to Keycloak Model (user info, roles and permissions) and let keycloak handle the rest of the OIDC flow.
Hope this helps.