Skip to content

Commit 33ce3b5

Browse files
committed
Add Saml2AuthenticationToken Preparation Steps
Issue gh-11077
1 parent 4d646a2 commit 33ce3b5

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

docs/modules/ROOT/pages/migration.adoc

+42
Original file line numberDiff line numberDiff line change
@@ -1973,6 +1973,48 @@ Saml2AuthenticationRequestResolver authenticationRequestResolver() {
19731973
Since Spring Security only supports the `POST` binding for authentication, there is not very much value in overriding the protocol binding at this point in time.
19741974
====
19751975

1976+
=== Use the latest `Saml2AuthenticationToken` constructor
1977+
1978+
In an early release, `Saml2AuthenticationToken` took several individual settings as constructor parameters.
1979+
This created a challenge each time a new parameter needed to be added.
1980+
Since most of these settings were part of `RelyingPartyRegistration`, a new constructor was added where a `RelyingPartyRegistration` could be provided, making the constructor more stable.
1981+
It also is valuable in that it more closely aligns with the design of `OAuth2LoginAuthenticationToken`.
1982+
1983+
Most applications do not construct this class directly since `Saml2WebSsoAuthenticationFilter` does.
1984+
However, in the event that your application constructs one, please change from:
1985+
1986+
====
1987+
.Java
1988+
[source,java,role="primary"]
1989+
----
1990+
new Saml2AuthenticationToken(saml2Response, registration.getSingleSignOnServiceLocation(),
1991+
registration.getAssertingParty().getEntityId(), registration.getEntityId(), registration.getCredentials())
1992+
----
1993+
1994+
.Kotlin
1995+
[source,kotlin,role="secondary"]
1996+
----
1997+
Saml2AuthenticationToken(saml2Response, registration.getSingleSignOnServiceLocation(),
1998+
registration.getAssertingParty().getEntityId(), registration.getEntityId(), registration.getCredentials())
1999+
----
2000+
====
2001+
2002+
to:
2003+
2004+
====
2005+
.Java
2006+
[source,java,role="primary"]
2007+
----
2008+
new Saml2AuthenticationToken(saml2Response, registration)
2009+
----
2010+
2011+
.Kotlin
2012+
[source,kotlin,role="secondary"]
2013+
----
2014+
Saml2AuthenticationToken(saml2Response, registration)
2015+
----
2016+
====
2017+
19762018
== Reactive
19772019

19782020
=== Use `AuthorizationManager` for Method Security

0 commit comments

Comments
 (0)