1
1
/*
2
- * Copyright (c) 2013-2024 , Inversoft Inc., All Rights Reserved
2
+ * Copyright (c) 2013-2025 , Inversoft Inc., All Rights Reserved
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
16
16
package io .fusionauth .samlv2 .domain ;
17
17
18
18
import java .time .ZonedDateTime ;
19
+ import java .util .ArrayList ;
20
+ import java .util .List ;
19
21
import java .util .Objects ;
20
22
21
23
/**
24
26
* @author Brian Pontarelli
25
27
*/
26
28
public class AuthenticationResponse extends SAMLResponse {
27
- public Assertion assertion = new Assertion ();
29
+ public List < Assertion > assertions = new ArrayList <> ();
28
30
29
31
public String rawResponse ;
30
32
31
33
public ZonedDateTime sessionExpiry ;
32
34
33
35
public String sessionIndex ;
34
36
37
+ public AuthenticationResponse () {
38
+ }
39
+
40
+ public AuthenticationResponse (AuthenticationResponse other ) {
41
+ super (other );
42
+ this .assertions .addAll (other .assertions .stream ().map (Assertion ::new ).toList ());
43
+ this .rawResponse = other .rawResponse ;
44
+ this .sessionExpiry = other .sessionExpiry ;
45
+ this .sessionIndex = other .sessionIndex ;
46
+ }
47
+
35
48
@ Override
36
49
public boolean equals (Object o ) {
37
50
if (this == o ) {
@@ -46,13 +59,13 @@ public boolean equals(Object o) {
46
59
AuthenticationResponse that = (AuthenticationResponse ) o ;
47
60
// The comparison does not include the rawResponse because different raw encoded responses can be parsed into
48
61
// identical domain objects. This is mainly true for responses containing an encrypted assertion
49
- return Objects .equals (assertion , that .assertion ) &&
62
+ return Objects .equals (assertions , that .assertions ) &&
50
63
Objects .equals (sessionExpiry , that .sessionExpiry ) &&
51
64
Objects .equals (sessionIndex , that .sessionIndex );
52
65
}
53
66
54
67
@ Override
55
68
public int hashCode () {
56
- return Objects .hash (super .hashCode (), assertion , rawResponse , sessionExpiry , sessionIndex );
69
+ return Objects .hash (super .hashCode (), assertions , rawResponse , sessionExpiry , sessionIndex );
57
70
}
58
71
}
0 commit comments