Skip to content

Commit

Permalink
Merge pull request #22455 from VimukthiRajapaksha/master_rar
Browse files Browse the repository at this point in the history
Enable RAR integration tests
  • Loading branch information
Thumimku authored Jan 27, 2025
2 parents e2326a8 + 6d1ebb7 commit b7574a5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,23 @@ public void testAccessTokenRequestWithoutAuthorizationDetails(Asserter asserter)
description = "Test authorization code grant flow with invalid authorization details")
public void testAuthorizationCodeGrantFlowWithInvalidAuthorizationDetails(Asserter asserter) throws Exception {

final HttpResponse response = super.sendPostRequestWithParameters(this.client,
this.getAuthzRequestParams(asserter), OAuth2Constant.AUTHORIZE_ENDPOINT_URL);
final Header locationHeader = response.getFirstHeader(OAuth2Constant.HTTP_RESPONSE_HEADER_LOCATION);
HttpResponse response = super.sendPostRequestWithParameters(this.client, this.getAuthzRequestParams(asserter),
OAuth2Constant.AUTHORIZE_ENDPOINT_URL);
Header locationHeader = response.getFirstHeader(OAuth2Constant.HTTP_RESPONSE_HEADER_LOCATION);
final String sessionDataKey = DataExtractUtil.getParamFromURIString(locationHeader.getValue(),
OAuth2Constant.SESSION_DATA_KEY);
EntityUtils.consume(response.getEntity());

if (StringUtils.isNotBlank(sessionDataKey)) {
// A user session might not available - trying to authenticate the user
response = sendLoginPost(this.client, sessionDataKey);
locationHeader = response.getFirstHeader(OAuth2Constant.HTTP_RESPONSE_HEADER_LOCATION);
EntityUtils.consume(response.getEntity());

response = sendGetRequest(this.client, locationHeader.getValue());
locationHeader = response.getFirstHeader(OAuth2Constant.HTTP_RESPONSE_HEADER_LOCATION);
EntityUtils.consume(response.getEntity());
}

assertEquals(DataExtractUtil.getParamFromURIString(locationHeader.getValue(), ERROR),
INVALID_AUTHORIZATION_DETAILS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@
<class name="org.wso2.identity.integration.test.actions.PreIssueAccessTokenActionFailureRefreshTokenGrantTestCase"/>
<class name="org.wso2.identity.integration.test.actions.PreIssueAccessTokenActionWithRulesAtPasswordGrantTestCase"/>
<class name="org.wso2.identity.integration.test.actions.PreIssueAccessTokenActionWithRulesAtAuthorizationCodeGrantTestCase"/>
<class name="org.wso2.identity.integration.test.oauth2.OAuth2RichAuthorizationRequestsTestCase"/>
<class name="org.wso2.identity.integration.test.oauth2.OAuth2RichAuthorizationRequestsGrantTypesTestCase"/>
<class name="org.wso2.identity.integration.test.oauth2.Oauth2ImpersonationTestCase"/>
<class name="org.wso2.identity.integration.test.oidc.OIDCAccessTokenAttributesTestCase"/>
<class name="org.wso2.identity.integration.test.oauth2.OAuth2AuthorizationCodeGrantJWTTokenTestCase"/>
Expand All @@ -148,9 +150,6 @@
<class name="org.wso2.identity.integration.test.oauth2.OAuthAppsWithSameClientIdTestCase"/>
<class name="org.wso2.identity.integration.test.oidc.OIDCPasswordGrantTest"/>
<class name="org.wso2.identity.integration.test.saml.RegistryMountTestCase"/>
<!-- Temporary disabling until FW PR gets merge -->
<!-- <class name="org.wso2.identity.integration.test.oauth2.OAuth2RichAuthorizationRequestsTestCase"/>-->
<!-- <class name="org.wso2.identity.integration.test.oauth2.OAuth2RichAuthorizationRequestsGrantTypesTestCase"/>-->
</classes>
</test>

Expand Down

0 comments on commit b7574a5

Please sign in to comment.