Custom Authentication for authentcating user without forms - custom auth flow

I am trying to built a custom authentication for my application. I am looking for an auth code grant type flow. The users will provide their consent in a different application. Users will not be sharing the user credentials(only user id is shared) details in the auth code flow. So i am using direct access grant flow.

Actual requiremnt is
Application 1 (only userid is shared) => Keycloak => Initiates notification => application 2
User provides consent to the request in application 2.
Keycloak checks for consent, once consent recd => Keycloak send back auth code to Application1.
Application1 get JWT using auth code.

I tried to use Authentication SPI and solve this problem. i am running into the below error.
@Override
public void authenticate(AuthenticationFlowContext context) {
System.out.println(“logging from custom authenticator for the open banking”);
// code for getting the consent.
context.success();
}

12:19:03,246 ERROR [org.keycloak.services.error.KeycloakErrorHandler] (default task-1) Uncaught server error: org.keycloak.authentication.AuthenticationFlowException: authenticator: customauthenticator

at org.keycloak.keycloak-services@16.1.1//org.keycloak.authentication.DefaultAuthenticationFlow.processSingleFlowExecutionModel(DefaultAuthenticationFlow.java:431)

Currently i have enabled direct flow for getting the token…

Please let me know if i am going in right direction. I am not able to get any details on the stack trace. How to get more details on the error?