Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 2.14 KB

_rehashing-user-passwords.mdx

File metadata and controls

24 lines (16 loc) · 2.14 KB

import InlineField from 'src/components/InlineField.astro'; import InlineUIElement from 'src/components/InlineUIElement.astro'; import Aside from 'src/components/Aside.astro';

The purpose of writing a custom password hasher is to import users into FusionAuth using an existing hashing scheme. This allows you to seamlessly import your users without requiring them to change their password. The downside of this approach is that you now have preserved a hash which may be weak. FusionAuth will continue to use that hash unless you rehash users' passwords.

To remedy this common situation, FusionAuth has the ability to rehash passwords on user login. Once enabled, during the next login event for a given user, FusionAuth will transparently rehash that user's password. The stronger, more secure hash will be used in the future for that user.

To import users and transparently rehash their passwords, do the following:

  • Write a custom password hasher.
  • Import user passwords, setting the scheme for each user to the custom password hasher.
  • Decide on the new hashing scheme you want to use.
  • In the administrative user interface, navigate to Tenants -> Your Tenant -> Password and then to the Cryptographic hash settings section. Here you will configure both the new scheme and the rehash on login behavior.
  • Configure the tenant to use the new hashing scheme by selecting it. You may use one of the standard hashing schemes or a different custom scheme. This will be used for all new users in this tenant as well.
  • Configure the tenant to rehash on login by checking the Re-hash on login checkbox.
  • Save the tenant configuration.

Tenant settings for rehashing passwords on login

After you have enabled this, when a user logs in, the password they provide will be transparently rehashed and they will use the stronger scheme in the future.

Beginning in version 1.42.0, when this configuration is enabled, in addition to re-hashing on login, the password will be re-hashed on password change.