Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comprehensive integration tests for Authorization Code Grant for JWT Access Tokens #21045

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

malithie
Copy link
Member

@malithie malithie commented Sep 3, 2024

Resolves #21046

This PR incorporates integration tests for Authorization Code grant.

  • Rather than relying on the playground sample app this test case directly invokes the authorization server for login
  • Validate audience, expiry, user claims, and standard claims of the access token
  • Trigger the refresh token flow and validate audience, expiry, user claims, and standard claims of the access token obtained with refresh

@jenkins-is-staging
Copy link
Contributor

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/10693542099

@jenkins-is-staging
Copy link
Contributor

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/10693542099
Status: failure

@jenkins-is-staging
Copy link
Contributor

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/10693891676

@jenkins-is-staging
Copy link
Contributor

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/10693891676
Status: success

Copy link
Contributor

@jenkins-is-staging jenkins-is-staging left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/10693891676

import static org.wso2.identity.integration.test.utils.OAuth2Constant.ACCESS_TOKEN_ENDPOINT;
import static org.wso2.identity.integration.test.utils.OAuth2Constant.AUTHORIZATION_HEADER;

public class OAuth2RefreshGrantJWTTokenTestCase extends OAuth2ServiceAbstractIntegrationTest {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this class added to testng file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it's kept as this so we can invoke from different grants like password etc. As an additional improvement I'm looking at invoking this programmatically as a test class. That's why it's added with test annotations.

Will do that improvement separately

@malithie malithie merged commit 4cd5b83 into wso2:master Sep 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a more comprehensive integration test covering authorization code grant for JWT tokens
3 participants