Skip to content

Commit 67d94ea

Browse files
committed
Add backward compatibility overload for SuccessfulAuthenticationResponseMessageBuilder.build
This commit adds an overloaded build method that accepts only two parameters (user and authenticationState) and forwards the call to the three-parameter version with null for the customAttributes parameter. This maintains backward compatibility with existing code that doesn't use custom attributes. This fixes a compilation error in ServerlessSsoIT.java which was still using the two-parameter method signature. Signed-off-by: lloydmeta <[email protected]>
1 parent 763363b commit 67d94ea

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/authn/SuccessfulAuthenticationResponseMessageBuilder.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,25 @@ public SuccessfulAuthenticationResponseMessageBuilder(SamlFactory samlFactory, C
6767
this.idp = idp;
6868
}
6969

70+
/**
71+
* Builds and signs a SAML Response Message with a single assertion for the provided user
72+
*
73+
* @param user The user who is authenticated (actually a combination of user+sp)
74+
* @param authnState The authentication state as presented in the SAML request (or {@code null})
75+
* @return A SAML Response
76+
*/
77+
public Response build(UserServiceAuthentication user, @Nullable SamlAuthenticationState authnState) {
78+
return build(user, authnState, null);
79+
}
80+
81+
/**
82+
* Builds and signs a SAML Response Message with a single assertion for the provided user
83+
*
84+
* @param user The user who is authenticated (actually a combination of user+sp)
85+
* @param authnState The authentication state as presented in the SAML request (or {@code null})
86+
* @param customAttributes Optional custom attributes to include in the response (or {@code null})
87+
* @return A SAML Response
88+
*/
7089
public Response build(
7190
UserServiceAuthentication user,
7291
@Nullable SamlAuthenticationState authnState,

0 commit comments

Comments
 (0)