I have a custom MFA in which I need to update the Principal upon successful authentication. Once the authentication is complete I have the following return statement where "alternate" a different username that the one who logged in.
return createHandlerResult(
credential, this.principalFactory.createPrincipal(alternate), new ArrayList<>(0));
In the logs I can see the Authenticated principal with the correct username which I set in the MFA handler. But the Principal reverts back to the original username for the action "TICKET_GRANTING_TICKET_CREATED".
I'm not sure where I'm going wrong with this. Any help would be appreciated.