-
Notifications
You must be signed in to change notification settings - Fork 0
/
AssertionSimpleClientTestUtils.java
284 lines (278 loc) · 23.3 KB
/
AssertionSimpleClientTestUtils.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
/* (C)2023 */
package it.pagopa.tech.lollipop.consumer.assertion.client.simple;
import static org.mockserver.model.HttpRequest.request;
import static org.mockserver.model.HttpResponse.response;
import org.mockserver.client.MockServerClient;
import org.mockserver.model.Header;
public class AssertionSimpleClientTestUtils {
public static final String XML_STRING =
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?> <saml2p:Response"
+ " xmlns:saml2p=\"urn:oasis:names:tc:SAML:2.0:protocol\""
+ " Destination=\"https://app-backend.io.italia.it/assertionConsumerService\""
+ " ID=\"_de2ce675-f1e5-46fc-96ed-019803471175\""
+ " InResponseTo=\"sha256-a7qE0Y0DyqeOFFREIQSLKfu5WlbckdxVXKFasfcI-Dg\""
+ " IssueInstant=\"2023-02-28T16:27:26.400Z\" Version=\"2.0\"> <saml2:Issuer"
+ " xmlns:saml2=\"urn:oasis:names:tc:SAML:2.0:assertion\">https://posteid.poste.it</saml2:Issuer>"
+ " <Signature xmlns=\"http://www.w3.org/2000/09/xmldsig#\"> <SignedInfo>"
+ " <CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\""
+ " /> <SignatureMethod"
+ " Algorithm=\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\" /> <Reference"
+ " URI=\"#_de2ce675-f1e5-46fc-96ed-019803471175\"> <Transforms> <Transform"
+ " Algorithm=\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\" />"
+ " <Transform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\" />"
+ " </Transforms> <DigestMethod"
+ " Algorithm=\"http://www.w3.org/2001/04/xmlenc#sha256\" />"
+ " <DigestValue>IYCwE8NJNGLAGdL8zA/W/kuTLdlHMMXMeP2hei8LYqU=</DigestValue>"
+ " </Reference> </SignedInfo>"
+ " <SignatureValue>GI9CwzYfcmTBE9Lf7Hvqr2bgCkfbuq6vZPwZaaCmxq5cicDf7+k6TYussUx147iAdngl4vMixAjA"
+ " eABU0cSrZllLW0Gqxm+EPvylwMc4O1tNYlpvjnZzW7PIRns5M22KSzfHBDdGZG7Dq4uDHVbGCENu"
+ " TV5UaGNQJ2sNTD95Qaz6pmQtx0guehDc/m5ldFvChqZTKrOcVu+qTRFkW+OabbnkmKXPSWpTN9WE"
+ " 4RramWgWkNE/sn4z0Rwmnei8oEhcBKSpOMrenbMgpCYjoRto5lDGGJrMkeKsJ1PzD1ZCrE/GkzX9"
+ " HtXHIaYE6cZ7vBXQh4SVpl26JGQ87tu2YLeoZw==</SignatureValue> <KeyInfo> <X509Data>"
+ " <X509Certificate>MIIFgzCCA2ugAwIBAgIIJSppAZKg/XQwDQYJKoZIhvcNAQELBQAwZTELMAkGA1UEBhMCSVQxHjAc"
+ " BgNVBAoMFVB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EAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwQwJwYDVR0RBCAwHoEc"
+ " aWRwLXBvc3RlaWRAcG9zdGVpdGFsaWFuZS5pdDANBgkqhkiG9w0BAQsFAAOCAgEAp0EhITlTx+cO"
+ " aoXw//nBl6Q4y82MfSGfPJIw3ROV1z3tHBctaksi/RxAzyMD5beO2s8Q6lXx0sLMCcuUQmzHj3eJ"
+ " bqn+6sIUr000dSlX/iPgVUc2dvPIZZg9xu38J8NvCfrtgAGY5iMVFMd3CZLFw0ybr+Bx/1K/NhQO"
+ " 7jxn0RSGA1J4mM2syVhEDUODs9kz3T4kXYUofwwvPL1a9xB9RBqbp7plYtbBBdftEORUQrWzH1mz"
+ " NO4nlFkX9qgVrgFIIJJT2KadHoop1r65O9ffncK14qpNo3eTsNDq3hRlteb7ylmlJ8CoakUWZeXD"
+ " DP9ZboWxZkyp+9903OrToRvOgeWSc+YrqcRZOv7r6tTALTk4U9OTKDG9/eNWSGQqD7Qd/9rssfF0"
+ " uJEGHnbsk/Hvdxn8apgWN1Zwt6tsT7f/DO0Pdlaso9g7PVy8R+B3VkWAh76uCcICIPFBluC/ljaH"
+ " V8hI+VsCLpMClo83YMCEM6E6nAPD22+fDR/DF9P73P04yUvJVHx4cnHPrpxVrPbaJoKrr9mUOLFy"
+ " VRekX78ZRgiFiKYDNsiq9+148oRy+VehpmBoQ+T2EPeDFQ8JJ4xT8H7qdyr1swSk/9Lu4K0kw/yC"
+ " TSb9K/wCuiHiuoSB54rzJoQxz90gS868r/+JGahYwHY5dUh1RbA4g5N8H3TDThc=</X509Certificate>"
+ " </X509Data> </KeyInfo> </Signature> <saml2p:Status> <saml2p:StatusCode"
+ " Value=\"urn:oasis:names:tc:SAML:2.0:status:Success\" /> </saml2p:Status>"
+ " <saml2:Assertion xmlns:saml2=\"urn:oasis:names:tc:SAML:2.0:assertion\""
+ " ID=\"_6b9580aa-08b1-4f19-8fb6-8b670d070bad\""
+ " IssueInstant=\"2023-02-28T16:27:25.400Z\" Version=\"2.0\"> <saml2:Issuer"
+ " Format=\"urn:oasis:names:tc:SAML:2.0:nameid-format:entity\">"
+ " https://posteid.poste.it</saml2:Issuer> <Signature"
+ " xmlns=\"http://www.w3.org/2000/09/xmldsig#\"> <SignedInfo>"
+ " <CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\""
+ " /> <SignatureMethod"
+ " Algorithm=\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\" /> <Reference"
+ " URI=\"#_6b9580aa-08b1-4f19-8fb6-8b670d070bad\"> <Transforms> <Transform"
+ " Algorithm=\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\" />"
+ " <Transform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\" />"
+ " </Transforms> <DigestMethod"
+ " Algorithm=\"http://www.w3.org/2001/04/xmlenc#sha256\" />"
+ " <DigestValue>ViSjPfKj683dCuO7FdSzbQjw+vECYfoxgTeiVSgxr+I=</DigestValue>"
+ " </Reference> </SignedInfo>"
+ " <SignatureValue>O9lmrtHPudDz2fzzNH3DQxWy2rlXE56G54Siq7OPMYwps/cyo3wKo7+PwMJYNhhz1l57OYJ5e/MF"
+ " ctVtYyl2rWo3QZOidWhg8WINIEqtFXIpk+ht5i2t3P1132/iL/gnY+fgemhnbOV/otEspHA4Wsio"
+ " I8xWjekAFlHBTOTtO9vzzqTtf+yalf+6pZmRLtOYrMMV4W3QZ2oLr7C2vTgcl5eVXJyGf0U8Y2bf"
+ " 7OPRHJNnVs4S8ztWQEwqZLFA1SvyCx1Nx6f+xd9lT7Lo1h81MRMdvRTk3rAaWYaqAmU9mxVnzsw4"
+ " xaLjxR4rE2drY3eb+O8uHZbzFlOhPtaINRPILg==</SignatureValue> <KeyInfo> <X509Data>"
+ " <X509Certificate>MIIFgzCCA2ugAwIBAgIIJSppAZKg/XQwDQYJKoZIhvcNAQELBQAwZTELMAkGA1UEBhMCSVQxHjAc"
+ " BgNVB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wEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwQwJwYDVR0RBCAwHoEc"
+ " aWRwLXBvc3RlaWRAcG9zdGVpdGFsaWFuZS5pdDANBgkqhkiG9w0BAQsFAAOCAgEAp0EhITlTx+cO"
+ " aoXw//nBl6Q4y82MfSGfPJIw3ROV1z3tHBctaksi/RxAzyMD5beO2s8Q6lXx0sLMCcuUQmzHj3eJ"
+ " bqn+6sIUr000dSlX/iPgVUc2dvPIZZg9xu38J8NvCfrtgAGY5iMVFMd3CZLFw0ybr+Bx/1K/NhQO"
+ " 7jxn0RSGA1J4mM2syVhEDUODs9kz3T4kXYUofwwvPL1a9xB9RBqbp7plYtbBBdftEORUQrWzH1mz"
+ " NO4nlFkX9qgVrgFIIJJT2KadHoop1r65O9ffncK14qpNo3eTsNDq3hRlteb7ylmlJ8CoakUWZeXD"
+ " DP9ZboWxZkyp+9903OrToRvOgeWSc+YrqcRZOv7r6tTALTk4U9OTKDG9/eNWSGQqD7Qd/9rssfF0"
+ " uJEGHnbsk/Hvdxn8apgWN1Zwt6tsT7f/DO0Pdlaso9g7PVy8R+B3VkWAh76uCcICIPFBluC/ljaH"
+ " V8hI+VsCLpMClo83YMCEM6E6nAPD22+fDR/DF9P73P04yUvJVHx4cnHPrpxVrPbaJoKrr9mUOLFy"
+ " VRekX78ZRgiFiKYDNsiq9+148oRy+VehpmBoQ+T2EPeDFQ8JJ4xT8H7qdyr1swSk/9Lu4K0kw/yC"
+ " TSb9K/wCuiHiuoSB54rzJoQxz90gS868r/+JGahYwHY5dUh1RbA4g5N8H3TDThc=</X509Certificate>"
+ " </X509Data> </KeyInfo> </Signature> <saml2:Subject> <saml2:NameID"
+ " Format=\"urn:oasis:names:tc:SAML:2.0:nameid-format:transient\""
+ " NameQualifier=\"https://posteid.poste.it\">SPID-d4de186b-e103-4b39-8209-0bccc7b1acdd</saml2:NameID>"
+ " <saml2:SubjectConfirmation Method=\"urn:oasis:names:tc:SAML:2.0:cm:bearer\">"
+ " <saml2:SubjectConfirmationData"
+ " InResponseTo=\"sha256-a7qE0Y0DyqeOFFREIQSLKfu5WlbckdxVXKFasfcI-Dg\""
+ " NotOnOrAfter=\"2023-02-28T16:28:25.400Z\""
+ " Recipient=\"https://app-backend.io.italia.it/assertionConsumerService\" />"
+ " </saml2:SubjectConfirmation> </saml2:Subject> <saml2:Conditions"
+ " NotBefore=\"2023-02-28T16:27:25.400Z\""
+ " NotOnOrAfter=\"2023-02-28T16:28:25.400Z\"> <saml2:AudienceRestriction>"
+ " <saml2:Audience>https://app-backend.io.italia.it</saml2:Audience>"
+ " </saml2:AudienceRestriction> </saml2:Conditions> <saml2:AuthnStatement"
+ " AuthnInstant=\"2023-02-28T16:27:25.400Z\"> <saml2:AuthnContext>"
+ " <saml2:AuthnContextClassRef>https://www.spid.gov.it/SpidL2</saml2:AuthnContextClassRef>"
+ " </saml2:AuthnContext> </saml2:AuthnStatement> <saml2:AttributeStatement>"
+ " <saml2:Attribute FriendlyName=\"Codice fiscale\" Name=\"fiscalNumber\">"
+ " <saml2:AttributeValue xmlns:xs=\"http://www.w3.org/2001/XMLSchema\""
+ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"xs:string\">"
+ " TINIT-AAAAAA89S20I111X</saml2:AttributeValue> </saml2:Attribute>"
+ " </saml2:AttributeStatement> </saml2:Assertion> </saml2p:Response>";
public static final String RESPONSE_STRING =
"{\"response_xml\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\""
+ " standalone=\\\"no\\\"?> <saml2p:Response"
+ " xmlns:saml2p=\\\"urn:oasis:names:tc:SAML:2.0:protocol\\\""
+ " Destination=\\\"https://app-backend.io.italia.it/assertionConsumerService\\\""
+ " ID=\\\"_de2ce675-f1e5-46fc-96ed-019803471175\\\""
+ " InResponseTo=\\\"sha256-a7qE0Y0DyqeOFFREIQSLKfu5WlbckdxVXKFasfcI-Dg\\\""
+ " IssueInstant=\\\"2023-02-28T16:27:26.400Z\\\" Version=\\\"2.0\\\">"
+ " <saml2:Issuer"
+ " xmlns:saml2=\\\"urn:oasis:names:tc:SAML:2.0:assertion\\\">https://posteid.poste.it</saml2:Issuer>"
+ " <Signature xmlns=\\\"http://www.w3.org/2000/09/xmldsig#\\\"> <SignedInfo>"
+ " <CanonicalizationMethod"
+ " Algorithm=\\\"http://www.w3.org/2001/10/xml-exc-c14n#\\\" /> <SignatureMethod"
+ " Algorithm=\\\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\\\" />"
+ " <Reference URI=\\\"#_de2ce675-f1e5-46fc-96ed-019803471175\\\"> <Transforms>"
+ " <Transform"
+ " Algorithm=\\\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\\\" />"
+ " <Transform Algorithm=\\\"http://www.w3.org/2001/10/xml-exc-c14n#\\\" />"
+ " </Transforms> <DigestMethod"
+ " Algorithm=\\\"http://www.w3.org/2001/04/xmlenc#sha256\\\" />"
+ " <DigestValue>IYCwE8NJNGLAGdL8zA/W/kuTLdlHMMXMeP2hei8LYqU=</DigestValue>"
+ " </Reference> </SignedInfo>"
+ " <SignatureValue>GI9CwzYfcmTBE9Lf7Hvqr2bgCkfbuq6vZPwZaaCmxq5cicDf7+k6TYussUx147iAdngl4vMixAjA"
+ " eABU0cSrZllLW0Gqxm+EPvylwMc4O1tNYlpvjnZzW7PIRns5M22KSzfHBDdGZG7Dq4uDHVbGCENu"
+ " TV5UaGNQJ2sNTD95Qaz6pmQtx0guehDc/m5ldFvChqZTKrOcVu+qTRFkW+OabbnkmKXPSWpTN9WE"
+ " 4RramWgWkNE/sn4z0Rwmnei8oEhcBKSpOMrenbMgpCYjoRto5lDGGJrMkeKsJ1PzD1ZCrE/GkzX9"
+ " HtXHIaYE6cZ7vBXQh4SVpl26JGQ87tu2YLeoZw==</SignatureValue> <KeyInfo> <X509Data>"
+ " <X509Certificate>MIIFgzCCA2ugAwIBAgIIJSppAZKg/XQwDQYJKoZIhvcNAQELBQ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5pdC9waS1DQS9jcmwuY3JsMA4G"
+ " A1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwQwJwYDVR0RBCAwHoEc"
+ " aWRwLXBvc3RlaWRAcG9zdGVpdGFsaWFuZS5pdDANBgkqhkiG9w0BAQsFAAOCAgEAp0EhITlTx+cO"
+ " aoXw//nBl6Q4y82MfSGfPJIw3ROV1z3tHBctaksi/RxAzyMD5beO2s8Q6lXx0sLMCcuUQmzHj3eJ"
+ " bqn+6sIUr000dSlX/iPgVUc2dvPIZZg9xu38J8NvCfrtgAGY5iMVFMd3CZLFw0ybr+Bx/1K/NhQO"
+ " 7jxn0RSGA1J4mM2syVhEDUODs9kz3T4kXYUofwwvPL1a9xB9RBqbp7plYtbBBdftEORUQrWzH1mz"
+ " NO4nlFkX9qgVrgFIIJJT2KadHoop1r65O9ffncK14qpNo3eTsNDq3hRlteb7ylmlJ8CoakUWZeXD"
+ " DP9ZboWxZkyp+9903OrToRvOgeWSc+YrqcRZOv7r6tTALTk4U9OTKDG9/eNWSGQqD7Qd/9rssfF0"
+ " uJEGHnbsk/Hvdxn8apgWN1Zwt6tsT7f/DO0Pdlaso9g7PVy8R+B3VkWAh76uCcICIPFBluC/ljaH"
+ " V8hI+VsCLpMClo83YMCEM6E6nAPD22+fDR/DF9P73P04yUvJVHx4cnHPrpxVrPbaJoKrr9mUOLFy"
+ " VRekX78ZRgiFiKYDNsiq9+148oRy+VehpmBoQ+T2EPeDFQ8JJ4xT8H7qdyr1swSk/9Lu4K0kw/yC"
+ " TSb9K/wCuiHiuoSB54rzJoQxz90gS868r/+JGahYwHY5dUh1RbA4g5N8H3TDThc=</X509Certificate>"
+ " </X509Data> </KeyInfo> </Signature> <saml2p:Status> <saml2p:StatusCode"
+ " Value=\\\"urn:oasis:names:tc:SAML:2.0:status:Success\\\" /> </saml2p:Status>"
+ " <saml2:Assertion xmlns:saml2=\\\"urn:oasis:names:tc:SAML:2.0:assertion\\\""
+ " ID=\\\"_6b9580aa-08b1-4f19-8fb6-8b670d070bad\\\""
+ " IssueInstant=\\\"2023-02-28T16:27:25.400Z\\\" Version=\\\"2.0\\\">"
+ " <saml2:Issuer Format=\\\"urn:oasis:names:tc:SAML:2.0:nameid-format:entity\\\">"
+ " https://posteid.poste.it</saml2:Issuer> <Signature"
+ " xmlns=\\\"http://www.w3.org/2000/09/xmldsig#\\\"> <SignedInfo>"
+ " <CanonicalizationMethod"
+ " Algorithm=\\\"http://www.w3.org/2001/10/xml-exc-c14n#\\\" /> <SignatureMethod"
+ " Algorithm=\\\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\\\" />"
+ " <Reference URI=\\\"#_6b9580aa-08b1-4f19-8fb6-8b670d070bad\\\"> <Transforms>"
+ " <Transform"
+ " Algorithm=\\\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\\\" />"
+ " <Transform Algorithm=\\\"http://www.w3.org/2001/10/xml-exc-c14n#\\\" />"
+ " </Transforms> <DigestMethod"
+ " Algorithm=\\\"http://www.w3.org/2001/04/xmlenc#sha256\\\" />"
+ " <DigestValue>ViSjPfKj683dCuO7FdSzbQjw+vECYfoxgTeiVSgxr+I=</DigestValue>"
+ " </Reference> </SignedInfo>"
+ " <SignatureValue>O9lmrtHPudDz2fzzNH3DQxWy2rlXE56G54Siq7OPMYwps/cyo3wKo7+PwMJYNhhz1l57OYJ5e/MF"
+ " ctVtYyl2rWo3QZOidWhg8WINIEqtFXIpk+ht5i2t3P1132/iL/gnY+fgemhnbOV/otEspHA4Wsio"
+ " I8xWjekAFlHBTOTtO9vzzqTtf+yalf+6pZmRLtOYrMMV4W3QZ2oLr7C2vTgcl5eVXJyGf0U8Y2bf"
+ " 7OPRHJNnVs4S8ztWQEwqZLFA1SvyCx1Nx6f+xd9lT7Lo1h81MRMdvRTk3rAaWYaqAmU9mxVnzsw4"
+ " xaLjxR4rE2drY3eb+O8uHZbzFlOhPtaINRPILg==</SignatureValue> <KeyInfo> <X509Data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aXQwOAYD"
+ " VR0fBDEwLzAtoCugKYYnaHR0cDovL3Bvc3RlY2VydC5wb3N0ZS5pdC9waS1DQS9jcmwuY3JsMA4G"
+ " A1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwQwJwYDVR0RBCAwHoEc"
+ " aWRwLXBvc3RlaWRAcG9zdGVpdGFsaWFuZS5pdDANBgkqhkiG9w0BAQsFAAOCAgEAp0EhITlTx+cO"
+ " aoXw//nBl6Q4y82MfSGfPJIw3ROV1z3tHBctaksi/RxAzyMD5beO2s8Q6lXx0sLMCcuUQmzHj3eJ"
+ " bqn+6sIUr000dSlX/iPgVUc2dvPIZZg9xu38J8NvCfrtgAGY5iMVFMd3CZLFw0ybr+Bx/1K/NhQO"
+ " 7jxn0RSGA1J4mM2syVhEDUODs9kz3T4kXYUofwwvPL1a9xB9RBqbp7plYtbBBdftEORUQrWzH1mz"
+ " NO4nlFkX9qgVrgFIIJJT2KadHoop1r65O9ffncK14qpNo3eTsNDq3hRlteb7ylmlJ8CoakUWZeXD"
+ " DP9ZboWxZkyp+9903OrToRvOgeWSc+YrqcRZOv7r6tTALTk4U9OTKDG9/eNWSGQqD7Qd/9rssfF0"
+ " uJEGHnbsk/Hvdxn8apgWN1Zwt6tsT7f/DO0Pdlaso9g7PVy8R+B3VkWAh76uCcICIPFBluC/ljaH"
+ " V8hI+VsCLpMClo83YMCEM6E6nAPD22+fDR/DF9P73P04yUvJVHx4cnHPrpxVrPbaJoKrr9mUOLFy"
+ " VRekX78ZRgiFiKYDNsiq9+148oRy+VehpmBoQ+T2EPeDFQ8JJ4xT8H7qdyr1swSk/9Lu4K0kw/yC"
+ " TSb9K/wCuiHiuoSB54rzJoQxz90gS868r/+JGahYwHY5dUh1RbA4g5N8H3TDThc=</X509Certificate>"
+ " </X509Data> </KeyInfo> </Signature> <saml2:Subject> <saml2:NameID"
+ " Format=\\\"urn:oasis:names:tc:SAML:2.0:nameid-format:transient\\\""
+ " NameQualifier=\\\"https://posteid.poste.it\\\">SPID-d4de186b-e103-4b39-8209-0bccc7b1acdd</saml2:NameID>"
+ " <saml2:SubjectConfirmation"
+ " Method=\\\"urn:oasis:names:tc:SAML:2.0:cm:bearer\\\">"
+ " <saml2:SubjectConfirmationData"
+ " InResponseTo=\\\"sha256-a7qE0Y0DyqeOFFREIQSLKfu5WlbckdxVXKFasfcI-Dg\\\""
+ " NotOnOrAfter=\\\"2023-02-28T16:28:25.400Z\\\""
+ " Recipient=\\\"https://app-backend.io.italia.it/assertionConsumerService\\\" />"
+ " </saml2:SubjectConfirmation> </saml2:Subject> <saml2:Conditions"
+ " NotBefore=\\\"2023-02-28T16:27:25.400Z\\\""
+ " NotOnOrAfter=\\\"2023-02-28T16:28:25.400Z\\\"> <saml2:AudienceRestriction>"
+ " <saml2:Audience>https://app-backend.io.italia.it</saml2:Audience>"
+ " </saml2:AudienceRestriction> </saml2:Conditions> <saml2:AuthnStatement"
+ " AuthnInstant=\\\"2023-02-28T16:27:25.400Z\\\"> <saml2:AuthnContext>"
+ " <saml2:AuthnContextClassRef>https://www.spid.gov.it/SpidL2</saml2:AuthnContextClassRef>"
+ " </saml2:AuthnContext> </saml2:AuthnStatement> <saml2:AttributeStatement>"
+ " <saml2:Attribute FriendlyName=\\\"Codice fiscale\\\" Name=\\\"fiscalNumber\\\">"
+ " <saml2:AttributeValue xmlns:xs=\\\"http://www.w3.org/2001/XMLSchema\\\""
+ " xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\""
+ " xsi:type=\\\"xs:string\\\"> TINIT-AAAAAA89S20I111X</saml2:AttributeValue>"
+ " </saml2:Attribute> </saml2:AttributeStatement> </saml2:Assertion>"
+ " </saml2p:Response>\"}";
public static final String ASSERTION_REF = "sha256-a7qE0Y0DyqeOFFREIQSLKfu5WlbckdxVXKFasfcI-Dg";
public static final String WRONG_ASSERTION_REF =
"sha256-a7qE0Y0DyqeOFFREIQSLKfu5WlbckdxVXKFasfXXXXX";
public static final String JWT = "Bearer aValidJWT";
public static void createExpectationAssertionFound() {
new MockServerClient("localhost", 2000)
.when(
request()
.withMethod("GET")
.withPath("/assertions/{assertion}")
.withPathParameter("assertion", ASSERTION_REF)
.withHeaders(
new Header("Accept", "application/json"),
new Header("x-pagopa-lollipop-auth", JWT)))
.respond(response().withStatusCode(200).withBody(RESPONSE_STRING));
}
public static void createExpectationAssertionNotFound() {
new MockServerClient("localhost", 2000)
.when(
request()
.withMethod("GET")
.withPath("/assertions/{assertion}")
.withPathParameter("assertion", WRONG_ASSERTION_REF)
.withHeaders(
new Header("Accept", "application/json"),
new Header("x-pagopa-lollipop-auth", JWT)))
.respond(response().withStatusCode(404).withBody("{}"));
}
}