# Authenticating user automatically after password update

**URL:** https://forum.keycloak.org/t/authenticating-user-automatically-after-password-update/13712
**Category:** Extending the server
**Tags:** authentication
**Created:** [February 18, 2022, 11:47am UTC](https://forum.keycloak.org/t/authenticating-user-automatically-after-password-update/13712 "2022-02-18T11:47:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![the-dude](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/the-dude/32/5033_2.png) [@the-dude](https://forum.keycloak.org/u/the-dude)
#### Post date: [February 18, 2022, 11:47am UTC](https://forum.keycloak.org/t/authenticating-user-automatically-after-password-update/13712/1 "2022-02-18T11:47:20Z")

</div>

For a user arriving on the “Update Password” screen with an UPDATE\_PASSWORD action token, how would I go about authenticating the user automatically using the new credentials followed by a forward to the redirect\_uri?

Our use case:

- User is created programatically with throwaway password that is not shared with them.
- User receives a link to a Keycloak URL with a token for the UPDATE\_PASSWORD action.
- Current default behaviour - undesired in this context - is that once password has been changed user needs to click on “Proceed to application” link and **then** log in.

I discarded the option of sending the throwaway password to the user and flagging them with “Update Password” required action even though it authenticates/redirects to the application once the flow is completed.

I guess I’d need to code a provider which mixes log in + password change which seems non-trivial. Any pointers to prior examples or relevant parts in the Keycloak source are appreciated.

Thank you,

David

---

<div class="post-metadata">

### Author: ![the-dude](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/the-dude/32/5033_2.png) [@the-dude](https://forum.keycloak.org/u/the-dude)
#### Post date: [March 1, 2022, 9:44am UTC](https://forum.keycloak.org/t/authenticating-user-automatically-after-password-update/13712/2 "2022-03-01T09:44:22Z")

</div>

Hello, in the end I used something similar to what is discussed here: [Logging a user in directly from an ActionToken](http://forum.keycloak.org/t/logging-a-user-in-directly-from-an-actiontoken/12506), a custom token and its handler.
