Skip to content

Commit 7e83fd5

Browse files
committed
Add Test Saml 2.0 Test Objects
1 parent 7592483 commit 7e83fd5

File tree

3 files changed

+117
-0
lines changed

3 files changed

+117
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright 2002-2024 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.security.saml2.provider.service.authentication;
18+
19+
import org.springframework.security.saml2.provider.service.authentication.logout.Saml2LogoutRequest;
20+
import org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistration;
21+
import org.springframework.security.saml2.provider.service.registration.Saml2MessageBinding;
22+
import org.springframework.security.saml2.provider.service.registration.TestRelyingPartyRegistrations;
23+
24+
public final class TestSaml2LogoutRequests {
25+
26+
private TestSaml2LogoutRequests() {
27+
28+
}
29+
30+
public static Saml2LogoutRequest create() {
31+
RelyingPartyRegistration registration = TestRelyingPartyRegistrations.relyingPartyRegistration().build();
32+
return Saml2LogoutRequest.withRelyingPartyRegistration(registration)
33+
.samlRequest("samlRequest")
34+
.binding(Saml2MessageBinding.POST)
35+
.location("location")
36+
.relayState("relayState")
37+
.id("id")
38+
.build();
39+
}
40+
41+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2002-2024 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.security.saml2.provider.service.authentication;
18+
19+
import org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistration;
20+
import org.springframework.security.saml2.provider.service.registration.TestRelyingPartyRegistrations;
21+
22+
public final class TestSaml2PostAuthenticationRequests {
23+
24+
private TestSaml2PostAuthenticationRequests() {
25+
}
26+
27+
public static Saml2PostAuthenticationRequest create() {
28+
RelyingPartyRegistration registration = TestRelyingPartyRegistrations.relyingPartyRegistration().build();
29+
return Saml2PostAuthenticationRequest.withRelyingPartyRegistration(registration)
30+
.authenticationRequestUri("uri")
31+
.samlRequest("samlRequest")
32+
.id("id")
33+
.relayState("relayState")
34+
.build();
35+
}
36+
37+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright 2002-2024 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.security.saml2.provider.service.authentication;
18+
19+
import org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistration;
20+
import org.springframework.security.saml2.provider.service.registration.TestRelyingPartyRegistrations;
21+
22+
public final class TestSaml2RedirectAuthenticationRequests {
23+
24+
private TestSaml2RedirectAuthenticationRequests() {
25+
}
26+
27+
public static Saml2RedirectAuthenticationRequest create() {
28+
RelyingPartyRegistration registration = TestRelyingPartyRegistrations.relyingPartyRegistration().build();
29+
return Saml2RedirectAuthenticationRequest.withRelyingPartyRegistration(registration)
30+
.authenticationRequestUri("uri")
31+
.samlRequest("samlRequest")
32+
.id("id")
33+
.relayState("relayState")
34+
.sigAlg("sigAlg")
35+
.signature("signature")
36+
.build();
37+
}
38+
39+
}

0 commit comments

Comments
 (0)