You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/migration.adoc
+312
Original file line number
Diff line number
Diff line change
@@ -3520,6 +3520,318 @@ open class SecurityConfiguration {
3520
3520
----
3521
3521
====
3522
3522
3523
+
=== Update Password Encoding
3524
+
3525
+
In 6.0, password encoding minimums are updated for PBKDF2, SCrypt, and Argon2.
3526
+
3527
+
[NOTE]
3528
+
====
3529
+
If you are using the default password encoder, then there are no preparation steps to follow and this section can be skipped.
3530
+
====
3531
+
3532
+
==== Update `Pbkdf2PasswordEncoder`
3533
+
3534
+
If you are xref:features/authentication/password-storage.adoc#authentication-password-storage-pbkdf2[using `Pbkdf2PasswordEncoder`], the constructors are replaced with static factories that refer to the Spring Security version that the given settings apply to.
3535
+
3536
+
===== Replace Deprecated Constructor Usage
3537
+
3538
+
If you use the default constructor, you should begin by changing:
Or, if you have custom settings, change to the constructor that specifies all settings, like so:
3583
+
3584
+
====
3585
+
.Java
3586
+
[source,java,role="primary"]
3587
+
----
3588
+
@Bean
3589
+
PasswordEncoder passwordEncoder() {
3590
+
PasswordEncoder current = new Pbkdf2PasswordEncoder("mysecret".getBytes(UTF_8), 320000);
3591
+
return current;
3592
+
}
3593
+
----
3594
+
3595
+
.Kotlin
3596
+
[source,kotlin,role="secondary"]
3597
+
----
3598
+
@Bean
3599
+
fun passwordEncoder(): PasswordEncoder {
3600
+
val current: PasswordEncoder = Pbkdf2PasswordEncoder("mysecret".getBytes(UTF_8), 320000)
3601
+
return current
3602
+
}
3603
+
----
3604
+
====
3605
+
3606
+
Change them to use the fully-specified constructor, like the following:
3607
+
3608
+
====
3609
+
.Java
3610
+
[source,java,role="primary"]
3611
+
----
3612
+
@Bean
3613
+
PasswordEncoder passwordEncoder() {
3614
+
PasswordEncoder current = new Pbkdf2PasswordEncoder("mysecret".getBytes(UTF_8), 16, 185000, 256);
3615
+
return current;
3616
+
}
3617
+
----
3618
+
3619
+
.Kotlin
3620
+
[source,kotlin,role="secondary"]
3621
+
----
3622
+
@Bean
3623
+
fun passwordEncoder(): PasswordEncoder {
3624
+
val current: PasswordEncoder = Pbkdf2PasswordEncoder("mysecret".getBytes(UTF_8), 16, 185000, 256)
3625
+
return current
3626
+
}
3627
+
----
3628
+
====
3629
+
3630
+
===== Use `DelegatedPasswordEncoder`
3631
+
3632
+
Once you are not using the deprecated constructor, the next step is to prepare your code to upgrade to the latest standards by using `DelegatedPasswordEncoder`.
3633
+
The following code configures the delegating encoder to detect passwords that are using `current` and replace them with the latest:
If you are xref:features/authentication/password-storage.adoc#authentication-password-storage-scrypt[using `SCryptPasswordEncoder`], the constructors are replaced with static factories that refer to the Spring Security version that the given settings apply to.
3668
+
3669
+
===== Replace Deprecated Constructor Usage
3670
+
3671
+
If you use the default constructor, you should begin by changing:
Once you are not using the deprecated constructor, the next step is to prepare your code to upgrade to the latest standards by using `DelegatedPasswordEncoder`.
3718
+
The following code configures the delegating encoder to detect passwords that are using `current` and replace them with the latest:
If you are xref:features/authentication/password-storage.adoc#authentication-password-storage-argon2[using `Argon2PasswordEncoder`], the constructors are replaced with static factories that refer to the Spring Security version that the given settings apply to.
3753
+
3754
+
===== Replace Deprecated Constructor Usage
3755
+
3756
+
If you use the default constructor, you should begin by changing:
Once you are not using the deprecated constructor, the next step is to prepare your code to upgrade to the latest standards by using `DelegatedPasswordEncoder`.
3803
+
The following code configures the delegating encoder to detect passwords that are using `current` and replace them with the latest:
0 commit comments