Hello,
I have created a theme and extended the base login form with an extra
input field.
I've also created a Script Authenticator that checks the value of the
extra field and permits or not the authentication.
My authenticator script runs after the builtin 'Username Password form'
(Browser flow).
Now I would like to do two things when authentication fails because of
my script:
1. Use a custom i18n error message instead of showing one of the
messages of the builtin AuthenticationFlowError. Is there a way to do so?
2. Stay on the login page and show the error message instead of being
sent to a 'We're sorry...' page with a link back to the login form.
For instance the builtin 'Username Password form' stays on the login
form with an error message when authentication fails which is nice and
clean.
Currently I fail the authentication with 'context.clearUser();
context.failure(AuthenticationFlowError.INVALID_CREDENTIALS);'
but I've tried various methods from 'context' without achieving either 1
or 2 of my requirements.
Cheers,
Vagelis