I have a requirement where i need to implement a forgot username feature on keycloak as we consider username as unique and allow duplicate emails.
For this i have added new ftl for "Forgot Username" which is somewhat same as "Forgot Password" ftl (reffered below link for new ftl)
Updated login.ftl with:
```
<div class="forgot-password-link form-text text-right">
<span><a id="kc-forgot-password" tabindex="7" class="links-regular"
href="/auth/realms/${realm.displayName}/
{RealmResourceProviderId} /username-reminder">Forgot Username</a></span>
</div>
```
Now for forgot-username link:
- How to generate all the parameters necessary to trigger the flow ?
In the out of the box scenario the link that triggers the reset credentials flow looks like this :
{keycloakHost}/realms/{realmName}/login-actions/reset-credentials?session_code={sessionCode}&execution={executionId}&client_id={clientId}&tab_id={tabId}
- How to validate the reset password action token ?
Once I’ve clicked on the link in the email I’ll be redirected to my custom page (not the keycloak one once again) for entering my new password, on this page on the out of the box scenario the token is validated by keycloak to make sure it was issued by keycloak and not expired. But it is unclear how this is done, which endpoint to call, with what parameters.
Any help on either of those questions would be massively appreciated. I can provide more info if necessary.
Best Regards