title: Send password forgotten mail
body: <p>I have two similar use cases in Keycloak. </p>
  
  <p><strong>Password reset</strong></p>
  
  <p>First is, I want to enable users to reset their passwords. There is already an application the users are using, so it would be nice to integrate it there. I created a small anngular module within it and tried to trigger a password forgotten mail via the same mechanism the Keycloak password forgotten form provides. But I can't figure out how they created this action link:</p>
  
  <blockquote>
    <p><a href="https://example.com/keycloak/auth/realms/my-realm/login-actions/reset-credentials?session_code=dpmvJISKKf-SSZbC8_FkrBZEuYhwcV24ui-dc27DKvI&amp;execution=98bd5b5d-054e-4c44-ad07-50b668fb149a&amp;client_id=account&amp;tab_id=Lr7iH6BRehM" rel="nofollow noreferrer">https://example.com/keycloak/auth/realms/my-realm/login-actions/reset-credentials?session_code=dpmvJISKKf-SSZbC8_FkrBZEuYhwcV24ui-dc27DKvI&amp;execution=98bd5b5d-054e-4c44-ad07-50b668fb149a&amp;client_id=account&amp;tab_id=Lr7iH6BRehM</a></p>
  </blockquote>
  
  <p>The execution seems to be always the same, but I have no clue where to get it in the first place.</p>
  
  <p>My current solution, which works while Keycloak and the application run on the sam domain, is to request the original site from keycloak, extract the link and after the user enters the username make a post request to that URL. But that is a little bit dirty :)</p>
  
  <p>Is there a "correct" way to do that?</p>
  
  <p><strong>Addition to password reset</strong></p>
  
  <p>We have different realms to work with user accounts that are in LDAP with a SASL attribute and the real password stored in MSAD. Our frontend figures out which type of user is requesting the password reset and delegates to the appropriate realm.</p>
  
  <p><strong>Initial Password</strong></p>
  
  <p>The second question is about creating users in an admin area and send an initial mail to set a password. I could use the method from above to trigger a mail. But it not good that the mail says password forgotten while they realy have to set the password for the first time.
  I tried to set required actions in the users REST representation, but it seems that this triggers no mail.</p>
  
  <p>Are required actions to intened way to do that? Did I miss a feature?</p>
  
  <p><strong>Addition to password reset</strong>
  We have different realms to work with user accounts that are in LDAP with a SASL attribute and the real password stored in MSAD. Our frontend figures out which type of user is requesting the password reset and delegates to the appropriate realm.</p>