forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use non-deprecated Kibana SAML callback URL in tests (elastic#98882)
/api/security/saml/callback is the correct URL, while /api/security/v1/saml is the deprecated URL. See also: elastic/kibana#81733 Fixes: elastic#99985 --------- Co-authored-by: Craig Rodrigues <[email protected]> Signed-off-by: Athena Brown <[email protected]>
- Loading branch information
Showing
2 changed files
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pr: 99983 | ||
summary: Use non-deprecated SAML callback URL in tests | ||
area: Authorization | ||
type: enhancement | ||
issues: | ||
- 99985 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,14 +59,14 @@ public class TransportSamlInitiateSingleSignOnActionTests extends IdpSamlTestCas | |
public void testGetResponseForRegisteredSp() throws Exception { | ||
final SamlInitiateSingleSignOnRequest request = new SamlInitiateSingleSignOnRequest(); | ||
request.setSpEntityId("https://sp.some.org"); | ||
request.setAssertionConsumerService("https://sp.some.org/api/security/v1/saml"); | ||
request.setAssertionConsumerService("https://sp.some.org/api/security/saml/callback"); | ||
final PlainActionFuture<SamlInitiateSingleSignOnResponse> future = new PlainActionFuture<>(); | ||
final TransportSamlInitiateSingleSignOnAction action = setupTransportAction(true); | ||
action.doExecute(mock(Task.class), request, future); | ||
|
||
final SamlInitiateSingleSignOnResponse response = future.get(); | ||
assertThat(response.getEntityId(), equalTo("https://sp.some.org")); | ||
assertThat(response.getPostUrl(), equalTo("https://sp.some.org/api/security/v1/saml")); | ||
assertThat(response.getPostUrl(), equalTo("https://sp.some.org/api/security/saml/callback")); | ||
assertThat(response.getSamlResponse(), containsString(TRANSIENT)); | ||
assertContainsAttributeWithValue(response.getSamlResponse(), "email", "[email protected]"); | ||
assertContainsAttributeWithValue(response.getSamlResponse(), "name", "Saml Enduser"); | ||
|
@@ -77,7 +77,7 @@ public void testGetResponseForRegisteredSp() throws Exception { | |
public void testGetResponseWithoutSecondaryAuthenticationInIdpInitiated() throws Exception { | ||
final SamlInitiateSingleSignOnRequest request = new SamlInitiateSingleSignOnRequest(); | ||
request.setSpEntityId("https://sp.some.org"); | ||
request.setAssertionConsumerService("https://sp.some.org/api/security/v1/saml"); | ||
request.setAssertionConsumerService("https://sp.some.org/api/security/saml/callback"); | ||
final PlainActionFuture<SamlInitiateSingleSignOnResponse> future = new PlainActionFuture<>(); | ||
final TransportSamlInitiateSingleSignOnAction action = setupTransportAction(false); | ||
action.doExecute(mock(Task.class), request, future); | ||
|
@@ -89,7 +89,7 @@ public void testGetResponseWithoutSecondaryAuthenticationInIdpInitiated() throws | |
public void testGetResponseForNotRegisteredSpInIdpInitiated() throws Exception { | ||
final SamlInitiateSingleSignOnRequest request = new SamlInitiateSingleSignOnRequest(); | ||
request.setSpEntityId("https://sp2.other.org"); | ||
request.setAssertionConsumerService("https://sp2.some.org/api/security/v1/saml"); | ||
request.setAssertionConsumerService("https://sp2.some.org/api/security/saml/callback"); | ||
final PlainActionFuture<SamlInitiateSingleSignOnResponse> future = new PlainActionFuture<>(); | ||
final TransportSamlInitiateSingleSignOnAction action = setupTransportAction(true); | ||
action.doExecute(mock(Task.class), request, future); | ||
|
@@ -179,7 +179,7 @@ private TransportSamlInitiateSingleSignOnAction setupTransportAction(boolean wit | |
"https://sp.some.org", | ||
"test sp", | ||
true, | ||
new URL("https://sp.some.org/api/security/v1/saml"), | ||
new URL("https://sp.some.org/api/security/saml/callback"), | ||
TRANSIENT, | ||
Duration.ofMinutes(5), | ||
null, | ||
|